Package com.iizix.server.oauth
Class OAuthSession
java.lang.Object
com.iizix.server.oauth.OAuthSession
The OAuth 1.0a or 2.0 session that handles authentication.
- Author:
- Christopher Mindus
- Constructor SummaryConstructorsConstructorDescription- OAuthSession- (IOAuthCallbackProvider callbackProvider) Constructs a new authentication session with a callback provider.- OAuthSession- (IAppSessionGyro appGyro) Constructs a new authentication session for the application session.
- Method SummaryModifier and TypeMethodDescription- void- dispose()Disposes of the session and cleans up.- voidDisposes of the session because of a blocked pop-up window.- voidDisposes of the session because of a user cancel action.Returns the application session gyro instance.Returns the authentication code, null for error or not authenticated (yet).Returns this server's callback URL used to complete the authentication by means of redirecting the client in the end to it.Gets the authentication completion "error" code.Gets the error code returned in the callback reply, normally converted to a Code.Gets the error description string in case of failure.Returns the error URI, null if none is present.For an OAuth 1.0a session, get the oauth_token used to identify the session.- final AbstractOAuthServiceReturns the service for the session.- getState()Gets the state string that uniquely identifies the session in the server.- boolean- isOAuth2()Checks if this authentication session is of OAuth 2.0 type.
- Constructor Details- OAuthSessionConstructs a new authentication session for the application session.- Parameters:
- appGyro- The application session.
- Throws:
- IllegalStateException- If authentication engine is not initialized.
- NullPointerException- If appGyro is null.
 
- OAuthSessionConstructs a new authentication session with a callback provider. Do not call this method from the Server, only the Designer is supported.- Parameters:
- callbackProvider- The callback provider.
- Throws:
- IllegalStateException- If called outside of the Designer or if authentication engine is not initialized.
- NullPointerException- If callbackProvider is null.
 
 
- Method Details- isOAuth2public boolean isOAuth2()Checks if this authentication session is of OAuth 2.0 type.- Returns:
- If session is of OAuth 2.0 trueis returned, otherwise for OAuth 1.0afalseis returned.
- Throws:
- IllegalStateException- If the session authentication type is not yet defined.
 
- getOAuth1TokenFor an OAuth 1.0a session, get the oauth_token used to identify the session.- Returns:
- The oauth_token.
- Throws:
- IllegalStateException- If the session authentication type is not OAuth 1.0a.
 
- getAppSessionGyroReturns the application session gyro instance.- Returns:
- The instance (always non-null in Server), null in the Designer.
 
- getCallbackURLReturns this server's callback URL used to complete the authentication by means of redirecting the client in the end to it.- Returns:
- The URL of this server with additional authentication path.
 
- getStateGets the state string that uniquely identifies the session in the server.- Returns:
- The unique session state (UUID).
 
- getCompletionCodeGets the authentication completion "error" code.- Returns:
- The code.
 
- getAuthenticationCodeReturns the authentication code, null for error or not authenticated (yet).- Returns:
- The code, null otherwise.
 
- getErrorURIReturns the error URI, null if none is present. It is optionally set by the service in question.- Returns:
- The error URI, or null if not present.
 
- getErrorCodeGets the error code returned in the callback reply, normally converted to a Code.- Returns:
- The OAuth error code returned, or null if not present.
 
- getErrorDescriptionGets the error description string in case of failure.- Returns:
- The error string, or null for no error.
 
- getServiceReturns the service for the session.- Returns:
- The authentication service, or null if authentication has not yet begun.
 
- disposeBlockedpublic void disposeBlocked()Disposes of the session because of a blocked pop-up window. The listener is notified, if any.
- disposeUserCancelpublic void disposeUserCancel()Disposes of the session because of a user cancel action.
- disposepublic void dispose()Disposes of the session and cleans up.