Integarte Idsvr4 with web portal by oidc via Https
Oidc works fine on my local machine with Http that be hosted in Kestrel. But run into a lot of issues when switch to Https. When I deploy the Idsvr4 and web portal on same sever and use Https, the web portal need to redirect to Idsvr to do sign-in, I get the error is "unauthorized_client".
Error logs: Invalid redirect_uri: http://clientportal/signin-oidc { "ClientId": "grapeseed.dashboard", "ClientName": "GrapeSeed Dashboard", "RedirectUri": "http://clientportal/signin-oidc", "AllowedRedirectUris": [ "https://clientportal/signin-oidc" ], "SubjectId": "anonymous", "RequestedScopes": "", "Raw": { "client_id": "dashboard", "redirect_uri": "http://clientportal/signin-oidc" "response_type": "code id_token", "scope": "openid profile basicinfo", "response_mode": "form_post", "nonce": "636203912324322100.ZmQ5MTk5MTAtZGY3Ni00MjFkLWIyOGUtODhkOGVkY "state": "CfDJ8G9vLBoK3ENEk2u8hnV9DK0OcF8dAi3RKfbg2NZosKw6Gab2oPcR_WKx } }
I wondering why could the "https" be converted to "http" eventually.
There are less info about how to integrate IdentityServer4 with Client web application via Https. Can you provide one example for it.
If the client is at an https address then you should specify https redirects in your IS4 client setup and in your oidc settings. "redirect_uri": "https://clientportal/signin-oidc"
Thanks, I've set https for all places, in this case, it will be converted to http implicitly.
all set on this issue?
I've followed this way(https://github.com/IdentityServer/IdentityServer4/issues/213) to rewrite the host header on Idsvr side and portal side:
app.Use(async (context, next) => { context.Request.Scheme = "https"; HostString httpsHostString = new HostString("xxx"); context.Request.Host = httpsHostString; await next.Invoke(); });
Current issue has been solved. But when the authorize finished, the page would keep loading and could not redirect to the "http://clientportal/signin-oidc". Eventually it would show the "504 Gateway Time-out" page.
No error log in Idsvr side, the client portal side's log is:
fail: Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectMiddleware[17]
Exception occurred while processing message.
Microsoft.IdentityModel.Tokens.SecurityTokenExpiredException: IDX10223: Lifetime validation failed. The token is expired.
ValidTo: '01/22/2017 01:00:59'
Current time: '01/22/2017 01:05:59'.
at Microsoft.IdentityModel.Tokens.Validators.ValidateLifetime(Nullable1 notBefore, Nullable1 expires, SecurityToken securityToken, TokenValidationParameters validationParameters)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateLifetime(Nullable1 notBefore, Nullable1 expires, JwtSecurityToken securityToken, TokenValidationParameters validationParameters)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateTokenPayload(JwtSecurityToken jwt, TokenValidationParameters validationParameters)
at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(String token, TokenValidationParameters validationParameters, SecurityToken& validatedToken)
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.ValidateToken(String idToken, AuthenticationProperties properties, TokenValidationParameters validationParameters, JwtSecurityToken& jwt)
at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.
Maybe it's .net core's bug, can you give me some info to help, thanks.
Open a new issue for new topics, please.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.