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 Details

    • FederatedIdentity

      public FederatedIdentity()
  • Method Details

    • getIdentifier

      @NonNull public abstract String getIdentifier()
      Gets the string representation of the identity in the form that makes sense to the enclosing FederatedLoginService, 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 for User.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 to User.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 that SecurityRealm 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
    • toString

      public String toString()
      Overrides:
      toString in class Object