Package org.skr.auth.service
Interface CertificationHandler<Cert extends org.skr.security.Certification>
public interface CertificationHandler<Cert extends org.skr.security.Certification>
-
Method Summary
Modifier and TypeMethodDescriptionorg.skr.security.UserPrincipalauthenticate(Cert certification, Map<String, Object> arguments) Authenticate givenCertificationand return correspondingUserPrincipalto it.findByIdentity(@NonNull String certificationIdentity) FindCertificationby given certificationIdentity.getCertification(@NonNull org.skr.security.UserPrincipal principal) voidremoveCertification(@NonNull org.skr.security.UserPrincipal principal, @NonNull String certificationIdentity) Remove aCertificationforUserPrincipalorg.skr.security.UserPrincipalsaveCertification(org.skr.security.UserPrincipal principal, Cert certification, Map<String, Object> arguments) Tells that how to save givenCertificationand bind it toUserPrincipalbooleansupports(@NonNull org.skr.security.Certification certification) check if this handler could be apply to certainCertification
-
Method Details
-
supports
boolean supports(@NonNull @NonNull org.skr.security.Certification certification) check if this handler could be apply to certainCertification -
authenticate
org.skr.security.UserPrincipal authenticate(@NonNull Cert certification, Map<String, Object> arguments) throws org.skr.common.exception.AuthExceptionAuthenticate givenCertificationand return correspondingUserPrincipalto it.- Parameters:
arguments- extra argument to help locatingUserPrincipal- Returns:
UserPrincipalto givenCertification- Throws:
org.skr.common.exception.AuthException- if givenCertificationis not authenticated.
-
findByIdentity
FindCertificationby given certificationIdentity.Certification.getIdentity()should be unique per certification scope.- Returns:
Certificationthat hascertificationIdentity
-
getCertification
- Returns:
Certificationof givenUserPrincipal
-
saveCertification
org.skr.security.UserPrincipal saveCertification(org.skr.security.UserPrincipal principal, @NonNull Cert certification, Map<String, Object> arguments) Tells that how to save givenCertificationand bind it toUserPrincipal -
removeCertification
void removeCertification(@NonNull @NonNull org.skr.security.UserPrincipal principal, @NonNull @NonNull String certificationIdentity) Remove aCertificationforUserPrincipal- Parameters:
certificationIdentity- of removingCertification
-