Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-Sign-Off does not work after upgrade #1492

Closed
1 task done
feededit opened this issue Aug 3, 2022 · 6 comments
Closed
1 task done

Single-Sign-Off does not work after upgrade #1492

feededit opened this issue Aug 3, 2022 · 6 comments

Comments

@feededit
Copy link

feededit commented Aug 3, 2022

Confirm you've already contributed to this project or that you sponsor it

  • I confirm I'm a sponsor or a contributor

Version

4.x (in preview)

Describe the bug

upgraded Velusia.Client to 4.0.
everything works fine.

But when Velusia.Client logs off,
Velusia.Server is not logged off.

To reproduce

Original unmodified Velusia.Client sample

Exceptions (if any)

No response

@kevinchalet
Copy link
Member

It's not a bug: the OpenIddict client doesn't support logout yet.

@feededit
Copy link
Author

feededit commented Aug 4, 2022

And what certificate does Velusia.Client use?

  1. Using the certificate from the Velusia.Client sample as is

  2. Jointly use the already installed certificate with Velusia.Server.

  3. Do I need to create a new client certificate?

@kevinchalet
Copy link
Member

Do I need to create a new client certificate?

Yep, it's the right option: generate a new pair of signing and encryption certificates just like you did for the server certificates.

I opened #1496 to track adding logout support in the client.

@kevinchalet
Copy link
Member

@feededit
Copy link
Author

Note: when only one client is registered in the client options, setting the issuer property is not required and can be omitted.

Ask about [client options].

LogIn

public ActionResult LogIn(string returnUrl)
{
    var properties = new AuthenticationProperties(new Dictionary<string, string>
    {
        // [OpenIddictClientAspNetCoreConstants.Properties.Issuer] = "https://localhost:44313/"
    })

     ~~~~~~

}

LogOut

public async Task<ActionResult> LogOut(string returnUrl)
{
    var properties = new AuthenticationProperties(new Dictionary<string, string>
    {
        //[OpenIddictClientAspNetCoreConstants.Properties.Issuer] = "https://localhost:44313/",
        //[OpenIddictClientAspNetCoreConstants.Properties.IdentityTokenHint] = result.Properties.GetTokenValue(OpenIddictClientAspNetCoreConstants.Tokens.BackchannelIdentityToken)
     }

     ~~~~~~~
}

login works.

but why doesn't logout work?

@feededit
Copy link
Author

feededit commented Sep 2, 2022

[HttpPost("~/logout"), ValidateAntiForgeryToken]
public async Task<ActionResult> LogOut(string returnUrl)
{

It's not an error, but I fixed it like this:

[HttpGet("~/logout"), HttpPost("~/logout"), ValidateAntiForgeryToken]
public async Task<ActionResult> LogOut(string returnUrl)
{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants