Closed BlackBasha closed 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Question
Hi, I am facing a problem and I need your help please. I am using identity server version 3.1 and angular 8 for the front end and .net core web api 3.1 for the backend, also I am using oidc-client library to handle the windows authentication
The login process took long time to bring the user to the application main page. After some researches I found that the,(connect/userinfo) request took 2.19 Second and also the (/connect/token) request took between 3.12-4.1 Second. How I can make it more faster to bring the user to them main page directly, should I have to change my configurations.
Beside that when I open another tab the login starts over again and the user should wait again to get the token and user info over and over again, at this point I found that there could be a way to save the token in the cookies so that when opening another tab there would be no need to make the request again even I found a blog about that:
[(https://medium.com/@arv9135/angular-10-spa-and-identity-server-4-authorization-code-flow-with-pkce-with-cookie-storage-a572a8baa4ea) ] but here they used different angular library which I cannot use because I build my infrastructure upon the oidc-client library. Can I do the same thing with oidc-client lib? is it safe to save the token inside the cookies? Is there another way to not request the token every time? I found that we can use refresh token but i am not sure? could you please show me the way by dropping me a link
Minimal working example
forntend code : private manager = new UserManager(getClientSettings(this.authConfig));
export function getClientSettings(authConfig: AuthConfig): UserManagerSettings { return { authority: 'http://localhost:5000/' client_id: 152 redirect_uri:'http://localhost:4200/auth-callback', post_logout_redirect_uri: 'http://localhost:4200/', response_type: authConfig:'code', scope: 'openid profile api.read', filterProtocolClaims: true, loadUserInfo:true };
identity server Client definition: ClientId = "152", ClientName = "Test", AllowedGrantTypes = GrantTypes.Code, RequirePkce = true, RequireClientSecret = false, AllowedScopes = new List { "openid", "profile", "api.read" },
RedirectUris = new List { "http://localhost:4200/auth-callback" },
PostLogoutRedirectUris = new List { "http://localhost:4200/" },
AllowedCorsOrigins = new List { "http://localhost:4200" },
AllowAccessTokensViaBrowser = true,
RequireConsent = false
}
Relevant parts of the log file