Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable url for /api/oauth2-redirect.html endpoint behind FrontDoor #244

Closed
es-alt opened this issue Sep 22, 2021 · 5 comments · Fixed by #253
Closed

Configurable url for /api/oauth2-redirect.html endpoint behind FrontDoor #244

es-alt opened this issue Sep 22, 2021 · 5 comments · Fixed by #253
Labels

Comments

@es-alt
Copy link

es-alt commented Sep 22, 2021

Hi,

We use Azure Funtion app behind FrontDoor. This adds complication of url rewrites.

The swagger url for the function app is:
https://myapp.azurewebsites.net/api/swagger/ui

With FrontDoor it becomes:
https://mycompany/api/myapp/swagger/ui

The generated oauth2 redirect is
https://mycompany/api/oauth2-redirect.html
instead of
https://mycompany/api/myapp/oauth2-redirect.html

Can we modify the prefix for the redirect url to match the path expected by FrontDoor?

@justinyoo
Copy link
Contributor

@lecamarade Thanks for the issue! Wonder whether you've found this doc or not: https://github.com/Azure/azure-functions-openapi-extension/blob/main/docs/openapi-core.md#overriding-base-urls

@justinyoo justinyoo added question Further information is requested resolved Request has been resolved labels Sep 23, 2021
@es-alt
Copy link
Author

es-alt commented Sep 23, 2021

@justinyoo , Thank you for the link, yes I did find it.
It only helps to fix the CORS issue. Unfortunately, the url there is ignored by the code that updates the oauth2-redirect.html url in swagger-ui.js

The library adds prefix that comes from HttpSettings.RoutePrefix = "api".

From swagger-ui-bundle.js:
.call(t,window.location.host,"[[SWAGGER_UI_API_PREFIX]]/oauth2-redirect.html"),

[[SWAGGER_UI_API_PREFIX]] gets replaced by RoutePrefix from above. That's separate from the base url mentioned in the docs.

@es-alt
Copy link
Author

es-alt commented Sep 24, 2021

@justinyoo, please upate the labels. This is not a question and it is not resolved.

@justinyoo justinyoo added triage and removed resolved Request has been resolved question Further information is requested labels Sep 24, 2021
@justinyoo
Copy link
Contributor

Let me take a further look.

@es-alt
Copy link
Author

es-alt commented Sep 30, 2021

@justinyoo , any updates on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants