Spiffy UI Framework

org.spiffyui.client.rest.v2
Interface RESTOAuthProvider


public interface RESTOAuthProvider

This interface allows clients to provide extra information about OAuth authentications.


Method Summary
 void error(RESTException e)
           Called when the OAuth process ends with an error
 java.lang.String getAuthServerUrl(RESTCallback callback, java.lang.String tokenServerUrl, Response response, RESTException exception)
           Provide the OAuth server URL for this request
 java.lang.String getClientId()
          Get the optional client ID for this OAuth request.
 java.lang.String getScope()
          Get the optional scope for this OAuth request.
 boolean shouldSendRedirectUrl()
          Spiffy UI provides a mechanism to show the OAuth login page in an iFrame and close that frame when the login completes.
 

Method Detail

getAuthServerUrl

java.lang.String getAuthServerUrl(RESTCallback callback,
                                  java.lang.String tokenServerUrl,
                                  Response response,
                                  RESTException exception)

Provide the OAuth server URL for this request

Parameters:
callback - the callback for the original REST call
tokenServerUrl - the URL for the authentication server
response - the server response that came with this 401
exception - the RESTException representation of the JSON response from the server if available
Returns:
the auth server URL

getClientId

java.lang.String getClientId()
Get the optional client ID for this OAuth request. If the request doesn't use a client ID then this method should return null.

Returns:
the client ID

getScope

java.lang.String getScope()
Get the optional scope for this OAuth request. If the request doesn't use a scope then this method should return null.

Returns:
the scope

shouldSendRedirectUrl

boolean shouldSendRedirectUrl()
Spiffy UI provides a mechanism to show the OAuth login page in an iFrame and close that frame when the login completes. That mechanism requires a specific redirect URL so that Spiffy UI can close the iFrame and return to the page. If the client doesn't want to use that mechanism then they can return false to this method to not pass a redirect URL.

Returns:
true if the client should pass a redirect URL and false otherwise

error

void error(RESTException e)

Called when the OAuth process ends with an error

Parameters:
e - the RESTException returned from the server
See Also:
RESTException

Spiffy UI Framework