OAuth configuration for smartdocs not working

Hi Apigee Team,

I have configured a smart doc model in dev portal which have Oauth as secutity scheme, However when the request is send to by cliking the OAuth link getting error as "Unable to proceed because of missing OAuth configuration."

Issue I have identified is as below when the call is made for oAuth Url its calling wrong url as below

There are two forward slashes getting added in the url. Would like to check from where this url is configured and coming while clicking on setAuthod credrential link.

https://<ipaddress:port>;//v1/o/sandbox-nonprod/apimodels/pentestapiwithoauth/templateauths/OAuth2/authUrl?_=1533719550318

Error in the trace logs are as below:

Failed to load https://<ip:port>//v1/o/sandbox-nonprod/apimodels/pentestapiwithoauth/templateauths/OAuth2/authUrl?_... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://localhost' is therefore not allowed access. The response had HTTP status code 404.

Solved Solved
0 3 293
1 ACCEPTED SOLUTION

I think this is actually a CORS issue.

No 'Access-Control-Allow-Origin' header is present on the requested resource 

seems to indicate that the request was successfully sent and received by the server, but the response did not contain an Access-Control-Allow-Origin header.

CORS pre-flight requests are done by your web browser. Try hitting the same url via curl or postman, and you should get a different response. Some more info about CORS here: https://stackoverflow.com/questions/8685678/cors-how-do-preflight-an-httprequest

View solution in original post

3 REPLIES 3

I think this is actually a CORS issue.

No 'Access-Control-Allow-Origin' header is present on the requested resource 

seems to indicate that the request was successfully sent and received by the server, but the response did not contain an Access-Control-Allow-Origin header.

CORS pre-flight requests are done by your web browser. Try hitting the same url via curl or postman, and you should get a different response. Some more info about CORS here: https://stackoverflow.com/questions/8685678/cors-how-do-preflight-an-httprequest

Hi Karl,

I have already tried curl on the URL, but getting "No Service found" error. that is why suspecting the error is due to the URL issue.

I wanted to know from where this authentication URL will be formed. There is 2 forward slashes in the URL. I am not sure from where this URL is getting generated.

https://<ipaddress:port>;//v1/o/sandbox-nonprod/apimodels/pentestapiwithoauth/templateauths/OAuth2/authUrl?_=1533719550318

Thanks,

Soumya

Hi @soumya pm, I am facing same issue. Did it work for you? If yes, what did you do to make it work.