Package hudson.security
Class FederatedLoginService.FederatedIdentity
java.lang.Object
hudson.security.FederatedLoginService.FederatedIdentity
- All Implemented Interfaces:
Serializable
- Enclosing class:
FederatedLoginService
public abstract class FederatedLoginService.FederatedIdentity
extends Object
implements Serializable
Identity information as obtained from
FederatedLoginService.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds this identity to the specified user.voidYour implementation will call this method to add this identifier to the current user of an already authenticated session.abstract StringGets the e-mail address of this user, like "abc@def.com"abstract StringGets a human readable full name of this user.abstract StringGets the string representation of the identity in the form that makes sense to the enclosingFederatedLoginService, such as full OpenID URL.abstract StringGets a short ID of this user, as a suitable candidate forUser.getId().abstract StringReturns a human-readable pronoun that describes this kind of identifier.final UserLocates the user who owns this identifier.signin()Call this method to authenticate the user when you confirmed (via your protocol specific work) that the current HTTP request indeed owns this identifier.toString()
-
Constructor Details
-
FederatedIdentity
public FederatedIdentity()
-
-
Method Details
-
getIdentifier
Gets the string representation of the identity in the form that makes sense to the enclosingFederatedLoginService, such as full OpenID URL.- Returns:
- must not be null.
-
getNickname
Gets a short ID of this user, as a suitable candidate forUser.getId(). This should be Unix username like token.- Returns:
- null if this information is not available.
-
getFullName
Gets a human readable full name of this user. Maps toUser.getDisplayName()- Returns:
- null if this information is not available.
-
getEmailAddress
Gets the e-mail address of this user, like "abc@def.com"- Returns:
- null if this information is not available.
-
getPronoun
Returns a human-readable pronoun that describes this kind of identifier. This is used for rendering UI. For example, "OpenID", "Twitter ID", etc. -
locateUser
Locates the user who owns this identifier. -
signin
Call this method to authenticate the user when you confirmed (via your protocol specific work) that the current HTTP request indeed owns this identifier.This method will locate the user who owns this identifier, associate the credential with the current session. IOW, it signs in the user.
- Throws:
FederatedLoginService.UnclaimedIdentityException- If this identifier is not claimed by anyone. If you just let this exception propagate to the caller of your "doXyz" method, it will either render an error page or initiate a user registration session (provided thatSecurityRealmsupports that.)
-
addToCurrentUser
Your implementation will call this method to add this identifier to the current user of an already authenticated session.This method will record the identifier in
FederatedLoginServiceUserPropertyso that in the future the user can login to Hudson with the identifier.- Throws:
IOException
-
addTo
Adds this identity to the specified user.- Throws:
IOException
-
toString
-