public interface OAuth
Modifier and Type | Method and Description |
---|---|
void |
authorize(java.lang.String name)
Authenticates the user with the application configured in the OAuth configurations on the Ebase server administration application.
|
void |
authorize(java.lang.String name,
java.lang.String scope)
Authenticates the user with the application configured in the OAuth configurations on the Ebase server administration application.
|
void |
authorize(java.lang.String name,
java.lang.String scope,
java.util.Map<java.lang.String,java.lang.Object> additionalParameters)
Authenticates the user with the application configured in the OAuth configurations on the Ebase server administration application.
|
OAuthTokens |
getTokens(java.lang.String name)
Returns an OAuthTokens object containing the access token and the refresh token required with OAuth authentication.
|
OAuthTokens getTokens(java.lang.String name)
authorize(String)
method automatically populates this object.name
- as configured in the OAuth configurations on the Ebase server administration application.authorize(String)
void authorize(java.lang.String name)
This method takes the user away from Ebase and to the application that requires authorization to allow Ebase access to the users account information.
If the OAuthTokens
already contains an access token or refresh token already then there is no need to authorize because the access has already been granted.
Otherwise the user is prompted to login to the application to grant access and then is returned back to the Ebase application.
Javascript example:
try { //RESTful service "MyApp" requires OAUTH authentication. services.security.oauth.authorize("myApp"); //now perform a rest call var code = resources.MyApp.call(); } catch (e) { event.owner.addErrorMessage(e.javaException.message); }
name
- as configured in the OAuth configurations on the Ebase server administration application.getTokens(String)
void authorize(java.lang.String name, java.lang.String scope)
This method takes the user away from Ebase and to the application that requires authorization to allow Ebase access to the users account information.
If the OAuthTokens
already contains an access token or refresh token already then there is no need to authorize because the access has already been granted.
Otherwise the user is prompted to login to the application to grant access and then is returned back to the Ebase application.
Javascript example:
try { //RESTful service "MyApp" requires OAUTH authentication. services.security.oauth.authorize("myApp", "private-read, private-write"); //now perform a rest call var code = resources.MyApp.call(); } catch (e) { event.owner.addErrorMessage(e.javaException.message); }
name
- as configured in the OAuth configurations on the Ebase server administration application.scope
- access permissions required for the applicationgetTokens(String)
void authorize(java.lang.String name, java.lang.String scope, java.util.Map<java.lang.String,java.lang.Object> additionalParameters)
This method takes the user away from Ebase and to the application that requires authorization to allow Ebase access to the users account information.
If the OAuthTokens
already contains an access token or refresh token already then there is no need to authorize because the access has already been granted.
Otherwise the user is prompted to login to the application to grant access and then is returned back to the Ebase application.
Javascript example:
try { //RESTful service "MyApp" requires OAUTH authentication. var params = {show_dialog : true}; services.security.oauth.authorize("myApp", "private-read, private-write", params); //now perform a rest call var code = resources.MyApp.call(); } catch (e) { event.owner.addErrorMessage(e.javaException.message); }
name
- as configured in the OAuth configurations on the Ebase server administration application.scope
- access permissions required for the applicationadditionalParameters
- Sets any additional parameters for authentication that are required OAuth .getTokens(String)