Reply to Post
Expert Spy
olegk
7 Posts
Member since ‎10.11.2011

Using Auth refresh token with .NET

I can not find any referens or a sample how to get new access token using refesh token using .NET SDK. or any other SDK, anything.

Moderator
bs595r
153 Posts
Member since ‎01.13.2012

Re: Using Auth refresh token with .NET

Hello,

 

There's a sample request towards the bottom of this page:

 

http://devconnect-api.att.com/docs/oauth-v1/obtain-access-token

 

That shows what you need to pass into the request.

 

Cheers,

     --brett

Expert Spy
olegk
7 Posts
Member since ‎10.11.2011

Re: Using Auth refresh token with .NET

The 'ExpiresIn' value in OAuthToken. Is it seconds, minutes, ticks?

Expert Spy
olegk
7 Posts
Member since ‎10.11.2011

Re: Using Auth refresh token with .NET

I'm using AT&T ATT_MSSDK .NET lib.  I do not see any params for Grant_type=refresh_token. How do I set that grant type in?

 List<RequestFactory.ScopeTypes> scopes = new List<RequestFactory.ScopeTypes>();
        scopes.Add(RequestFactory.ScopeTypes.TerminalLocation);
        RequestFactory request = new RequestFactory(ApiSettings.EndPont, ApiSettings.Key, ApiSettings.Secret, scopes, ApiSettings.Redirect, null);

Moderator
bs595r
153 Posts
Member since ‎01.13.2012

Re: Using Auth refresh token with .NET

Hello,

 

The ExpiresIn value is in seconds. You can refer here for documentation on the parameters:

 

http://devconnect-api.att.com/docs/oauth-v1/obtain-access-token

 

Cheers,

    --brett

Moderator
bs595r
153 Posts
Member since ‎01.13.2012

Re: Using Auth refresh token with .NET

Hello,

 

The SDK has the access_token and refresh_token built into the service request, so that it is abstracted from the developer. If you need direct access to these requests, you would need to contruct your own request using the REST API. More info on the REST API can be found here:

 

http://devconnect-api.att.com/docs/oauth-v1/obtain-access-token

 

Cheers,

     --brett

Expert Spy
olegk
7 Posts
Member since ‎10.11.2011

Re: Using Auth refresh token with .NET

Bret,

 

I just need to know how to use refresh token to get new access token. My scenario: I've got access token yesterday, today when i use that token i'm getting 'unauthorized' exception. My question is : How do i get new access token?

 

thanks.

Moderator
bs595r
153 Posts
Member since ‎01.13.2012

Re: Using Auth refresh token with .NET

How are you getting the initial access_token?

Expert Spy
olegk
7 Posts
Member since ‎10.11.2011

Re: Using Auth refresh token with .NET

List<RequestFactory.ScopeTypes> scopes = new List<RequestFactory.ScopeTypes>();
scopes.Add(RequestFactory.ScopeTypes.TerminalLocation);
RequestFactory request = new RequestFactory(ApiSettings.EndPont, ApiSettings.Key, ApiSettings.Secret, scopes, ApiSettings.Redirect, null);
request.GetAuthorizeCredentials(code);

Moderator
bs595r
153 Posts
Member since ‎01.13.2012

Re: Using Auth refresh token with .NET

Oleg,

 

To get new access_token, you have to re-initialize request factory and follow the steps you did already.

 

There's no explicit method to get access_token from refresh_token.

 

Hope that helps,

     --brett

  • of 2