Package com.sodius.oslc.client.oauth
Interface OAuthHandler
-
- All Known Implementing Classes:
RedirectOAuthHandler
public interface OAuthHandler
The handling of the OAuth connection.Clients may implement this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
authorize(RootServices rootServices, URI authorizationUri)
Requests the end user to authorize the connection.URI
createCallback(RootServices rootServices, String verifierId)
Returns a callback URL to use when an OAuth token is requested.void
downstreamAuthorize(URI authorizationUri)
Requests the end user to authorize the connection to a third-party application (i.e: not an OSLC friend).
-
-
-
Method Detail
-
createCallback
URI createCallback(RootServices rootServices, String verifierId)
Returns a callback URL to use when an OAuth token is requested. The callback is called by the target application once the OAuth connection is approved. This method may return null if no callback is desired, which is typically the case when the connection is not requested on server side (i.e. in pure client mode).- Parameters:
rootServices
- the root services of the target application.verifierId
- the verifier ID used to approve the connection. This verifier is typically to inject in the callback URI.- Returns:
- a URL to be called by the target application when the OAuth connection is approved, or
null
if no callback is to use.
-
authorize
void authorize(RootServices rootServices, URI authorizationUri) throws net.oauth.OAuthException
Requests the end user to authorize the connection. The authorizationUri is typically to present in web browser for the user to log-in the target application and approve the connection. An exception shall be throw if the connection is refused or not successful.- Parameters:
rootServices
- the root services of the target application.authorizationUri
- the URL to display in a web browser for the user to approve the connection.- Throws:
net.oauth.OAuthException
- if the connection is not approved.
-
downstreamAuthorize
void downstreamAuthorize(URI authorizationUri) throws net.oauth.OAuthException
Requests the end user to authorize the connection to a third-party application (i.e: not an OSLC friend). The authorizationUri is typically to present in web browser for the user to log-in the target application and approve the connection. An exception shall be throw if the connection is refused or not successful.- Parameters:
authorizationUri
- the URL to display in a web browser for the user to approve the connection.- Throws:
net.oauth.OAuthException
- if the connection is not approved.- Since:
- 1.8.0
-
-