hudson.security
Class FederatedLoginService.FederatedIdentity

java.lang.Object
  extended by 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:
Serialized Form

Constructor Summary
FederatedLoginService.FederatedIdentity()
           
 
Method Summary
 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 "[email protected]"
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 enclosing FederatedLoginService, such as full OpenID URL.
abstract  String getNickname()
          Gets a short ID of this user, as a suitable candidate for User.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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FederatedLoginService.FederatedIdentity

public FederatedLoginService.FederatedIdentity()
Method Detail

getIdentifier

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

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

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

public abstract String getEmailAddress()
Gets the e-mail address of this user, like "[email protected]"

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

public final User locateUser()
Locates the user who owns this identifier.


signin

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


Copyright © 2004-2013. All Rights Reserved.