anthonychu/blazor-auth-static-web-apps

Logout from AAD

Hypothesys-Smithgor opened this issue · 0 comments

Hi Anthony,
Hopefully a very quick question.
I'm attempting to use this extension, and pretty much all working - thanks!
I can upload to Azure, and login.
However, when I try to logout, I redirect to https://identity.azurestaticapps.net/.auth/logout/complete and get a 401: Unauthorized page.
I've tried with an without the post_logout_redirect_uri but nothing seems to make a difference. Any ideas?

My login/logout is as below:

<AuthorizeView>
            <Authorized>
                Hello, @context.User.Identity.Name!
                <a href="/.auth/logout?post_logout_redirect_uri=/">Log out</a>
            </Authorized>
            <NotAuthorized>
                <a href="/.auth/login/aad">Log in</a>
            </NotAuthorized>
        </AuthorizeView>

Thanks in Advance, Gordon.

Think I just found the answer -
replaced <a href="/.auth/logout?post_logout_redirect_uri=/">Log out</a>
with <a href="/.auth/logout/complete?post_logout_redirect_uri=/">Log out</a>
And now the logout seems to work as expected.