com.bt.sdk.capabilities.whitelabelauthentication
Class WhiteLabelAuthenticationManager

java.lang.Object
  extended by com.bt.sdk.capabilities.whitelabelauthentication.WhiteLabelAuthenticationManager

public class WhiteLabelAuthenticationManager
extends java.lang.Object

A service that provides basic user and group management for an application.


Constructor Summary
WhiteLabelAuthenticationManager()
           
 
Method Summary
 void addGroup(java.lang.String groupName)
          Creates a new group with the given name.
 void addUser(java.lang.String userName)
          Creates a new user.
 void addUserAttributes(java.lang.String userName, java.util.Collection<com.bt.sdk.capabilities.whitelabelauthentication.UserAttribute> userattributes)
          Creates a new user attribute for the given user.
 void addUserAttributes(java.lang.String userName, java.lang.String attributeName, java.lang.String attributeValue)
          Creates a new user attribute for the given user.
 void addUserAttributes(java.lang.String userName, com.bt.sdk.capabilities.whitelabelauthentication.UserAttribute userAttribute)
          Creates a new user attribute for the given user.
 void addUsersToGroup(java.lang.String groupName, java.util.Collection<java.lang.String> usernames)
          Adds users to the given group.
 void addUsersToGroup(java.lang.String groupName, java.lang.String userName)
          Adds users to the given group.
 void changeUserPassword(java.lang.String userName, java.lang.String oldPassword, java.lang.String newPassword)
          Changes the password for the given user.
 java.util.Collection<java.lang.String> getAllUsers()
          Returns a list of all users.
 java.util.Collection<java.lang.String> getGroups()
          Returns a list of all groups.
 com.bt.sdk.capabilities.whitelabelauthentication.User getUser(java.lang.String userName)
          Returns the user with the given user name.
 java.util.Collection<java.lang.String> getUsersInGroup(java.lang.String groupName)
          Returns a list of all users in the given group.
 UserToken login(java.lang.String userName, java.lang.String password)
          Logs the user on to the WhiteLabelAuthentication service.
 void removeGroup(java.lang.String groupName)
          Removes the given group.
 void removeUser(java.lang.String userName)
          Removes the given user.
 void removeUserAttributes(java.lang.String userName, java.util.Collection<java.lang.String> attributenames)
          Removes an attribute for the given user.
 void removeUserAttributes(java.lang.String userName, java.lang.String attributeName)
          Removes an attribute for the given user.
 void removeUsersFromGroup(java.lang.String groupName, java.util.Collection<java.lang.String> usernames)
          Removes a collection of users from a given group.
 void removeUsersFromGroup(java.lang.String groupName, java.lang.String userName)
          Removes a collection of users from a given group.
 void resetUserPassword(java.lang.String userName)
          Resets the password for the given user.
 void updateGroup(java.lang.String oldGroupName, java.lang.String newGroupName)
          Updates the name of the group.
 void updateUserAttribute(java.lang.String userName, java.lang.String attributeName, java.lang.String attributeValue)
          Updates an attribute for the given user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WhiteLabelAuthenticationManager

public WhiteLabelAuthenticationManager()
Method Detail

login

public UserToken login(java.lang.String userName,
                       java.lang.String password)
Logs the user on to the WhiteLabelAuthentication service.

Parameters:
userName - Name of the user.
password - User's password.
Returns:
UserToken Contains the SAML token returned from the service after a successful login.

addUser

public void addUser(java.lang.String userName)
Creates a new user. An email containing the user's password will be sent to the user.

Parameters:
userName - Name of the user.

getUser

public com.bt.sdk.capabilities.whitelabelauthentication.User getUser(java.lang.String userName)
Returns the user with the given user name.

Parameters:
userName - Name of the user.
Returns:
User

getAllUsers

public java.util.Collection<java.lang.String> getAllUsers()
Returns a list of all users.

Returns:
userNames

changeUserPassword

public void changeUserPassword(java.lang.String userName,
                               java.lang.String oldPassword,
                               java.lang.String newPassword)
Changes the password for the given user.

Parameters:
userName - Name of the user.
oldPassword - User's old password.
newPassword - User's new password.

removeUser

public void removeUser(java.lang.String userName)
Removes the given user.

Parameters:
userName - Name of the user.

addUserAttributes

public void addUserAttributes(java.lang.String userName,
                              java.util.Collection<com.bt.sdk.capabilities.whitelabelauthentication.UserAttribute> userattributes)
Creates a new user attribute for the given user.

Parameters:
userName - Name of the user.
userattributes - Collection of UserAttributes.

addUserAttributes

public void addUserAttributes(java.lang.String userName,
                              com.bt.sdk.capabilities.whitelabelauthentication.UserAttribute userAttribute)
Creates a new user attribute for the given user.

Parameters:
userName - Name of the user.
userAttribute - User attribute

addUserAttributes

public void addUserAttributes(java.lang.String userName,
                              java.lang.String attributeName,
                              java.lang.String attributeValue)
Creates a new user attribute for the given user.

Parameters:
userName - Name of the user.
attributeName - Attribute name.
attributeValue - Attribute value.

removeUserAttributes

public void removeUserAttributes(java.lang.String userName,
                                 java.util.Collection<java.lang.String> attributenames)
Removes an attribute for the given user.

Parameters:
userName - Name of the user.
attributenames - Collection of AttributeNames.

removeUserAttributes

public void removeUserAttributes(java.lang.String userName,
                                 java.lang.String attributeName)
Removes an attribute for the given user.

Parameters:
userName - Name of the user.
attributeName - Attribute name.

updateUserAttribute

public void updateUserAttribute(java.lang.String userName,
                                java.lang.String attributeName,
                                java.lang.String attributeValue)
Updates an attribute for the given user.

Parameters:
userName - Name of the user.
attributeName - Attribute name.
attributeValue - Attribute value.

getGroups

public java.util.Collection<java.lang.String> getGroups()
Returns a list of all groups.

Returns:
groupNames The existing groups.

addGroup

public void addGroup(java.lang.String groupName)
Creates a new group with the given name.

Parameters:
groupName - Name of the group.

updateGroup

public void updateGroup(java.lang.String oldGroupName,
                        java.lang.String newGroupName)
Updates the name of the group.

Parameters:
oldGroupName - Current group name.
newGroupName - New group name.

removeGroup

public void removeGroup(java.lang.String groupName)
Removes the given group.

Parameters:
groupName - Name of the group.

addUsersToGroup

public void addUsersToGroup(java.lang.String groupName,
                            java.lang.String userName)
Adds users to the given group.

Parameters:
groupName - Name of the group.
userName - Name of the user.

addUsersToGroup

public void addUsersToGroup(java.lang.String groupName,
                            java.util.Collection<java.lang.String> usernames)
Adds users to the given group.

Parameters:
groupName - Name of the group.
usernames - Users' names.

removeUsersFromGroup

public void removeUsersFromGroup(java.lang.String groupName,
                                 java.util.Collection<java.lang.String> usernames)
Removes a collection of users from a given group.

Parameters:
groupName - Name of the group.
usernames - Users' names.

removeUsersFromGroup

public void removeUsersFromGroup(java.lang.String groupName,
                                 java.lang.String userName)
Removes a collection of users from a given group.

Parameters:
groupName - Name of the group.
userName - Name of the user.

getUsersInGroup

public java.util.Collection<java.lang.String> getUsersInGroup(java.lang.String groupName)
Returns a list of all users in the given group.

Parameters:
groupName - Name of the group.
Returns:
userNames

resetUserPassword

public void resetUserPassword(java.lang.String userName)
Resets the password for the given user. An email containing the user's password will be sent to the user.

Parameters:
userName - Name of the user.