blackboard.platform.integration.extension
Class AbstractAuthenticationProvider

java.lang.Object
  extended by blackboard.platform.integration.extension.AbstractIntegrationProvider
      extended by blackboard.platform.integration.extension.AbstractAuthenticationProvider
All Implemented Interfaces:
AuthenticationProvider, IntegrationProvider

public abstract class AbstractAuthenticationProvider
extends AbstractIntegrationProvider
implements AuthenticationProvider

Base class that all AuthenticationProvider implementations should extend to ensure binary compatibility with future releases.

Since:
Bb 9.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface blackboard.platform.integration.provider.IntegrationProvider
IntegrationProvider.ProviderType
 
Constructor Summary
AbstractAuthenticationProvider()
           
 
Method Summary
 java.util.Set<Id> checkActivity(java.util.Set<Id> userIds)
          Used to confirm which user sessions have had recent activity on the external LMS.
 void flushCachedCredentials(Id userId)
          When this is called, the provider should clear any internally cached information about the specified user's session.
 java.util.Set<javax.servlet.http.Cookie> getCookies(Id userId)
          Requests updated cookies for the user's external LMS session.
 java.util.Set<javax.servlet.http.Cookie> getCookies(Id userId, java.lang.String baseUrl)
          Requests updated cookies for the user's external LMS session.
 java.lang.String getSharedCookieDomain(Id userId)
          Determines the cookie domain shared by Academic Suite and the external LMS.
 boolean login(Id userId, java.lang.String password)
          Pass the user's password to the external LMS for validation.
 void logout(Id userId)
          Notifies the external LMS that a user has logged out of Academic Suite.
 void setCookies(Id userId, java.util.Set<javax.servlet.http.Cookie> cookies)
          Invoked by the integration framework when it detects any new cookies on the browser for the current integration.
 
Methods inherited from class blackboard.platform.integration.extension.AbstractIntegrationProvider
getIntegrationContext, getIntegrationId, initializeProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface blackboard.platform.integration.provider.IntegrationProvider
initializeProvider
 

Constructor Detail

AbstractAuthenticationProvider

public AbstractAuthenticationProvider()
Method Detail

checkActivity

public java.util.Set<Id> checkActivity(java.util.Set<Id> userIds)
Description copied from interface: AuthenticationProvider
Used to confirm which user sessions have had recent activity on the external LMS. The result from this call should be the subset of the incoming user list that represents the active users. All users excluded from the returned list will be logged out of Academic Suite when their AS session expires.

If the remote LMS does not keep track of session state, you may return null here. When the user's Academic Suite session times out, they will be logged out automatically.

Specified by:
checkActivity in interface AuthenticationProvider
Parameters:
userIds - List of User Ids to check.
Returns:
A collection of users that are still active, or null if operation is not supported.

flushCachedCredentials

public void flushCachedCredentials(Id userId)
Description copied from interface: AuthenticationProvider
When this is called, the provider should clear any internally cached information about the specified user's session.

Specified by:
flushCachedCredentials in interface AuthenticationProvider
Parameters:
userId - Id of the current User

getCookies

public java.util.Set<javax.servlet.http.Cookie> getCookies(Id userId)
Description copied from interface: AuthenticationProvider
Requests updated cookies for the user's external LMS session. This will be called every time the user clicks on a link which takes them from Academic Suite to an LMS page. If the user's remote session has expired, a new session should be created automatically.

Specified by:
getCookies in interface AuthenticationProvider
Parameters:
userId - Id of the current User

getCookies

public java.util.Set<javax.servlet.http.Cookie> getCookies(Id userId,
                                                           java.lang.String baseUrl)
Description copied from interface: AuthenticationProvider
Requests updated cookies for the user's external LMS session. This will be called every time the user clicks on a link which takes them from Academic Suite to an LMS page. If the user's remote session has expired, a new session should be created automatically. NOTE that this method should be implemented as the preferred method over getCookies(Id) because this is the only way you can guarantee that you will have the correct return-url when sending users back into AS. Using the correct return url is mandatory to maintain session cookies and branding.

It is recommended that the provider maintain an internal cache of these cookies, as this method is called relatively often.

Specified by:
getCookies in interface AuthenticationProvider
Parameters:
userId - Id of the current User
baseUrl - Current base url for the user's session - to be used for all callback URLs into AS

getSharedCookieDomain

public java.lang.String getSharedCookieDomain(Id userId)
Description copied from interface: AuthenticationProvider
Determines the cookie domain shared by Academic Suite and the external LMS. Only called if ContentSystemProvider is implemented.

Specified by:
getSharedCookieDomain in interface AuthenticationProvider
Parameters:
userId - Id of the current User

login

public boolean login(Id userId,
                     java.lang.String password)
              throws PasswordChangeRequiredException
Description copied from interface: AuthenticationProvider
Pass the user's password to the external LMS for validation. The provider may optionally throw an exception if the user's password has expired (this implies that the authentication was successful).

Note that this method will only be called if the current integration is the user's primary integration. For secondary integrations, the first interaction between AuthenticationProvider and a user will be through AuthenticationProvider.getCookies(blackboard.persist.Id, String) when a user tries to access integration-specific content.

Specified by:
login in interface AuthenticationProvider
Parameters:
userId - Id of the current User
password - Password entered by the user.
Returns:
true if password is valid
Throws:
PasswordChangeRequiredException - Indicates that the password was valid but that it needs to be changed. Normally thrown when the current password has expired.
PasswordChangeForcedException - Indicates that the password was valid but that it needs to be changed. Normally thrown when passwords must be changed after the first login.

logout

public void logout(Id userId)
Description copied from interface: AuthenticationProvider
Notifies the external LMS that a user has logged out of Academic Suite. The provider should use this notification to clear out any cached session data.

Academic Suite will handle revoking the user's current session cookies.

Specified by:
logout in interface AuthenticationProvider
Parameters:
userId - Id of the current User

setCookies

public void setCookies(Id userId,
                       java.util.Set<javax.servlet.http.Cookie> cookies)
Description copied from interface: AuthenticationProvider
Invoked by the integration framework when it detects any new cookies on the browser for the current integration. The framework will only pass in cookies that match those returned by a call to the provider's AuthenticationProvider.getCookies(Id, String) method.

If the provider maintains an internal cache, it is recommended that the cache be updated with these new cookie values.

Specified by:
setCookies in interface AuthenticationProvider
Parameters:
userId - Id of the current User
cookies - Updated cookies to store


Copyright © 2012 Blackboard, Inc. All Rights Reserved.