Class OpenIDAuthenticationProvider

java.lang.Object
one.jpro.platform.auth.core.oauth2.OAuth2AuthenticationProvider
one.jpro.platform.auth.core.oauth2.provider.OpenIDAuthenticationProvider
All Implemented Interfaces:
AuthenticationProvider<Credentials>
Direct Known Subclasses:
GoogleAuthenticationProvider, KeycloakAuthenticationProvider, MicrosoftAuthenticationProvider

public class OpenIDAuthenticationProvider extends OAuth2AuthenticationProvider
OpenID's authentication provider.
  • Constructor Details

    • OpenIDAuthenticationProvider

      protected OpenIDAuthenticationProvider(@Nullable @Nullable javafx.stage.Stage stage, @NotNull @NotNull OAuth2API api)
      Creates a OAuth2 authentication provider.
      Parameters:
      stage - the JavaFX application stage
      api - the OAuth2 api
    • OpenIDAuthenticationProvider

      public OpenIDAuthenticationProvider(@Nullable @Nullable javafx.stage.Stage stage, @NotNull @NotNull OAuth2Options options)
      Creates a OAuth2 authentication provider.
      Parameters:
      stage - the JavaFX application stage
      options - the OAuth2 options
  • Method Details

    • getCredentials

      @NotNull public @NotNull OAuth2Credentials getCredentials()
    • authorizeUrl

      @NotNull public @NotNull CompletableFuture<String> authorizeUrl()
      The client sends the end-user's browser to the authorization endpoint. This endpoint is where the user signs in and grants access. End-user interaction is required.
      Returns:
      a CompletableFuture that will complete with the authorization URL once the HTTP server is ready to handle the callback, or with an exception if an error occurs during the process.
    • authenticate

      @NotNull public @NotNull CompletableFuture<User> authenticate()
      Authenticate a user with the given credentials.
      Returns:
      a future that will complete with the authenticated user