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 fromFederatedLoginService.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FederatedIdentity()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddTo(User u)Adds this identity to the specified user.voidaddToCurrentUser()Your implementation will call this method to add this identifier to the current user of an already authenticated session.abstract StringgetEmailAddress()Gets the e-mail address of this user, like "abc@def.com"abstract StringgetFullName()Gets a human readable full name of this user.abstract StringgetIdentifier()Gets the string representation of the identity in the form that makes sense to the enclosingFederatedLoginService, such as full OpenID URL.abstract StringgetNickname()Gets a short ID of this user, as a suitable candidate forUser.getId().abstract StringgetPronoun()Returns a human-readable pronoun that describes this kind of identifier.UserlocateUser()Locates the user who owns this identifier.Usersignin()Call this method to authenticate the user when you confirmed (via your protocol specific work) that the current HTTP request indeed owns this identifier.StringtoString()
-
-
-
Method Detail
-
getIdentifier
@NonNull public abstract String 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
@CheckForNull public abstract String 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
@CheckForNull public abstract String getFullName()
Gets a human readable full name of this user. Maps toUser.getDisplayName()- Returns:
- null if this information is not available.
-
getEmailAddress
@CheckForNull public abstract String getEmailAddress()
Gets the e-mail address of this user, like "abc@def.com"- Returns:
- null if this information is not available.
-
getPronoun
public abstract String 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
@CheckForNull public final User locateUser()
Locates the user who owns this identifier.
-
signin
@NonNull public User signin() throws FederatedLoginService.UnclaimedIdentityException
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
public void addToCurrentUser() throws IOExceptionYour 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
public void addTo(User u) throws IOException
Adds this identity to the specified user.- Throws:
IOException
-
-