Class FederatedLinkingPolicy
java.lang.Object
com.irurueta.authserver.authorization.domain.social.FederatedLinkingPolicy
Rules of identity brokering: when an external identity may be tied to an account, and when it may be removed. It
is pure; the use cases ask it and act on the answer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmayLinkByEmail(UserAccount account, String providerEmail, boolean providerVerified) Tells whether an external identity may be linked to the account that has its e-mail address.booleanmayProvision(String providerEmail, boolean providerVerified) Tells whether a new account may be created from an external identity: the provider must vouch for a usable e-mail address.booleanmaySignIn(UserAccount account) Tells whether a sign-in with an external provider may reach an account at all: a disabled account is never linked to an identity and never signed in through one, the rule every other sign-in method applies.booleanmayUnlink(SignInMethods remaining) Tells whether a sign-in method (a linked identity, a bound certificate) may be removed: the account must keep at least one other way to sign in.
-
Constructor Details
-
FederatedLinkingPolicy
public FederatedLinkingPolicy()
-
-
Method Details
-
mayLinkByEmail
Tells whether an external identity may be linked to the account that has its e-mail address. Both sides must vouch for the address: the provider says it is verified, and the account verified it too. Otherwise somebody could register an account with a victim's address, never verify it, and wait for the victim to sign in with a provider.- Parameters:
account- account that has the e-mail address.providerEmail- e-mail address the provider reported.providerVerified- whether the provider says it verified the address.- Returns:
truewhen the identity may be linked.
-
mayProvision
Tells whether a new account may be created from an external identity: the provider must vouch for a usable e-mail address.- Parameters:
providerEmail- e-mail address the provider reported.providerVerified- whether the provider says it verified the address.- Returns:
truewhen the account may be provisioned.
-
maySignIn
Tells whether a sign-in with an external provider may reach an account at all: a disabled account is never linked to an identity and never signed in through one, the rule every other sign-in method applies.- Parameters:
account- the account the sign-in resolved to.- Returns:
truewhen the account may sign in.
-
mayUnlink
Tells whether a sign-in method (a linked identity, a bound certificate) may be removed: the account must keep at least one other way to sign in.- Parameters:
remaining- ways to sign in left once the method is removed.- Returns:
truewhen removing it is allowed.
-