1
votes

I am reviewing OKTA. I have two authorization servers configured, the default one and a custom one. I have a client (web app) that is configured and correctly logging in. I am getting back the expected id_token and access_token. The problem I am running into, is how do I call an api, that is expecting an access token from the second authorization server? How do I request an access token on behalf of the logged in user (default auth server) from the second auth server, without prompting the user to login again? This is all done in .net core mvc application.

2
So what you are trying is to authenticate against one auth server and then use same authentication to obtain tokens from second auth server ? - Kavindu Dodanduwa

2 Answers

0
votes

In each of your applications you can check for an active Okta session. If found initiate the OIDC AuthN flow.

This is the endpoint on the client you can use to check for an Active Session https://developer.okta.com/docs/api/resources/sessions#get-current-session

0
votes

You can use the following authorize URL to get the access token or id token

{{url}}/oauth2/{auth server ID}/v1/authorize?client_id={client id}&response_type=token&response_mode=fragment&scope=openid&nonce=nonce&state=state&redirect_uri={redirect url}

Get the auth server ID from the URL when you see visit the server in the UI.

The above call needs an active session so if you signed the user the first time with 'default' auth server recently. You don't need to sign the user again to get to the token for the second auth server.