Child pages
  • OAuthServiceBuilder

Versions Compared

Key

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

sWordListWebClientsWordListservoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryCreates an OAuth service that can be used to obtain an access token and access protected data.Configure the service with a callback function to be executed when the service is ready to use.Set the client secret of the application.OPTIONAL This is a way to override the default deeplink method name, which is 'deeplink_svy_oauth'.Request always the same scope.Request any unique scope per each access token request.Configures the anti forgery session state.Set the tenant identifiers/organization if the API supports it (e.

functionservoy sDetail2100%height:30px2Methods Detailsbuildname

build(api)

dessIndent
Creates an OAuth service that can be used to obtain an access token and access protected data.
prs

Parameters

sIndentapian OAuth provider id, see plugins.oauth.OAuthProviders
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow
callbackname

callback(callback, timeout)

dessIndent
Configure the service with a callback function to be executed when the service is ready to use.
After the access token is returned by the server, this callback function is executed.
prs

Parameters

sIndentcallbacka function in a scope or formtimeoutmax number of seconds in which the callback method should be executed (with success or error message) Please note that the timeout should be enough for the user to login and accept permissions.
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow
clientSecretname

clientSecret(clientSecret)

dessIndent
Set the client secret of the application.
prs

Parameters

sIndentclientSecreta secret known only to the application and the authorization server
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow
deeplinkname

deeplink(deeplink)

dessIndent
OPTIONAL This is a way to override the default deeplink method name, which is 'deeplink_svy_oauth'.
The deeplink method is a global method that receives the code needed to obtain the access token from the OAuth provider.

NOTE: The deeplink method name is strongly related to the redirect url configured for the application.
If the OAuth provider (eg. Microsoft AD, Likedin) requires to configure a full redirect url then it should be of the form:
https://example.com/<solution_name>/m/<deeplinkmethod> - where <deeplinkmethod> is the name configured with the service builder
https://example.com/<solution_name>/m/deeplink_svy_oauth - if the deeplink method name was not overridden

If the deeplink method with the provided name does not exist in the solution,
then a default deeplink method is generated under the hood with the solution model.
If a global method with the provided name already exists in the solution, then it should set the access
token on the service and handle possible errors.
prs

Parameters

sIndentdeeplinka global scope method name
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow
defaultScopename

defaultScope(scope)

dessIndent
Request always the same scope.
Scope is a mechanism in OAuth 2.0 to limit an application's access to a user's account.
An application can request one or more scopes, separated by space.
This information is then presented to the user in the consent screen, and the access token issued
to the application will be limited to the scopes granted.
prs

Parameters

sIndentscopethe default scope
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow
scopename

scope(scope)

dessIndent
Request any unique scope per each access token request.
Scope is a mechanism in OAuth 2.0 to limit an application's access to a user's account.
An application can request one or more scopes, separated by space.
This information is then presented to the user in the consent screen, and the access token issued
to the application will be limited to the scopes granted.
prs

Parameters

sIndentscopeone or multiple scopes separated by space
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow
statename

state(state)

dessIndent
Configures the anti forgery session state. This is required in some APIs (like Facebook's).
prs

Parameters

sIndentstate ;
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow
tenantname

tenant(tenant)

dessIndent
Set the tenant identifiers/organization if the API supports it (e.g.Microsoft AD)
prs

Parameters

sIndenttenant ;
ret

Returns

sIndent
clients

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

sIdentjavascript
lastDetailRow