Scope: how do I get the token identifier (login name)?

I’m trying to create a login handler using OAuth2 on my framework and I’m using this scope:

protected function scopesToRequest( $additional=NULL )
{
    return array( 'user:read:email' );
}

It doesn’t return the login name, and due to that I got the following error when trying to save:

REPLACE INTO core_login_links ( token_login_method, token_member, token_identifier, token_linked, token_access_token, token_expires, token_refresh_token, token_scope ) VALUES ( 3, 1, NULL, 0, ‘ADMIN REMOVED’, 1700615511, ‘ADMIN REMOVED’, ‘[“user:read:email”]’ )
IPS\Db\Exception: Column ‘token_identifier’ cannot be null (1048)

The column token_identifier should store the login name.

Which scope should I add there?

Thank you.

You just leaked an access and refresh token.
I have removed them from the post.

You passed a NULL to column 3 so your database request failed.

Then you need to find out how the framework will provide this information and/or if it requires additional requests to the API to fetch it

Thank you for removing it.

I didn’t pass NULL. I don’t do a manual INSERT. Everything is handled by the framework. I just need to know how to grab the login name via scope.

I have another login handler for Spotify and it works perfectly fine because I have the right scope. I can’t find anywhere in the docs a scope for the login name.

That’s all!

There isnt’ a scope for login name.

So I don’t know what the framework you are doing is doing.

The username for a given token can be obtained from the oAuth validation endpoint or by calling the users endpoint.

Seems the library you are using is doing neither of those or it’s calling kraken (which is long dead at this point) and if it is calling kraken just glossing over the error

No, I’m not using kraken as it is deprecated over a year.

I’m using https://id.twitch.tv/oauth2/authorize and https://id.twitch.tv/oauth2/token.

Neither of those will return the username (they are not supposed to)

thats jsut the oAuth entry/operation points.

You can get the user for a token either from:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.