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

Logout should not force query string parameters #9

Open
wshaddix opened this issue Nov 30, 2016 · 1 comment
Open

Logout should not force query string parameters #9

wshaddix opened this issue Nov 30, 2016 · 1 comment
Labels

Comments

@wshaddix
Copy link

When a user logs out of my application, the only thing that is needed is to clear the token and refresh the application by navigating back to the start url. Currently the logout() method also appends query string parameters, expecting the server to do something with the redirectUri, but in my case, I don't want to log the user out of the STS (Azure AD) ... only my application.

Is there a way that we can configure aurelia-oauth to make setting the queyr string parameters of the redirectUrl optional for this use case?

public logout = (): void => {
        var redirectUrl = `${this.config.logoutUrl}?` +
            `${this.config.logoutRedirectParameterName}=${encodeURIComponent(this.config.redirectUri)}`;

        window.location.href = redirectUrl;
        this.oAuthTokenService.removeToken();
    };   
@matik12
Copy link
Owner

matik12 commented Feb 17, 2017

@wshaddix my question is, what do you mean by logging out only from your application?

In case of implicit grant flow, there is an external endpoint (API - Identity Server) which performs the authorization and then redirect browser back to your application. Your application does not perform authorization, but only intercept token to use it when calling protected resources. If you just remove the stored token and refresh the app, it will redirect browser to the Identity Server endpoint and as long there is already logged user (i.e. proper cookies) the browser will simply go back to your app with the same user you had before. Without logging out on the identity server side you won't be able to change the user, who wants to be logged in.

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

No branches or pull requests

2 participants