mulesoft-labs / api-console-cli

A CLI tools for the API console.
Other
14 stars 15 forks source link

Auth2 popup has not given when serving protected pages #40

Closed mserge closed 5 years ago

mserge commented 5 years ago

On windows 10 I'm doing following with raml containing Oauth2 protection (works ok in Anypoint API Exchange).

npx api-console build -t "RAML 1.0" -a .\salaryapi.raml

When serving content and using TRY IT:

Set this redirect URI in OAuth 2.0 provider settings.

http://127.0.0.1:8081/bower_components/oauth-authorization/oauth-popup.html

During the test I have successfull open popup with URL specified as authorizationUri in RAML, but when it returns me back to the redirect url above:http://127.0.0.1:8081/bower_components/oauth-authorization/oauth-popup.html#access_token=

But the popup shows: ENOENT: no such file or directory, stat 'D:\prj\OB\openbanking\salary-api\RAML-proxy\build\bower_components\oauth-authorization\oauth-popup.html'

The directory structure has bower_components\oauth-authorization\oauth-popup.html both under directories: build/es6-bundle/bower_components/oauth-authorization/oauth-popup.html build/es5-bundle/bower_components/oauth-authorization/oauth-popup.html

I suppose the polyserve used doesn't support HTML redirection based on bundle version, could you suggest what can be done? Will it affect embedding scenario or using static http service?

mserge commented 5 years ago

BTW when I'm using the Anypoint Designer it gives me callback url:



https://cdn.anypoint.mulesoft.com/artifacts/api-designer/app/static/js/console-5.2.0.33/es6-bundle/bower_components/oauth-authorization/oauth-popup.html```
And exchange gives:
https://anypoint.mulesoft.com/exchange/api-console/@1.1.28/es6-bundle/bower_components/oauth-authorization/oauth-popup.html
mserge commented 5 years ago

https://github.com/mulesoft-labs/api-console-builder/issues/16 @jarrodek Pavel is that something close to change the root?

jarrodek commented 5 years ago

Hi, I am sorry for lack of response. I never saw the notification.

So, yes, the issue you have referenced was the fix to your problem. Please, let me know if the issue persists.