Interactive Console OAuth2 Auth: 404 with self-hosted portal
See original GitHub issueWe are struggling to get the interactive console in the developer portal running for our OAuth2 secured APIs.
- we configured an OAuth2 service in the API-Management instance
- configured an API to use the OAuth2 service
- have an self-hosted portal with a custom domain behind an Azure Application Gateway
- deployed the self-hosted gateway to a storage account in the
$web
container as described in the Wiki
When we open the interactive console, we are redirected in a new window to the AAD to give our consent to use the APIs AAD application. After that we are getting redirected to something like:
https://<portal-hostname>/signin-oauth/implicit/callback#access_token=ey-<LONG_TOKEN>
&token_type=Bearer&expires_in=3599
&scope=<app-id>%2fUser.Read+<app-id>%2f.default
&state=071e290a-56ef-ba38-7335-428fa490bcbf
&session_state=9c11d1ac-52a4-4e35-9573-763fc02e05d9
But this page does not exist in our self-hosted portal. Instead a 404 page is getting displayed.
Do we need to register a special handling of the signin-oauth/implicit/callback
route? Or is there an error in our publishing step?
It was working with the managed portal.
Any advice would be appreciated!
**UPDATE **:
I managed to get it working by manually creating file in the blob storage at $web/signin-oauth/implicit/callback/index.html
which looks like this:
<!DOCTYPE html>
<html>
<head>
<title>Authentication</title>
<script type="text/javascript">
function closeWindow() {
if (opener) {
opener.postMessage({ uri: window.location.hash }, "*");
}
self.close();
}
closeWindow();
</script>
</head>
<body>
<h1>
You have successfully authenticated.
</h1>
<button onclick="closeWindow()">Close</button>
</body>
</html>
Why is this page missing in our default self-hosted portal deployment?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
@azaslonov thanks for your reply and the clarification.
It would be great to be aware of this limitations/ circumstances when starting to self host the portal. With the current documentation I had the impression I am getting the same features when using the self-hosted portal.
For others having the same challenge: Now we use an Azure function to implement the auth code backend feature.
The
backendUrl
configuration option should also work with a custom domain, which is specified for the developer portal (so also its backend) in the API Management service.