updateAccessToken

Description

Updates access token based on individual parameters specified.

Syntax

oauth2.updateAccessToken (service_key, client_id, client_secret, access_token,  scope, expires_in, user_context)

Parameters

Parameter Type Description
service_key string The id of the OAuth 2.0 protected service definition
client_id string The API key of the developer whose application is requesting access
client_secret string Optional, client credentials if supplied
access_token string Identifies the token data
scope string Optional, space-delimited list of scope identifiers (provider-defined)
user_context string Optional, provider-defined user context identifier
expires_in int Optional, value in seconds for the token to expire

Return Value

{
“client_id”: <client id: string;
"token_type": <token type: string; one of "bearer" or a supported extension>
“grant_type”: <grant type: string; one of “authorization_code”, “password”, “client_credentials” or a supported extension>
“expires”: <expires:date; expiration date of the token>
“scope”: <scope:string; any scope specified for the token>
“user_context”: <user context: string, any user-context identifier specified for the token>
“extended”: <extended: object, any extended token information such as mac data required in response>
}

Errors (in addition to standard JSON-RPC errors)

JSON-RPC Code

Error Message

Description

-2001

Unable to update token

An error has occurred pertaining to the OAuth operation. Please check the corresponding structure in the error object for specific details.

Sample Requests and Responses

Sample Request - Named Parameters

{
"id":1,
"jsonrpc":"2.0",
"method":"oauth2.updateAccessToken",
"params":{
	"service_key":"58sbjqbeug3ae7bnp2fw7yde",
	"client":{
		"client_id":"66b9jkxgbxhcuppx58rmsj69",
                "client_secret":"sgnCfA"
	},
	"access_token" :"vxgqqqz7yua7nzrsp4arba7u",
	"scope":"myscope",
	"user_context":"myusercontext”,
	"expires_in":60
}
}

Sample Response

{
"jsonrpc":"2.0",
"result":{
	"client_id":"66b9jkxgbxhcuppx58rmsj69",
	"token_type":"bearer",
	"grant_type":"client_credentials",
	"expires":"2013-06-06T22:40:42Z",
	"scope":"myscope",
	"user_context":"myusercontext",
	"extended":null
	},
	"id":1
}

Docs Navigation