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

How to get OAuthToken instead of UserPasswordToken? #673

Open
softrare opened this issue Mar 18, 2021 · 0 comments
Open

How to get OAuthToken instead of UserPasswordToken? #673

softrare opened this issue Mar 18, 2021 · 0 comments

Comments

@softrare
Copy link

softrare commented Mar 18, 2021

I want to get the AccessToken after the user authenticated.

    $token = $tokenStorage->getToken();

    if($token instanceof OAuthToken) {
        /** @var AccessToken $accessToken */
        $accessToken = $accessTokenManager->findTokenByToken(
            $token->getToken()
        );
    }

Unfortunately the $token is always UsernamePasswordToken never OAuthToken so getToken() is not available. But it's still a normal and working oauth process and there is a normal accesstoken made and stored. I am sure I'm missing something. Anyone has a tip?

EDIT: Ok, I understood now that you first get a UsernamePasswordToken and after that an OAuthToken, but there seems to be no event where I can grab the OAuthToken from directly after the accesstoken is being created.

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

No branches or pull requests

0 participants