Child pages
  • OAuthService

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryCreate a DELETE request.Create a GET request for a resource.Create a POST request.Create a PUT request.Creates a JSOAuthRequest for with the enum of RequestType (GET, PUT, DELETE, etc) for a resource url.This is quick method by executing a GET request and returning right away the OAuthResponse So it would be the same as executeRequest(createRequest(RequestType.Method to execute requests that are made, and configured by #createRequest(Verb,String)Returns the number of seconds left until the access token expires.Get the access token currently set on the service.Return the token lifetime in seconds.Get the authorization url with some additional parameters.Obtain the Openid token if it is available.Return the refresh token.Checks if the access token is expired.Obtains a new access token if the OAuth api supports it.voidRevoke the provided access token.voidConfigure the oauth service with an access token using the scope that was initially set when creating the service.voidConfigure the oauth service with an access token for the specified scope.

functionservoy sDetail2100%height:30px2Methods DetailscreateDeleteRequestname

createDeleteRequest(resourceURL)

dessIndent
Create a DELETE request.
prs

Parameters

sIndentresourceURLthe url of the resource to be deleted
ret

Returns

sIndent the request object
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRowcreateGetRequestname

createGetRequest(resourceURL)

dessIndent
Create a GET request for a resource.
prs

Parameters

sIndentresourceURLthe url of the resource which you want to get
ret

Returns

sIndent the request object
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
createPostRequestname

createPostRequest(resourceURL)

dessIndent
Create a POST request.
prs

Parameters

sIndentresourceURLthe url where the enclosed entity will be stored
ret

Returns

sIndent the request object
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
createPutRequestname

createPutRequest(resourceURL)

dessIndent
Create a PUT request.
prs

Parameters

sIndentresourceURLthe url where the enclosed entity will be stored
ret

Returns

sIndent the request object
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
createRequestname

createRequest(requestType, resourceURL)

dessIndent
Creates a JSOAuthRequest for with the enum of RequestType (GET, PUT, DELETE, etc) for a resource url.
prs

Parameters

sIndentrequestTypeone of the types of plugins.oauth.RequestTyperesourceURLthe url of the resource you want to access
ret

Returns

sIndent a JSOAuthRequest object
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeGetRequestname

executeGetRequest(resourceURL)

dessIndent
This is quick method by executing a GET request and returning right away the OAuthResponse
So it would be the same as executeRequest(createRequest(RequestType.GET, url))
prs

Parameters

sIndentresourceURL ;
ret

Returns

sIndent the OAuthResponse object
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
executeRequestname

executeRequest(request)

dessIndent
Method to execute requests that are made, and configured by  #createRequest(Verb,String)
prs

Parameters

sIndentrequestthe JSOAuthRequest object that was created by #createRequest(Verb,String)
ret

Returns

sIndent the OAuthResponse object
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAccessExpiresInname

getAccessExpiresIn()

dessIndent
Returns the number of seconds left until the access token expires.
ret

Returns

sIndent seconds left untol the access token expires.
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAccessTokenname

getAccessToken()

dessIndent
Get the access token currently set on the service.
ret

Returns

sIndent the access token or null if it was not set
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAccessTokenLifetimename

getAccessTokenLifetime()

dessIndent
Return the token lifetime in seconds.
ret

Returns

sIndent the token lifetime as it was retrieved by the OAuth provider with the access token
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAuthorizationURLname

getAuthorizationURL()

dessIndentret

Returns

sIndent
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAuthorizationURLname

getAuthorizationURL(params)

dessIndent
Get the authorization url with some additional parameters.
prs

Parameters

sIndentparamsa json containing the parameters and their values e.g. {'param1': 'value1', 'param2': 'value2'}
ret

Returns

sIndent the authorization url with the provided parameters appended to the query string.
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
getIdTokenname

getIdToken()

dessIndent
Obtain the Openid token if it is available.
ret

Returns

sIndent the id token, or null if was not set on the service.
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRefreshTokenname

getRefreshToken()

dessIndent
Return the refresh token.
ret

Returns

sIndent the refresh token or null if it is not present
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
isAccessTokenExpiredname

isAccessTokenExpired()

dessIndent
Checks if the access token is expired. Returns false if the access token expire information is not set.
ret

Returns

sIndent true if the access token is expired, false otherwise
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
refreshTokenname

refreshToken()

dessIndent
Obtains a new access token if the OAuth api supports it.
ret

Returns

sIndent The new access token issued by the authorization server
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
revokeTokenname

revokeToken(token)

dessIndent
Revoke the provided access token.
prs

Parameters

sIndenttokento revoke
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
setAccessTokenname

setAccessToken(code)

dessIndent
Configure the oauth service with an access token using the scope that was initially set when creating the service.
prs

Parameters

sIndentcodethe authorization code used to request and access token
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow
setAccessTokenname

setAccessToken(code, scope)

dessIndent
Configure the oauth service with an access token for the specified scope.
prs

Parameters

sIndentcodethe authorization code used to request an access tokenscopethe scope for which to obtain an access token
clients

Supported Clients

sIndentNGClient
sam

Sample

sIdentjavascript
lastDetailRow