IdentityModel6.0- How to pass object in RequestTokenAsync

Lalit 1 Reputation point
2022-09-26T13:24:16.12+00:00

As in identityModel3.0, there was method RequestCustomGrantAsync(this TokenClient client, string grantType, string scope = null, object extra = null, CancellationToken cancellationToken = default(CancellationToken))

but in IdentityModel6.0 it changed to RequestTokenAsync(string grantType, Parameters parameters = null, CancellationToken cancellationToken = default).

When Iam upgrading to 6.0 then not able to find the way how to pass object extra in RequestTokenAsync. Can somebody Please help me on below code?

public async Task<TokenResponse> RequestCustomGrantAsync(TokenClient client, string grantType, string scope = null, object extra = null, CancellationToken cancellationToken = default(CancellationToken))
{

        var parameters = new Parameters  
        {  
            { "scope", scope }  
        };  
          

        return await client.RequestTokenAsync(grantType,  
            parameters, cancellationToken);  
          

    }  
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,389 questions
{count} votes