WebAPI OAuth Logout - How to drop Token Cookie?

前端 未结 2 1020
深忆病人
深忆病人 2021-01-24 06:21

I have a WebAPI with OAuth login configured like this:

app.UseOpenIdConnectAuthentication(
    new OpenIdConnectAuthenticationOptions
    {
        ClientId = cl         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-24 06:30

    The easiest way is for the client itself to just "forget" the token - no need to tell server about it (this is what clearing the auth cookie really is doing - making the browser remove the cookie).

    If you want the token itself to be no longer valid, than you would need to maintain a list of revoked tokens. For various reasons you may want your access tokens to be always valid but short lived and revoke refresh tokens instead.

提交回复
热议问题