Class BearerTokenWebSocketAuthenticator

java.lang.Object
org.qubership.atp.auth.springbootstarter.services.BearerTokenWebSocketAuthenticator

public class BearerTokenWebSocketAuthenticator extends Object
  • Constructor Details

    • BearerTokenWebSocketAuthenticator

      public BearerTokenWebSocketAuthenticator()
  • Method Details

    • authenticate

      public org.springframework.security.core.Authentication authenticate(String tokenString) throws org.springframework.security.core.AuthenticationException
      Authenticate web socket. see https://stackoverflow.com/questions/50573461/spring-websockets-authentication-with-spring-security-and-keycloak
      Parameters:
      tokenString - the token string
      Returns:
      the authentication
      Throws:
      org.springframework.security.core.AuthenticationException - the authentication exception
    • verifyAndGetAccessToken

      public org.keycloak.representations.AccessToken verifyAndGetAccessToken(String tokenString, org.keycloak.adapters.KeycloakDeployment deployment) throws org.keycloak.common.VerificationException
      Throws:
      org.keycloak.common.VerificationException