Class AuthenticatorUtils


  • public final class AuthenticatorUtils
    extends Object
    • Method Detail

      • getHeaderWithPrefix

        @Nullable
        public static @Nullable String getHeaderWithPrefix​(@Nullable
                                                           @Nullable List<String> authenticateHeaders,
                                                           String prefix)
      • selectBestDigestChallenge

        @Nullable
        public static @Nullable String selectBestDigestChallenge​(@Nullable
                                                                 @Nullable List<String> authenticateHeaders)
        RFC 7616 Section 4: Select the best Digest challenge from the list. Iterates in server preference order and returns the first challenge whose algorithm is supported.
      • computeRealmURI

        public static String computeRealmURI​(Uri uri,
                                             boolean useAbsoluteURI,
                                             boolean omitQuery)
      • computeRspAuth

        public static String computeRspAuth​(Realm realm)
        RFC 7616 Section 3.5: Compute rspauth value for mutual authentication. rspauth = H(HA1 : nonce : nc : cnonce : qop : H(":" uri)) Note: HA2' for rspauth uses empty method prefix.
      • computeBodyHash

        public static String computeBodyHash​(Request request,
                                             Realm realm)
      • perConnectionProxyAuthorizationHeader

        @Nullable
        public static @Nullable String perConnectionProxyAuthorizationHeader​(Request request,
                                                                             @Nullable
                                                                             @Nullable Realm proxyRealm)
      • perRequestProxyAuthorizationHeader

        @Nullable
        public static @Nullable String perRequestProxyAuthorizationHeader​(Request request,
                                                                          @Nullable
                                                                          @Nullable Realm proxyRealm)
      • perConnectionAuthorizationHeader

        @Nullable
        public static @Nullable String perConnectionAuthorizationHeader​(Request request,
                                                                        @Nullable
                                                                        @Nullable ProxyServer proxyServer,
                                                                        @Nullable
                                                                        @Nullable Realm realm)
      • perRequestAuthorizationHeader

        @Nullable
        public static @Nullable String perRequestAuthorizationHeader​(Request request,
                                                                     @Nullable
                                                                     @Nullable Realm realm)