How to enable OAuth 2.0 Authentication?

%3CLINGO-SUB%20id%3D%22lingo-sub-1381829%22%20slang%3D%22en-US%22%3EHow%20to%20enable%20OAuth%202.0%20Authentication%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1381829%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20route%20the%20data%20of%20a%20Web%20service%20having%20REST%20API%20%3A%20%3CA%20href%3D%22http%3A%2F%2Fdemo.akeneo.com%2Fapi%2Frest%2Fv1%2Fcategories%2Fmaster%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fdemo.akeneo.com%2Fapi%2Frest%2Fv1%2Fcategories%3C%2FA%3E%20.%20I%20am%20using%20Azure%20API%20Management%20Service%20for%20this.%20I%20have%20created%20an%20Azure%20API%20management%20service%20and%20a%20Blank%20API%20for%20same.%20I%20have%20created%20a%20GET%20method%20for%20this.%20While%20testing%20this%20API%20I%20have%20I%20am%20facing%20an%20Error%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHTTP%2F1.1%20401%20Unauthorized%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecache-control%3A%20max-age%3D0%2C%20must-revalidate%2C%20no-store%2C%20private%3C%2FP%3E%3CP%3Econtent-security-policy%3A%20default-src%20'self'%20*.akeneo.com%20'unsafe-inline'%3B%20script-src%20'self'%20'unsafe-eval'%20'nonce-07f41c14e74157aff6fa6296dac0027c13e46705'%3B%20img-src%20'self'%20data%3A%20%3B%20frame-src%20*%20%3B%20font-src%20'self'%20data%3A%3C%2FP%3E%3CP%3Econtent-type%3A%20application%2Fjson%3C%2FP%3E%3CP%3Edate%3A%20Tue%2C%2012%20May%202020%2007%3A05%3A18%20GMT%3C%2FP%3E%3CP%3Eexpires%3A%20Tue%2C%2012%20May%202020%2007%3A05%3A18%20GMT%3C%2FP%3E%3CP%3Eocp-apim-trace-location%3A%20%3CA%20href%3D%22https%3A%2F%2Fapimst3v04xlapwxf3c99avt.blob.core.windows.net%2Fapiinspectorcontainer%2F9kvUzyqpMfhQQii4nn7e49QLxiE1-16%3Fsv%3D2018-03-28%26amp%3Bsr%3Db%26amp%3Bsig%3De9ETEXuY0pbzxyM%252FLBsJiidcrVL%252BROf1FnZ9652IDfw%253D%26amp%3Bse%3D2020-05-13T07%253A05%253A18Z%26amp%3Bsp%3Dr%26amp%3BtraceId%3Dba521452333d475b95521351d7ac19f3%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fapimst3v04xlapwxf3c99avt.blob.core.windows.net%2Fapiinspectorcontainer%2F9kvUzyqpMfhQQii4nn7e49QLxiE1-16%3Fsv%3D2018-03-28%26amp%3Bsr%3Db%26amp%3Bsig%3De9ETEXuY0pbzxyM%252FLBsJiidcrVL%252BROf1FnZ9652IDfw%253D%26amp%3Bse%3D2020-05-13T07%253A05%253A18Z%26amp%3Bsp%3Dr%26amp%3BtraceId%3Dba521452333d475b95521351d7ac19f3%3C%2FA%3E%3C%2FP%3E%3CP%3Epragma%3A%20no-cache%3C%2FP%3E%3CP%3Etransfer-encoding%3A%20chunked%3C%2FP%3E%3CP%3Evary%3A%20Origin%3C%2FP%3E%3CP%3Ewww-authenticate%3A%20Bearer%20realm%3D%22Service%22%2C%20error%3D%22access_denied%22%2C%20error_description%3D%22OAuth2%20authentication%20required%22%3C%2FP%3E%3CP%3Ex-content-security-policy%3A%20default-src%20'self'%20*.akeneo.com%20'unsafe-inline'%3B%20script-src%20'self'%20'unsafe-eval'%20'nonce-07f41c14e74157aff6fa6296dac0027c13e46705'%3B%20img-src%20'self'%20data%3A%20%3B%20frame-src%20*%20%3B%20font-src%20'self'%20data%3A%3C%2FP%3E%3CP%3Ex-frame-options%3A%20sameorigin%3C%2FP%3E%3CP%3Ex-webkit-csp%3A%20default-src%20'self'%20*.akeneo.com%20'unsafe-inline'%3B%20script-src%20'self'%20'unsafe-eval'%20'nonce-07f41c14e74157aff6fa6296dac0027c13e46705'%3B%20img-src%20'self'%20data%3A%20%3B%20frame-src%20*%20%3B%20font-src%20'self'%20data%3A%3C%2FP%3E%3CP%3E%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22error%22%3A%20%22access_denied%22%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%22error_description%22%3A%20%22OAuth2%20authentication%20required%22%3C%2FP%3E%3CP%3E%7D%3C%2FP%3E%3CP%3EWhen%20I%20change%20my%20Security%20to%20OAuth%202.0%20it%20gives%20says%20No%20OAuth%202.0%20servers%20were%20configured.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Rushank_0-1589269127063.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F190843i1363C51189A3DFB2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Rushank_0-1589269127063.png%22%20alt%3D%22Rushank_0-1589269127063.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20can%20anyone%20help%20with%20how%20to%20configure%20the%20OAuth%202.0%20Servers.%20Also%2C%20is%20the%20method%20I%20am%20using%20to%20in%20Azure%20API%20management%20Service%20to%20GET%20the%20data%20of%20the%20REST%20API%20correct.%20If%20there%20is%20some%20other%20work%20around%2C%20please%20specify.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1381829%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor

Hi,

I am trying to route the data of a Web service having REST API : http://demo.akeneo.com/api/rest/v1/categories . I am using Azure API Management Service for this. I have created an Azure API management service and a Blank API for same. I have created a GET method for this. While testing this API I have I am facing an Error as follows:

 

HTTP/1.1 401 Unauthorized

 

cache-control: max-age=0, must-revalidate, no-store, private

content-security-policy: default-src 'self' *.akeneo.com 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'nonce-07f41c14e74157aff6fa6296dac0027c13e46705'; img-src 'self' data: ; frame-src * ; font-src 'self' data:

content-type: application/json

date: Tue, 12 May 2020 07:05:18 GMT

expires: Tue, 12 May 2020 07:05:18 GMT

ocp-apim-trace-location: https://apimst3v04xlapwxf3c99avt.blob.core.windows.net/apiinspectorcontainer/9kvUzyqpMfhQQii4nn7e49Q...

pragma: no-cache

transfer-encoding: chunked

vary: Origin

www-authenticate: Bearer realm="Service", error="access_denied", error_description="OAuth2 authentication required"

x-content-security-policy: default-src 'self' *.akeneo.com 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'nonce-07f41c14e74157aff6fa6296dac0027c13e46705'; img-src 'self' data: ; frame-src * ; font-src 'self' data:

x-frame-options: sameorigin

x-webkit-csp: default-src 'self' *.akeneo.com 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'nonce-07f41c14e74157aff6fa6296dac0027c13e46705'; img-src 'self' data: ; frame-src * ; font-src 'self' data:

{

    "error": "access_denied",

    "error_description": "OAuth2 authentication required"

}

When I change my Security to OAuth 2.0 it gives says No OAuth 2.0 servers were configured.

Rushank_0-1589269127063.png

 

Please can anyone help with how to configure the OAuth 2.0 Servers. Also, is the method I am using to in Azure API management Service to GET the data of the REST API correct. If there is some other work around, please specify.

0 Replies