Package net.webpdf.wsclient.session.auth
Interface OAuth2Provider
-
- All Superinterfaces:
AuthProvider
public interface OAuth2Provider extends AuthProvider
A class implementing
OAuth2Providershall implement aprovide(Session)method to determine aOAuth2Tokenfor the authorization of aSession.
This interface is directly intended to enable you, to implement your own custom authorization provider - refer to the wiki for examples.Be aware: An implementation of
AuthProvideris not required to serve multipleSessions at a time. It is expected to create a newAuthProviderfor each existingSession.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull OAuth2Tokenprovide(@NotNull Session session)Provides anOAuth2Tokenfor the authorization of aSession.@NotNull OAuth2Tokenrefresh(@NotNull Session session)Refresh authorizationSessionTokenfor an activeSession.
-
-
-
Method Detail
-
provide
@NotNull @NotNull OAuth2Token provide(@NotNull @NotNull Session session) throws AuthResultException
Provides anOAuth2Tokenfor the authorization of aSession.- Specified by:
providein interfaceAuthProvider- Parameters:
session- TheSessionto provide authorization for.- Returns:
- The
OAuth2Tokento authorize theSessionwith. - Throws:
AuthResultException- Shall be thrown, should the authorization fail for some reason. (UseAuthResultExceptionto wrap exceptions, that might occur during your authorization request.)
-
refresh
@NotNull @NotNull OAuth2Token refresh(@NotNull @NotNull Session session) throws AuthResultException
Refresh authorizationSessionTokenfor an activeSession.- Specified by:
refreshin interfaceAuthProvider- Parameters:
session- The session to refresh the authorization for.- Returns:
- The
OAuth2Tokenrefreshed by thisOAuth2Provider. - Throws:
AuthResultException- Shall be thrown, should the authentication/authorization fail for some reason.
-
-