I've a test project with this client configuration:
public class Clients : IClientStore
{
public Task<Client> FindClientByIdAsync(string clientId)
{
return Task.FromResult(new Client
{
ClientId = "client.webforms",
ClientName = "WebForms Client",
AllowedGrantTypes = GrantTypes.Hybrid,
AllowAccessTokensViaBrowser = false,
ClientSecrets =
{
new Secret("1234".Sha256())
},
RedirectUris = { "http://localhost:9869/signin-oidc" },
PostLogoutRedirectUris = { "http://localhost:9869/" },
AllowedScopes =
{
IdentityServerConstants.StandardScopes.OpenId,
CstIdSrvScopeTypes.TestWebForms
},
AllowOfflineAccess = false,
RequireConsent = false,
AlwaysIncludeUserClaimsInIdToken = true
});
}
}
When I try to validate it in LoginController I'm getting false
result (this is from Immediate Window:
returnUrl
"http://localhost:9869/signin-oidc"
this.identityServer.IsValidReturnUrl(returnUrl)
false
Also this.identityServer.GetAuthorizationContextAsync(returnUrl)
result is null
. Am I doing something wrong?
Yes - you need to add a single RedirectUri when you configur your client that is one of the RedirectUris that is in the list you have above.
Something like #
app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
{
SignInAsAuthenticationType = Settings.AuthenticationType,
Authority = config.Authority,
RedirectUri = config.RedirectUri
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With