Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

I can't get a remote client to redirect back from a production server using IdentityServer4 for authenticating. It works fine locally. What am I doing wrong?

$
0
0

I can login to my IdentityServer4 api by going directly to the url and logging in, but if I try to use the IdentityServer4 api as a remote login app for a client, while I successfully get rerouted to the login page of the IdentityServer4 ap[ , when clicking login, I don't get re-routed back.  Here are my two different clients, one for local (the localhost), and the other for the production server.  It works fine for me locally.

You'll see "test" used where the domain name would go.   And I know the client name is correct to access the IdentityServer4 api, because it won't even redirect if it is wrong.

new Client { ClientId = "MvcClientLocal", ClientName = " MVC Client", AllowedGrantTypes = GrantTypes.HybridAndClientCredentials, RequireConsent = false, ClientSecrets = { new Secret("secret".Sha256()) }, RedirectUris = { "http://localhost:8201/signin-oidc" }, PostLogoutRedirectUris = { "http://localhost:8201/signout-callback-oidc" }, AllowedCorsOrigins = { "http://localhost:8201" }, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, "api1" }, AllowOfflineAccess = true },

new Client { ClientId = "MvcClient", ClientName = "MVC Client", AllowedGrantTypes = GrantTypes.HybridAndClientCredentials, AllowAccessTokensViaBrowser = true, RequireConsent = false, ClientSecrets = { new Secret("secret".Sha256()) }, RedirectUris = { "http://test.com/signin-oidc" }, PostLogoutRedirectUris = { "http://test.com/signout-callback-oidc" }, AllowedCorsOrigins = { "http://test.com" }, AllowedScopes = { IdentityServerConstants.StandardScopes.OpenId, IdentityServerConstants.StandardScopes.Profile, "api1" }, AllowOfflineAccess = true },...there is more but, I think this is enough.

Here is my error:

test.com is currently unable to handle this request. HTTP ERROR 500

The url shows up to be the following when it tries to do the redirect:

http://test.com/connect/authorize/callback?client_id=MvcClient&redirect_uri=http%3A%2F%2F.test.com%2Fsignin-oidc&response_type=code%20id_token&scope=openid%20profile%20api1%20offline_access&response_mode=form_post.........


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>