Class AuthHelper


  • public class AuthHelper
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String[] extractMethodAndToken​(java.lang.String credentials)
      Extracts method and token from credentials created using getAuthorizationHeader(String, String).
      static java.lang.String getAuthorizationHeader​(java.lang.String method, java.lang.String token)
      Encodes auth method and auth token with as whitespace separated string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AuthHelper

        public AuthHelper()
    • Method Detail

      • getAuthorizationHeader

        public static java.lang.String getAuthorizationHeader​(java.lang.String method,
                                                              java.lang.String token)
        Encodes auth method and auth token with as whitespace separated string.
        Parameters:
        method - Auth method.
        token - Auth token.
        Returns:
        Encoded method and token.
      • extractMethodAndToken

        public static java.lang.String[] extractMethodAndToken​(java.lang.String credentials)
                                                        throws io.pravega.auth.AuthenticationException
        Extracts method and token from credentials created using getAuthorizationHeader(String, String).
        Parameters:
        credentials - credentials
        Returns:
        Array of method and token.
        Throws:
        io.pravega.auth.AuthenticationException - throws authentication exception for malformed credentials.