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 void
addTo(User u)
Adds this identity to the specified user.void
addToCurrentUser()
Your implementation will call this method to add this identifier to the current user of an already authenticated session.abstract String
getEmailAddress()
Gets the e-mail address of this user, like "abc@def.com"abstract String
getFullName()
Gets a human readable full name of this user.abstract String
getIdentifier()
Gets the string representation of the identity in the form that makes sense to the enclosingFederatedLoginService
, such as full OpenID URL.abstract String
getNickname()
Gets a short ID of this user, as a suitable candidate forUser.getId()
.abstract String
getPronoun()
Returns a human-readable pronoun that describes this kind of identifier.User
locateUser()
Locates the user who owns this identifier.User
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.String
toString()
-
-
-
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 thatSecurityRealm
supports that.)
-
addToCurrentUser
public void addToCurrentUser() throws IOException
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
FederatedLoginServiceUserProperty
so 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
-
-