Package hudson.security
Class FederatedLoginService
- java.lang.Object
-
- hudson.security.FederatedLoginService
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class FederatedLoginService extends Object implements ExtensionPoint
Abstraction for a login mechanism through external authenticator/identity provider (instead of username/password.)This extension point adds additional login mechanism for
SecurityRealm
s that authenticate the user via username/password (which typically extends fromAbstractPasswordBasedSecurityRealm
.) The intended use case is protocols like OpenID, OAuth, and other SSO-like services.The basic abstraction is that:
-
The user can have (possibly multiple, possibly zero) opaque strings to their User object.
Such opaque strings are called "identifiers."
Think of them as OpenID URLs, twitter account names, etc.
Identifiers are only comparable within the same
FederatedLoginService
implementation. -
After getting authenticated by some means, the user can add additional identifiers to their account.
Your implementation would do protocol specific thing to verify that the user indeed owns the claimed identifier,
create a
FederatedLoginService.FederatedIdentity
instance, then callFederatedLoginService.FederatedIdentity.addToCurrentUser()
to record such association. -
In the login page, instead of entering the username and password, the user opts for authenticating
via other services. Think of OpenID, OAuth, your corporate SSO service, etc.
The user proves (by your protocol specific way) that they own some identifier, then
create a
FederatedLoginService.FederatedIdentity
instance, and invokeFederatedLoginService.FederatedIdentity.signin()
to sign in that user.
Views
- loginFragment.jelly
- Injected into the login form page, after the default "login" button but before the "create account" link. Use this to generate a button or a link so that the user can initiate login via your federated login service.
URL Binding
Each
FederatedLoginService
is exposed to the URL space viaJenkins.getFederatedLoginService(String)
. So for example if your url name is "openid", this object gets "/federatedLoginService/openid" as the URL.- Since:
- 1.394
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
FederatedLoginService.FederatedIdentity
Identity information as obtained fromFederatedLoginService
.static class
FederatedLoginService.UnclaimedIdentityException
Used inFederatedLoginService.FederatedIdentity.signin()
to indicate that the identifier is not currently associated with anyone.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description FederatedLoginService()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ExtensionList<FederatedLoginService>
all()
abstract String
getUrlName()
Returns the url name that determines where thisFederatedLoginService
is mapped to in the URL space.abstract Class<? extends FederatedLoginServiceUserProperty>
getUserPropertyClass()
Returns your implementation ofFederatedLoginServiceUserProperty
that stores opaque identifiers.
-
-
-
Method Detail
-
getUrlName
@NonNull public abstract String getUrlName()
Returns the url name that determines where thisFederatedLoginService
is mapped to in the URL space.The object is bound to /federatedLoginService/URLNAME/. The url name needs to be unique among all
FederatedLoginService
s.
-
getUserPropertyClass
@NonNull public abstract Class<? extends FederatedLoginServiceUserProperty> getUserPropertyClass()
Returns your implementation ofFederatedLoginServiceUserProperty
that stores opaque identifiers.
-
all
public static ExtensionList<FederatedLoginService> all()
-
-