org.keycloak.adapters.undertow

## Class UndertowKeycloakAuthMech

- java.lang.Object
- - org.keycloak.adapters.undertow.UndertowKeycloakAuthMech

- All Implemented Interfaces:
    io.undertow.security.api.AuthenticationMechanism
  Direct Known Subclasses:
    ServletKeycloakAuthMech

      public abstract class UndertowKeycloakAuthMech
      extends Object
      implements io.undertow.security.api.AuthenticationMechanism

  Abstract base class for a Keycloak-enabled Undertow AuthenticationMechanism.
  Author:
    Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface io.undertow.security.api.AuthenticationMechanism

      `io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome, io.undertow.security.api.AuthenticationMechanism.ChallengeResult`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AdapterDeploymentContext` | `deploymentContext`
    `static io.undertow.util.AttachmentKey<AuthChallenge>` | `KEYCLOAK_CHALLENGE_ATTACHMENT_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UndertowKeycloakAuthMech(AdapterDeploymentContext deploymentContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome` | `keycloakAuthenticate(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext, RequestAuthenticator authenticator)` Call this inside your authenticate method.
    `protected void` | `registerNotifications(io.undertow.security.api.SecurityContext securityContext)`
    `io.undertow.security.api.AuthenticationMechanism.ChallengeResult` | `sendChallenge(io.undertow.server.HttpServerExchange exchange, io.undertow.security.api.SecurityContext securityContext)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.undertow.security.api.AuthenticationMechanism

      `authenticate`

- - ### Field Detail

    - #### KEYCLOAK_CHALLENGE_ATTACHMENT_KEY

          public static final io.undertow.util.AttachmentKey<AuthChallenge> KEYCLOAK_CHALLENGE_ATTACHMENT_KEY

    - #### deploymentContext

          protected AdapterDeploymentContext deploymentContext

  - ### Constructor Detail

    - #### UndertowKeycloakAuthMech

          public UndertowKeycloakAuthMech(AdapterDeploymentContext deploymentContext)

  - ### Method Detail

    - #### sendChallenge

          public io.undertow.security.api.AuthenticationMechanism.ChallengeResult sendChallenge(io.undertow.server.HttpServerExchange exchange,
                                                                                       io.undertow.security.api.SecurityContext securityContext)

      Specified by:
        `sendChallenge` in interface `io.undertow.security.api.AuthenticationMechanism`

    - #### registerNotifications

          protected void registerNotifications(io.undertow.security.api.SecurityContext securityContext)

    - #### keycloakAuthenticate

          protected io.undertow.security.api.AuthenticationMechanism.AuthenticationMechanismOutcome keycloakAuthenticate(io.undertow.server.HttpServerExchange exchange,
                                                                                                             io.undertow.security.api.SecurityContext securityContext,
                                                                                                             RequestAuthenticator authenticator)

      Call this inside your authenticate method.

Copyright © 2014. All Rights Reserved.