Class OidcUtils


  • public final class OidcUtils
    extends Object
    • Method Detail

      • isServiceApp

        public static boolean isServiceApp​(OidcTenantConfig oidcConfig)
      • isEncryptedToken

        public static boolean isEncryptedToken​(String token)
      • isOpaqueToken

        public static boolean isOpaqueToken​(String token)
      • decodeJwtContent

        public static io.vertx.core.json.JsonObject decodeJwtContent​(String jwt)
      • decodeJwtContentAsString

        public static String decodeJwtContentAsString​(String jwt)
      • getJwtContentPart

        public static String getJwtContentPart​(String jwt)
      • decodeJwtHeaders

        public static io.vertx.core.json.JsonObject decodeJwtHeaders​(String jwt)
      • decodeJwtHeadersAsString

        public static String decodeJwtHeadersAsString​(String jwt)
      • validateAndCreateIdentity

        static QuarkusSecurityIdentity validateAndCreateIdentity​(io.vertx.ext.web.RoutingContext vertxContext,
                                                                 io.quarkus.security.credential.TokenCredential credential,
                                                                 TenantConfigContext resolvedContext,
                                                                 io.vertx.core.json.JsonObject tokenJson,
                                                                 io.vertx.core.json.JsonObject rolesJson,
                                                                 UserInfo userInfo,
                                                                 TokenIntrospection introspectionResult)
      • setBlockingApiAttribute

        public static void setBlockingApiAttribute​(QuarkusSecurityIdentity.Builder builder,
                                                   io.vertx.ext.web.RoutingContext vertxContext)
      • setRoutingContextAttribute

        public static void setRoutingContextAttribute​(QuarkusSecurityIdentity.Builder builder,
                                                      io.vertx.ext.web.RoutingContext routingContext)
      • validatePrimaryJwtTokenType

        public static void validatePrimaryJwtTokenType​(OidcTenantConfig.Token tokenConfig,
                                                       io.vertx.core.json.JsonObject tokenJson)
      • removeCookie

        static void removeCookie​(io.vertx.ext.web.RoutingContext context,
                                 io.vertx.core.http.impl.ServerCookie cookie,
                                 OidcTenantConfig oidcConfig)
      • setCookiePath

        static void setCookiePath​(io.vertx.ext.web.RoutingContext context,
                                  OidcTenantConfig.Authentication auth,
                                  io.vertx.core.http.impl.ServerCookie cookie)
      • mergeTenantConfig

        static OidcTenantConfig mergeTenantConfig​(OidcTenantConfig tenant,
                                                  OidcTenantConfig provider)
        Merge the current tenant and well-known OpenId Connect provider configurations. Initialized properties take priority over uninitialized properties. Initialized properties in the current tenant configuration take priority over the same initialized properties in the well-known OpenId Connect provider configuration. Tenant id property of the current tenant must be set before the merge operation.
        Parameters:
        tenant - current tenant configuration
        provider - well-known OpenId Connect provider configuration
        Returns:
        merged configuration
      • decryptJson

        public static io.vertx.core.json.JsonObject decryptJson​(String jweString,
                                                                Key key)
                                                         throws Exception
        Throws:
        Exception
      • decryptString

        public static String decryptString​(String jweString,
                                           Key key,
                                           io.smallrye.jwt.algorithm.KeyEncryptionAlgorithm algorithm)
                                    throws org.jose4j.lang.JoseException
        Throws:
        org.jose4j.lang.JoseException
      • isFormUrlEncodedRequest

        public static boolean isFormUrlEncodedRequest​(io.vertx.ext.web.RoutingContext context)
      • getFormUrlEncodedData

        public static io.smallrye.mutiny.Uni<io.vertx.core.MultiMap> getFormUrlEncodedData​(io.vertx.ext.web.RoutingContext context)