Ballerina API Documentation

Functions of org.wso2.ballerina.connectors.oauth2 package

function constructAuthHeader(Request request, string accessTokenValue, string accessToken) (string )

Parameters:

Parameter NameData TypeDescription
requestRequest
accessTokenValuestring
accessTokenstring

Return Parameters:

Return VariableData TypeDescription
string

function getAccessTokenFromRefreshToken(Request request, string accessToken, string clientId, string clientSecret, string refreshToken, string refreshTokenEP) (string )

Parameters:

Parameter NameData TypeDescription
requestRequest
accessTokenstring
clientIdstring
clientSecretstring
refreshTokenstring
refreshTokenEPstring

Return Parameters:

Return VariableData TypeDescription
string


Connectors of org.wso2.ballerina.connectors.oauth2 package

connector ClientConnector (string baseUrl, string accessToken, string clientId, string clientSecret, string refreshToken, string refreshTokenEP)

OAuth2 client connector

Parameters:

Parameter NameData TypeDescription
baseUrlstringThe endpoint base url
accessTokenstringThe access token of the account
clientIdstringThe client Id of the account
clientSecretstringThe client secret of the account
refreshTokenstringThe refresh token of the account
refreshTokenEPstringThe refresh token endpoint url

Actions:

action delete(string path, Request request)

Delete with OAuth2 authentication

Parameters:

Parameter NameData TypeDescription
pathstringThe endpoint path
requestRequestThe request of the method

Return Parameters:

Return VariableData TypeDescription
Responseresponse object

action get(string path, Request request)

Get with OAuth2 authentication

Parameters:

Parameter NameData TypeDescription
pathstringThe endpoint path
requestRequestThe request of the method

Return Parameters:

Return VariableData TypeDescription
Responseresponse object

action patch(string path, Request request)

Patch with OAuth2 authentication

Parameters:

Parameter NameData TypeDescription
pathstringThe endpoint path
requestRequestThe request of the method

Return Parameters:

Return VariableData TypeDescription
Responseresponse object

action post(string path, Request request)

Post with OAuth2 authentication

Parameters:

Parameter NameData TypeDescription
pathstringThe endpoint path
requestRequestThe request of the method

Return Parameters:

Return VariableData TypeDescription
Responseresponse object

action put(string path, Request request)

Put with OAuth2 authentication

Parameters:

Parameter NameData TypeDescription
pathstringThe endpoint path
requestRequestThe request of the method

Return Parameters:

Return VariableData TypeDescription
Responseresponse object


Menu

  • Functions
    • constructAuthHeader(Request request, string accessTokenValue, string accessToken) (string )
    • getAccessTokenFromRefreshToken(Request request, string accessToken, string clientId, string clientSecret, string refreshToken, string refreshTokenEP) (string )
  • Connectors
    • ClientConnector (string baseUrl, string accessToken, string clientId, string clientSecret, string refreshToken, string refreshTokenEP)
      • delete(Request request)
      • get(Request request)
      • patch(Request request)
      • post(Request request)
      • put(Request request)

Copyright 2017 Ballerina API Documentation