<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – OAuth 2.0 authentication</title>
    <link>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/</link>
    <description>Recent content in OAuth 2.0 authentication on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/security-and-authentication/client-authentication/oauth-2-0-authentication/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Security-and-Authentication: Configuring OAuth authentication</title>
      <link>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/</guid>
      <description>
        
        
        &lt;p&gt;The following procedure performs the following actions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Configures an identity provider for OAuth integration with Vertica (either Okta or Keycloak).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Creates an OAuth authentication record.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Retrieves an access token from the identity provider with a POST request.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Passes the access token to a &lt;a href=&#34;https://github.com/vertica/client-application-examples/tree/v24.2&#34;&gt;sample application&lt;/a&gt;, which then authenticates to Vertica.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-the-identity-provider&#34;&gt;Configure the identity provider&lt;/h2&gt;
&lt;p&gt;Vertica officially tests and supports OAuth integration with Keycloak and Okta. Other identity providers should also work as long as they implement the &lt;a href=&#34;https://datatracker.ietf.org/doc/html/rfc7662&#34;&gt;RFC 7662 Token Introspection&lt;/a&gt; standard. The following example configurations are provided for reference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/configure-keycloak/#&#34;&gt;Configure Keycloak&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/configure-okta/#&#34;&gt;Configure Okta&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;create-an-authentication-record&#34;&gt;Create an authentication record&lt;/h2&gt;
&lt;p&gt;In Vertica, create an authentication record for OAuth. This uses the client ID, client secret, and either the discovery (Keycloak) or introspect (Okta) endpoint used by your identity provider.&lt;/p&gt;
&lt;p&gt;The following &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-authentication/&#34;&gt;authentication record&lt;/a&gt; &lt;code&gt;v_oauth&lt;/code&gt; authenticates users from any IP address by contacting the identity provider to validate the OAuth token (rather than a username and password) and uses the following parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;validate_type&lt;/code&gt;: The method used to validate the OAuth token. This should be set to &lt;code&gt;IDP&lt;/code&gt; (default) to validate the OAuth token for confidential clients.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;client_id&lt;/code&gt;: The client in the identity provider.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;client_secret&lt;/code&gt;: The client secret generated by the identity provider. This is required if &lt;code&gt;validate_type&lt;/code&gt; is &lt;code&gt;IDP&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;discovery_url&lt;/code&gt;: Also known as the &lt;a href=&#34;https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationRequest&#34;&gt;OpenID Provider Configuration Document&lt;/a&gt;, OpenText™ Analytics Database uses this endpoint to retrieve information about the identity provider&#39;s configuration and other endpoints (Keycloak only).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;introspect_url&lt;/code&gt;: Used by the database to introspect (validate) access tokens. You must specify the &lt;code&gt;introspect_url&lt;/code&gt; if you do not specify the &lt;code&gt;discovery_url&lt;/code&gt; and are not using &lt;code&gt;JWT&lt;/code&gt; validation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If &lt;code&gt;discovery_url&lt;/code&gt; and &lt;code&gt;introspect_url&lt;/code&gt; are both set, &lt;code&gt;discovery_url&lt;/code&gt; takes precedence. The following example sets both for demonstration purposes; in general, you should prefer to set the &lt;code&gt;discovery_url&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE AUTHENTICATION v_oauth METHOD &amp;#39;oauth&amp;#39; HOST &amp;#39;0.0.0.0/0&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth SET validate_type = &amp;#39;IDP&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth SET client_id = &amp;#39;vertica&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth SET client_secret = &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;client_secret&lt;/span&gt;&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth SET discovery_url = &amp;#39;https://203.0.113.1:8443/realms/myrealm/.well-known/openid-configuration&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth SET introspect_url = &amp;#39;https://203.0.113.1:8443/realms/myrealm/protocol/openid-connect/token/introspect&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Alternatively, if your identity provider supports the OpenID Connect protocol and your client is public, the database can use JWT validation, where the database validates OAuth tokens by verifying that it was signed by the identity provider&#39;s private key.&lt;/p&gt;
&lt;p&gt;The database does not contact the identity provider for JWT validation, unless &lt;code&gt;jwt_jwks_url&lt;/code&gt; is configured, in which case the database retrieves signing keys from the identity provider&#39;s JWK endpoint.&lt;/p&gt;
&lt;p&gt;JWT validation requires the following parameters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;validate_type&lt;/code&gt;: The method used to validate the OAuth token. This should be set to &lt;code&gt;JWT&lt;/code&gt; to validate the OAuth token for public clients.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;jwt_issuer&lt;/code&gt;: The issuer of the OAuth token. For Keycloak, this is the &lt;a href=&#34;https://www.keycloak.org/docs/latest/securing_apps/#token-endpoint&#34;&gt;token endpoint&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;jwt_user_mapping&lt;/code&gt;: The name of the database user.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At least one of the following key parameters must be set:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;jwt_rsa_public_key&lt;/code&gt;: In PEM format, the RSA public key used to sign the client&#39;s OAuth token. The database uses this to validate the OAuth token. If your identity provider does not natively provide PEM-formatted public keys, you must convert them to PEM format. For example, keys retrieved from an Okta endpoint are in JWK format and must be converted.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;jwt_ec_public_key&lt;/code&gt;: In PEM format, the EC public key used to sign the client&#39;s OAuth token. This is the EC key equivalent of &lt;code&gt;jwt_rsa_public_key&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;jwt_jwks_url&lt;/code&gt;: URL to retrieve JWKs from the identity provider. All keys returned by this endpoint are used when validating a user logging in with a JWT. This eliminates the need to manually update keys during identity provider key rotation. For Keycloak, the URL format is &lt;code&gt;https://&lt;span class=&#34;code-variable&#34;&gt;keycloak.host&lt;/span&gt;/realms/&lt;span class=&#34;code-variable&#34;&gt;realm&lt;/span&gt;/protocol/openid-connect/certs&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also specify the following parameters to define a whitelist based on fields of the OAuth token:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;jwt_accepted_audience_list&lt;/code&gt;: Optional, a comma-delimited list of values to accept from the client JWT&#39;s &lt;code&gt;aud&lt;/code&gt; field. If set, tokens must include in &lt;code&gt;aud&lt;/code&gt; one of the accepted audiences to authenticate.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;jwt_accepted_scope_list&lt;/code&gt;: Optional, a comma-delimited list of values to accept from the client JWT&#39;s &lt;code&gt;scope&lt;/code&gt; field. If set, tokens must include in &lt;code&gt;scope&lt;/code&gt; at least one of the accepted scopes to authenticate.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-authentication/&#34;&gt;authentication record&lt;/a&gt; &lt;code&gt;v_oauth_jwt&lt;/code&gt; authenticates users from any IP address by verifying that the client&#39;s OAuth token was signed by the identity provider&#39;s private key. It uses a static RSA public key and also requires the user to provide the proper values in the token&#39;s &lt;code&gt;aud&lt;/code&gt; and &lt;code&gt;scope&lt;/code&gt; fields:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE AUTHENTICATION v_oauth_jwt METHOD &amp;#39;oauth&amp;#39; HOST &amp;#39;0.0.0.0/0&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwt SET validate_type = &amp;#39;JWT&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwt SET jwt_rsa_public_key = &amp;#39;-----BEGIN PUBLIC KEY-----&lt;span class=&#34;code-variable&#34;&gt;public-key-value&lt;/span&gt;-----END PUBLIC KEY-----&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwt SET jwt_issuer = &amp;#39;https://&lt;span class=&#34;code-variable&#34;&gt;keycloak.host&lt;/span&gt;/realms/&lt;span class=&#34;code-variable&#34;&gt;realm_name&lt;/span&gt;&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwt SET jwt_user_mapping = &amp;#39;preferred_username&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwt SET jwt_accepted_audience_list = &amp;#39;vertica,local&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwt SET jwt_accepted_scope_list = &amp;#39;email,profile,user&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Alternatively, you can use &lt;code&gt;jwt_jwks_url&lt;/code&gt; to automatically retrieve signing keys from the identity provider&#39;s JWK endpoint. This approach eliminates the need to manually update keys during key rotation:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE AUTHENTICATION v_oauth_jwks METHOD &amp;#39;oauth&amp;#39; HOST &amp;#39;0.0.0.0/0&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwks SET validate_type = &amp;#39;JWT&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwks SET jwt_jwks_url = &amp;#39;https://&lt;span class=&#34;code-variable&#34;&gt;keycloak.host&lt;/span&gt;/realms/&lt;span class=&#34;code-variable&#34;&gt;realm_name&lt;/span&gt;/protocol/openid-connect/certs&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwks SET jwt_issuer = &amp;#39;https://&lt;span class=&#34;code-variable&#34;&gt;keycloak.host&lt;/span&gt;/realms/&lt;span class=&#34;code-variable&#34;&gt;realm_name&lt;/span&gt;&amp;#39;;
=&amp;gt; ALTER AUTHENTICATION v_oauth_jwks SET jwt_user_mapping = &amp;#39;preferred_username&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Setting the required parameters automatically enables the authentication record. To manually enable the authentication record:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AUTHENTICATION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;v_oauth&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ENABLE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For a full list of OAuth authentication parameters, see &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/oauth-authentication-parameters/#&#34;&gt;OAuth authentication parameters&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;create-a-vertica-user&#34;&gt;Create a Vertica user&lt;/h2&gt;
&lt;p&gt;Vertica users map to the identity provider&#39;s users with the same username. You can either create the user manually or enable &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/&#34;&gt;just-in-time (JIT) user provisioning&lt;/a&gt; in the authentication record to automatically create users with valid tokens.&lt;/p&gt;
&lt;p&gt;To manually create the user:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;To map to the user &lt;code&gt;oauth_user&lt;/code&gt; in the identity provider, &lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-user/&#34;&gt;create&lt;/a&gt; a Vertica user with the same name. You do not need to specify a password because authentication is performed by the identity provider:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE USER oauth_user;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Grant the OAuth authentication record to the user (or their role):&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; GRANT AUTHENTICATION v_oauth TO oauth_user;
=&amp;gt; GRANT ALL ON SCHEMA PUBLIC TO oauth_user;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To enable JIT user provisioning:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER AUTHENTICATION v_oauth SET oauth2_jit_enabled = &amp;#39;yes&amp;#39;;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the user already exists and JIT user provisioning is enabled and you use Keycloak as your IDP, Vertica automatically assigns the roles associated with the user as specified by the IDP if the roles also exist in Vertica. For details, see &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/#&#34;&gt;Just-in-time user provisioning&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;retrieve-access-token&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;retrieve-an-access-token&#34;&gt;Retrieve an access token&lt;/h2&gt;
&lt;p&gt;To authenticate to Vertica, you must retrieve an access token from the identity provider.&lt;/p&gt;
&lt;h3 id=&#34;programmatic-method&#34;&gt;Programmatic method&lt;/h3&gt;
&lt;p&gt;A simple way to get an OAuth access token and refresh token is to send a POST request to the token endpoint, providing the credentials of the user. You can then use the returned access token, refresh token, and scope with the connection properties for your client. For details, see &lt;a href=&#34;../../../../en/connecting-to/client-libraries/accessing/java/creating-and-configuring-connection/jdbc-connection-properties/#&#34;&gt;JDBC connection properties&lt;/a&gt; and &lt;a href=&#34;../../../../en/connecting-to/client-libraries/client-drivers/install-config/odbc/creating-an-odbc-data-source-name-dsn/odbc-dsn-connection-properties/#&#34;&gt;ODBC DSN connection properties&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For example, to get an access token for &lt;code&gt;oauth_user&lt;/code&gt; from Keycloak:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ curl --location --request POST &lt;span class=&#34;s1&#34;&gt;&amp;#39;http://203.0.113.1:8080/realms/master/protocol/openid-connect/token&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;--header &lt;span class=&#34;s1&#34;&gt;&amp;#39;Content-Type: application/x-www-form-urlencoded&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;--data-urlencode &lt;span class=&#34;s1&#34;&gt;&amp;#39;username=oauth_user&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;--data-urlencode &lt;span class=&#34;s1&#34;&gt;&amp;#39;password=&lt;span class=&#34;code-variable&#34;&gt;oauth_user_password&lt;/span&gt;&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;--data-urlencode &lt;span class=&#34;s1&#34;&gt;&amp;#39;client_id=vertica&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;--data-urlencode &lt;span class=&#34;s1&#34;&gt;&amp;#39;client_secret=&lt;span class=&#34;code-variable&#34;&gt;client_secret&lt;/span&gt;&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;--data-urlencode &lt;span class=&#34;s1&#34;&gt;&amp;#39;grant_type=password&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Keycloak responds with a JSON string containing the &lt;code&gt;access_token&lt;/code&gt; and &lt;code&gt;refresh_token&lt;/code&gt; if you authenticated correctly:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;access_token&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;span class=&#34;code-variable&#34;&gt;access_token&lt;/span&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;expires_in&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;60&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;refresh_expires_in&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1800&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;refresh_token&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;span class=&#34;code-variable&#34;&gt;refresh_token&lt;/span&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;token_type&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Bearer&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;not-before-policy&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;session_state&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;6745892a-aa74-452f-b6b9-c45637193859&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nt&#34;&gt;&amp;#34;scope&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;profile email&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Similarly, to retrieve an access token for &lt;code&gt;oauth_user&lt;/code&gt; from Okta:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;$ curl --insecure -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;client_id=0oa5cgdga1fb812rW697&amp;#34;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;client_secret=aq22wRl3Z3mmtuoB13omRo6Ql03Ltafet4xYi77p&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;-d &lt;span class=&#34;s2&#34;&gt;&amp;#34;username=oauth_user&amp;#34;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;password=oauth_user_password&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;-d &lt;span class=&#34;s2&#34;&gt;&amp;#34;grant_type=password&amp;#34;&lt;/span&gt; -d &lt;span class=&#34;s2&#34;&gt;&amp;#34;scope=offline_access%20openid&amp;#34;&lt;/span&gt; https://example.okta.com/oauth2/default/v1/introspect
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;token_type&amp;#34;&lt;/span&gt;:&lt;span class=&#34;s2&#34;&gt;&amp;#34;Bearer&amp;#34;&lt;/span&gt;,&lt;span class=&#34;s2&#34;&gt;&amp;#34;expires_in&amp;#34;&lt;/span&gt;:3600,&lt;span class=&#34;s2&#34;&gt;&amp;#34;access_token&amp;#34;&lt;/span&gt;:&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;span class=&#34;code-variable&#34;&gt;access_token&lt;/span&gt;&amp;#34;&lt;/span&gt;,&lt;span class=&#34;s2&#34;&gt;&amp;#34;id_token&amp;#34;&lt;/span&gt;:&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;span class=&#34;code-variable&#34;&gt;id_token&lt;/span&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;single-sign-on-sso&#34;&gt;Single-sign on (SSO)&lt;/h3&gt;
&lt;p&gt;An alternative to manually retrieving the access token is using SSO through the ODBC client driver. With this method, the ODBC driver opens the default web browser to the IDP&#39;s authentication endpoint where the user can enter their credentials. If the user successfully authenticates to the IDP, the ODBC driver automatically retrieves the token and authenticates to Vertica.&lt;/p&gt;
&lt;p&gt;To configure and use the ODBC driver for SSO:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;For clients that use the &lt;code&gt;confidential&lt;/code&gt; access type, set the &lt;code&gt;oauthclientsecret&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-authentication/&#34;&gt;authentication record&lt;/a&gt;, set the following &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/oauth-authentication-parameters/&#34;&gt;parameters&lt;/a&gt;:
&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;discovery_url&lt;/code&gt; (Keycloak only) or the following:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;token_url&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client_id&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Connect to Vertica with the ODBC driver. The default web browser opens to your IDP&#39;s sign-in page.&lt;/li&gt;
&lt;li&gt;Enter your credentials to authenticate to the IDP.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;run-the-sample-applications&#34;&gt;Run the sample applications&lt;/h2&gt;
&lt;p&gt;The OAuth sample applications, at a minimum, take an access token as an argument to authenticate to the database until the token expires. This token is retrieved by the client application and then set as a connection property in the driver.&lt;/p&gt;
&lt;h3 id=&#34;odbc&#34;&gt;ODBC&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Follow the instructions in the &lt;a href=&#34;https://github.com/vertica/client-application-examples/tree/v24.2/ODBC&#34;&gt;README&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/vertica/client-application-examples/tree/v24.2/ODBC&#34;&gt;Run the sample application&lt;/a&gt;, passing the OAuth parameters as arguments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To authenticate until the token expires:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ ./a.out --access-token &lt;span class=&#34;code-variable&#34;&gt;OAuthAccessToken&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To authenticate and silently refresh the access token when it expires:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ ./a.out --access-token &lt;span class=&#34;code-variable&#34;&gt;OAuthAccessToken&lt;/span&gt;
    --refresh-token &lt;span class=&#34;code-variable&#34;&gt;OAuthRefreshToken&lt;/span&gt;
    --client-secret &lt;span class=&#34;code-variable&#34;&gt;OAuthClientSecret&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For a list of all ODBC OAuth parameters, see &lt;a href=&#34;../../../../en/connecting-to/client-libraries/client-drivers/install-config/odbc/creating-an-odbc-data-source-name-dsn/odbc-dsn-connection-properties/#&#34;&gt;ODBC DSN connection properties&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;jdbc&#34;&gt;JDBC&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Follow the instructions in the &lt;a href=&#34;https://github.com/vertica/client-application-examples/tree/v24.2/JDBC&#34;&gt;README&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/vertica/client-application-examples/tree/v24.2/JDBC&#34;&gt;Run the sample application&lt;/a&gt;, passing the OAuth parameters as arguments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;To authenticate until the token expires:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ mvn compile exec:java -Dexec.mainClass=OAuthSampleApp -Dexec.args=&amp;#34;&lt;span class=&#34;code-variable&#34;&gt;vertica_host&lt;/span&gt; &lt;span class=&#34;code-variable&#34;&gt;database_name&lt;/span&gt; --access-token &lt;span class=&#34;code-variable&#34;&gt;oauthaccesstoken&lt;/span&gt;&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To authenticate and silently refresh the access token when it expires:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ mvn compile exec:java -Dexec.mainClass=OAuthSampleApp -Dexec.args=&amp;#34;&lt;span class=&#34;code-variable&#34;&gt;vertica_host&lt;/span&gt; &lt;span class=&#34;code-variable&#34;&gt;database_name&lt;/span&gt; --access-token &lt;span class=&#34;code-variable&#34;&gt;oauthaccesstoken&lt;/span&gt;
    --refresh_token &lt;span class=&#34;code-variable&#34;&gt;oauthrefreshtoken&lt;/span&gt;
    --client-secret &lt;span class=&#34;code-variable&#34;&gt;oauthclientsecret&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;adonet&#34;&gt;ADO.NET&lt;/h3&gt;
&lt;p&gt;The ADO.NET driver uses a simplified configuration scheme with a single connection property: OAuthAccessToken. Other flows like token refresh should be handled externally by the driver. The sample application in the following example demonstrates how to pass an access token to the ADO.NET driver and how to handle token refresh:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Follow the instructions in the &lt;a href=&#34;https://github.com/vertica/client-application-examples/tree/v24.2/ADO.NET/OAuthSampleApp/README.md&#34;&gt;README&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/vertica/client-application-examples/tree/v24.2/ADO.NET/OAuthSampleApp/OAuthSampleApp.cs&#34;&gt;Run the sample application&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;vsql&#34;&gt;VSQL&lt;/h3&gt;
&lt;h4 id=&#34;connect-to-vsql-client-using-oauth-authentication&#34;&gt;Connect to VSQL client using OAuth authentication&lt;/h4&gt;
&lt;p&gt;Before connecting to the VSQL client using OAuth authentication, ensure the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The user should be associated with an IDP provider (such as Keycloak, OKta, and so on) and granted the necessary privileges.&lt;/li&gt;
&lt;li&gt;The user should be mapped to OpenText™ Analytics Database or the administrator needs to enable JIT (Just In-time) for auto-mapping the user.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Do one of the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Provide the access token as the parameter from the CLI. Do one of the following:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; -bash-4.4$ $VSQL -L 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;lt;--Or--&amp;gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; -bash-4.4$ $VSQL --access-token 
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;lt;--Or--&amp;gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Store the access token in the environment variable VSQL_OAUTH_ACCESS_TOKEN. Optionally, provide the authentication method as OAuth.&lt;/p&gt;
&lt;p&gt;The client retrieves the access token from the environment variable and does the authentication. VSQL successfully authenticates using OAuth authentication if the environment variable of the access token is not null.&lt;/p&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;-bash-4.4$ $VSQL
Type:  \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
verticadb21496=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;lt;--Or--&amp;gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To specify user IDP (Identity Provider) credentials, provide the authentication method as OAuth. Provide the username and the database name.&lt;/p&gt;
&lt;p&gt;The user generates the public and private keys as shown below.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;openssl genpkey -algorithm RSA -out $HOME/.ssh/user_private.pem -pkeyopt rsa_keygen_bits:2048 &amp;gt; /dev/null 2&amp;gt;&amp;amp;1

openssl rsa -pubout -in $HOME/.ssh/user_private.pem -out $HOME/.ssh/user_public.pem &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The administrator:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;has access to client information such as the client ID, client secret, the token URL, and stores the client information in a text file (&lt;strong&gt;oauth_config.txt&lt;/strong&gt; by default).&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;  ClientId=&amp;lt;ClientId&amp;gt;LF
  TokenURL=http://&amp;lt;ip&amp;gt;:&amp;lt;port&amp;gt;/realms/master/protocol/openid-connect/tokenLF
  ClientSecret=&amp;lt;ClientSecret&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;collects the user&#39;s public key and stores it in the &lt;code&gt;ssh&lt;/code&gt; folder of the administrator&#39;s home path ($HOME/.ssh).&lt;/li&gt;
&lt;li&gt;encrypts the configuration file through the VSQL utility using &lt;code&gt;--oauth_encrypt&lt;/code&gt;.
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt; -bash-4.4$ $VSQL --oauth_encrypt --config_input:&amp;lt;filepath&amp;gt;/&amp;lt;filename&amp;gt; --config_output:&amp;lt;filepath&amp;gt;/&amp;lt;filename&amp;gt;
&lt;/code&gt;&lt;/pre&gt;where &amp;lt;--config_input:&amp;gt; and &amp;lt;--config_output:&amp;gt; are optional parameters. If these parameters are not specified,  the &amp;lt;--config_input:&amp;gt; is set to &lt;code&gt;$HOME/oauth_config.txt&lt;/code&gt; and &amp;lt;--config_output:&amp;gt; is set to &lt;code&gt;$HOME/dbname_config.enc&lt;/code&gt; by default.&lt;/li&gt;
&lt;li&gt;shares the encrypted configuration file with the user.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;VSQL reads the encrypted configuration file from the home path of the user. Users need to set the Home path to $HOME, if it is not already defined. Users provide the IDP username and password for authentication using OAuth authentication.&lt;/p&gt;
&lt;p&gt;The user:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;copies the encrypted client configuration file in the home path ($HOME) and ensures that the file name is  &lt;code&gt;&amp;lt;dbname&amp;gt;_conf.enc&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;ensures that the generated &lt;code&gt;user_private.pem&lt;/code&gt; file is available in the $HOME/.ssh folder.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;(VSQL) provides the DBName, auth method, username, and password. It is mandatory to provide the DBName, auth
method, and username. The user either enters the IDP password as a parameter or VSQL prompts for it.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;-bash-4.4$ $VSQL -U &amp;lt;username&amp;gt; -d &amp;lt;DBName&amp;gt; -M OAuth
 idpPassword:
 Type:  \h or \? for help with vsql commands
   \g or terminate with semicolon to execute query
   \q to quit
 verticadb=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&amp;lt;--Or--&amp;gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;-bash-4.4$ $VSQL -U &amp;lt;username&amp;gt; -d &amp;lt;DBName&amp;gt; -M OAuth -I &amp;#34;$pass$&amp;#34;
Type:  \h or \? for help with vsql commands
   \g or terminate with semicolon to execute query
   \q to quit
 verticadb=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;troubleshooting&#34;&gt;Troubleshooting&lt;/h4&gt;
&lt;p&gt;To get debugging information for TLS, use the &lt;code&gt;-Djavax.net.debug=ssl&lt;/code&gt; flag.&lt;/p&gt;
&lt;h4 id=&#34;custom-ca-certificates&#34;&gt;Custom CA certificates&lt;/h4&gt;
&lt;p&gt;A truststore is a container for trusted certificate authority (CA) certificates. These CA certificates are used to verify the identities of other systems when establishing a TLS connection. When your JDBC client connects to the identity provider through an HTTPS endpoint, the JDBC client verifies the identity provider&#39;s certificate by making sure that it was issued by a CA in the truststore.&lt;/p&gt;
&lt;p&gt;If you configure your identity provider with TLS (that is, if you use HTTPS endpoints for your token or refresh URLs) and its certificate is not issued by a well-known CA, you must either specify a custom truststore or import the issuer&#39;s CA certificate into the system truststore with &lt;a href=&#34;https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html&#34;&gt;&lt;code&gt;keytool&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To specify a custom truststore, set the JDBC connection properties &lt;code&gt;oauthtruststorepath&lt;/code&gt; and &lt;code&gt;oauthtruststorepassword&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;connProps = new Properties(connProps);
connProps.setProperty(&amp;#34;oauthtruststorepath&amp;#34;, &amp;#34;/path/to/truststore/customoauth.truststore&amp;#34;);
connProps.setProperty(&amp;#34;oauthtruststorepassword&amp;#34;, &amp;#34;password&amp;#34;);
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To add the certificate &lt;code&gt;keycloak/cert.crt&lt;/code&gt; to the Java truststore:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ keytool -trustcacerts -keystore /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.x86_64/jre/lib/security/cacerts -storepass changeit -importcert -alias keycloak -file /keycloak/cert.crt
&lt;/code&gt;&lt;/pre&gt;
      </description>
    </item>
    
    <item>
      <title>Security-and-Authentication: Just-in-time user provisioning</title>
      <link>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/</guid>
      <description>
        
        
        &lt;p&gt;Just-in-time (JIT) user provisioning is the act of automatically configuring an authenticated user and their roles based on information provided by the identity provider (IdP).&lt;/p&gt;
&lt;p&gt;When a client uses an OAuth &lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-authentication/&#34;&gt;authentication record&lt;/a&gt; that enables JIT user provisioning, OpenText™ Analytics Database automatically performs the following actions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-user/&#34;&gt;Creates the user&lt;/a&gt; if they do not exist in the database. The username must conform to conventions described in &lt;a href=&#34;../../../../en/sql-reference/language-elements/identifiers/#&#34;&gt;Identifiers&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you configure &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/#automatic-role-assignment&#34;&gt;automatic role assignment&lt;/a&gt;, OpenText™ Analytics Database identifies roles that exist in both the user or group identity and the database and &lt;a href=&#34;../../../../en/sql-reference/statements/grant-statements/grant-role/&#34;&gt;grants&lt;/a&gt; each role to the database user as a &lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/enabling-roles-automatically/&#34;&gt;default role&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../en/sql-reference/statements/grant-statements/grant-authentication/&#34;&gt;Grants&lt;/a&gt; to the user the authentication record that is associated with the IdP if the user or role does not already have a grant on that authentication record.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can view all JIT-provisioned users and their authentication record with the &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/users/#&#34;&gt;USERS&lt;/a&gt; system table. If the user was JIT-provisioned, then the &lt;code&gt;managed_by_oauth2_auth_id&lt;/code&gt; column lists the JIT-enabled authentication record:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;user_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;managed_by_oauth2_auth_id&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;users&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;user_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;managed_by_oauth2_auth_id&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-----------+-----------------------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbadmin&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Bob&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;       &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;45035996273853300&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Margie&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Alice&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;     &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;45035996273866484&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;rows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;enable-jit-provisioning&#34;&gt;Enable JIT provisioning&lt;/h2&gt;
&lt;p&gt;When the database authenticates a JIT-provisioned user, it loops through all existing OAuth authentication records for a record that can authenticate the OAuth token in the client request. If the database locates the authentication record, it assigns the record to the JIT-provisioned user.&lt;/p&gt;
&lt;p&gt;After you &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/&#34;&gt;create an OAuth authentication record&lt;/a&gt;, you must &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-authentication/&#34;&gt;alter its authentication record&lt;/a&gt; to enable JIT. To enable JIT, set the &lt;code&gt;jit_enabled&lt;/code&gt; &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/oauth-authentication-parameters/&#34;&gt;OAuth authentication parameter&lt;/a&gt; to &lt;code&gt;yes&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AUTHENTICATION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;v_oauth&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;jit_enabled&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;yes&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AUTHENTICATION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To confirm that JIT authentication is enabled on the authentication record, query the &lt;code&gt;CLIENT_AUTH_PARAMS&lt;/code&gt; table:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CLIENT_AUTH_PARAMS&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;v_oauth&amp;#39;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;AND&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_parameter_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;jit_enabled&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;     &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_oid&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_parameter_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_parameter_value&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-------------------+-----------+---------------------+----------------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;45035996273859012&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;v_oauth&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;jit_enabled&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;yes&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;row&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;automatic-role-assignment&#34;&gt;Automatic role assignment&lt;/h2&gt;
&lt;p&gt;The database can automatically assign a role to a JIT-provisioned user if the OAuth token contains the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Client identity role that exactly matches the database role&lt;/li&gt;
&lt;li&gt;Group identity role that exactly matches the database role&lt;/li&gt;
&lt;li&gt;Group identity name that exactly matches the database role&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The database updates the role assignment each time a JIT-provisioned user authenticates with the OAuth token. For example, if the database automatically assigned a role using the group identity name and then that group identity is removed from the IdP, that role is revoked the next time that JIT-provisioned user authenticates to the database. In addition, you can add a role to a blocklist that prevents the database from automatically granting that role during JIT provisioning. These features ensure that the database reflects up-to-date role assignments so that you can manage your database user identities from a single, secure location.&lt;/p&gt;
&lt;h3 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/#create-an-authentication-record&#34;&gt;Create an OAuth authentication record&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#enable-jit-provisioning&#34;&gt;Enable JIT provisioning&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;../../../../en/admin/db-users-and-privileges/db-roles/&#34;&gt;Create database roles&lt;/a&gt; that you want to automatically assign to JIT-provisioned users.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;configure-role-assignment&#34;&gt;Configure role assignment&lt;/h3&gt;
&lt;p&gt;An IdP manages the database as a client identity. An IdP client can have zero or more roles, where each role has specific privileges in the client environment. IdPs also manage group identities, where each group identity is a collection of user identities that share attributes and roles.&lt;/p&gt;
&lt;p&gt;During automatic role assignment, the database treats each IdP client role, group role, and group name the same. If the JIT-provisioned user has a client role, group role, or group name that maps to a database role, the database automatically assigns that role to the JIT-provisioned user. A single OAuth token can contain both client and group identities.&lt;/p&gt;
&lt;p&gt;To associate a database with an IdP client or group identity, set the corresponding &lt;a href=&#34;../../../../en/sql-reference/config-parameters/security-parameters/&#34;&gt;security parameter&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;OAuth2JITRolesClaimName&lt;/code&gt; identifies the database client identity in an IdP that contains the role mappings:
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DATABASE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DEFAULT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OAuth2JITRolesClaimName&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;resource_access.&lt;span class=&#34;code-variable&#34;&gt;IdPClientName&lt;/span&gt;.roles&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;OAuth2JITGroupsClaimName&lt;/code&gt; identifies a group identity that contains the client role mappings:
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DATABASE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DEFAULT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OAuth2JITGroupsClaimName&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;IdPGroupClaimName&lt;/span&gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The database automatically assigns a role only if the database security parameter setting exactly matches an IdP client or group claim name. If there is a match, then the databasea looks at the match in the IdP. If there is a client role, group name, or group role that exactly matches an existing database role, then the database grants the database role to the JIT-provisioned user. The database ignores any roles or groups that do not have exact matches in the database.&lt;/p&gt;
&lt;h3 id=&#34;restrict-role-assignment&#34;&gt;Restrict role assignment&lt;/h3&gt;
&lt;p&gt;The database can assign any role to a JIT-provisioned user, including DBADMIN and PSEUDOSUPERUSER. Because granting unrestricted privileges might raise security concerns, you can restrict the database role assignments with the &lt;code&gt;OAuth2JITForbiddenRoles&lt;/code&gt; &lt;a href=&#34;../../../../en/sql-reference/config-parameters/security-parameters/&#34;&gt;security parameter&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DATABASE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;DEFAULT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SET&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OAuth2JITForbiddenRoles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;dbadmin,pseudosuperuser&amp;#39;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When an IdP user has a role or group mapping that matches a role in &lt;code&gt;OAuth2JITForbiddenRoles&lt;/code&gt;, the database does not grant the JIT-provisioned user that role.&lt;/p&gt;
&lt;h3 id=&#34;verify-role-assignments&#34;&gt;Verify role assignments&lt;/h3&gt;
&lt;p&gt;To verify which roles were automatically assigned to JIT-provisioned users, you can query the &lt;code&gt;vs_users&lt;/code&gt; table. The &lt;code&gt;num_jit_roles&lt;/code&gt; column lists the number of roles that were assigned with JIT provisioning, and &lt;code&gt;oauth2_jit_roles&lt;/code&gt; list the names of each role:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;\&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Expanded&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;display&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;is&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;num_default_roles&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;default_roles&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;num_jit_roles&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;oauth2_jit_roles&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;managed_by_oauth2_auth_id&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vs_users&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&lt;span class=&#34;code-variable&#34;&gt;username&lt;/span&gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;RECORD&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-------------+----------------------------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;num_default_roles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;default_roles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;             &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vertica&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;admin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vertica&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;user&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;num_jit_roles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;             &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;oauth2_jit_roles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;          &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vertica&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;admin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vertica&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;user&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;managed_by_oauth2_auth_id&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;45035996273851314&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;example&#34;&gt;Example&lt;/h3&gt;
&lt;p&gt;In this example scenario, an organization uses the Keycloak IdP to manage user identities across their organization. The Keycloak implementation has a client identity named &lt;code&gt;vertica&lt;/code&gt; and a group identity named &lt;code&gt;groups&lt;/code&gt;. The following table lists the client roles, IdP groups, and group roles:&lt;/p&gt;
&lt;table class=&#34;table table-bordered&#34; &gt;
&lt;tr&gt; 
&lt;th &gt;
&lt;code&gt;vertica&lt;/code&gt; client roles&lt;/th&gt; 
&lt;th &gt;
&lt;code&gt;groups&lt;/code&gt; name&lt;/th&gt; 
&lt;th &gt;
&lt;code&gt;groups&lt;/code&gt; roles&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt; 
&lt;td &gt;
&lt;p&gt;dbadmin&lt;/p&gt;
&lt;p&gt;orders_user&lt;/p&gt;
&lt;p&gt;view_realm&lt;/p&gt;
&lt;/td&gt; 
&lt;td &gt;
&lt;p&gt;realm_admin&lt;/td&gt;&lt;/p&gt;
&lt;td &gt;
&lt;p&gt;user_admin&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;
&lt;h4 id=&#34;database-configuration&#34;&gt;Database configuration&lt;/h4&gt;
&lt;p&gt;There is a database named &lt;code&gt;orders&lt;/code&gt; with the following security parameter settings that define the roles claim, group claim, and restricted roles:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parameter_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;current_value&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;configuration_parameters&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parameter_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;OAuth2JITRolesClaimName&amp;#39;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;OR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parameter_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;OAuth2JITGroupsClaimName&amp;#39;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;OR&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parameter_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;OAuth2JITForbiddenRoles&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parameter_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;            &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;current_value&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;--------------------------+-------------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OAuth2JITForbiddenRoles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbadmin&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pseudosuperuser&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OAuth2JITGroupsClaimName&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;groups&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;OAuth2JITRolesClaimName&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;resource_access&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vertica&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;roles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;rows&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The database has the following users:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;USER_NAME&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;USERS&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;USER_NAME&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-----------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbadmin&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;row&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The database has the following assigned roles:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NAME&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ASSIGNED_ROLES&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ROLES&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;NAME&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;       &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ASSIGNED_ROLES&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-----------------+----------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;          &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbduser&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbadmin&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbduser&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;pseudosuperuser&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;dbadmin&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;orders_user&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;     &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;user_admin&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h4 id=&#34;role-assignment-process&#34;&gt;Role assignment process&lt;/h4&gt;
&lt;p&gt;A client authenticates to the &lt;code&gt;orders&lt;/code&gt; database as a user named &lt;code&gt;Alice&lt;/code&gt;, but the &lt;code&gt;Alice&lt;/code&gt; user does not exist in the database. The authentication record associated with the &lt;code&gt;orders&lt;/code&gt; database uses &lt;code&gt;IDP&lt;/code&gt; validation and has &lt;code&gt;jit_enabled&lt;/code&gt; set to &lt;code&gt;yes&lt;/code&gt;, so the database can JIT provision the &lt;code&gt;Alice&lt;/code&gt; user and then assign roles that exist in both the IdP and the database.&lt;/p&gt;
&lt;p&gt;When &lt;code&gt;Alice&lt;/code&gt; authenticates to the &lt;code&gt;orders&lt;/code&gt; database, the database performs the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Provisions the &lt;code&gt;Alice&lt;/code&gt; user.&lt;/li&gt;
&lt;li&gt;Sends a request to the IdP to retrieve roles using the &lt;code&gt;OAuth2JITRolesClaimName&lt;/code&gt; and &lt;code&gt;OAuth2JITGroupsClaimName&lt;/code&gt; security parameter settings. In this case, the database requests roles for a client identity named &lt;code&gt;vertica&lt;/code&gt; and a group identity named &lt;code&gt;groups&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Compares all client and group roles in the IdP response to the roles in the database and performs the following:
&lt;ul&gt;
&lt;li&gt;Grants the &lt;code&gt;orders_user&lt;/code&gt; role to the JIT-provisioned &lt;code&gt;Alice&lt;/code&gt; user, and sets it as a default role.&lt;/li&gt;
&lt;li&gt;Grants the &lt;code&gt;user_admin&lt;/code&gt; role to the JIT-provisioned &lt;code&gt;Alice&lt;/code&gt; user, and sets it as a default role.&lt;/li&gt;
&lt;li&gt;Does not grant the &lt;code&gt;dbadmin&lt;/code&gt; role to &lt;code&gt;Alice&lt;/code&gt; because it is specified by the &lt;code&gt;OAuth2JITForbiddenRoles&lt;/code&gt; security parameter.&lt;/li&gt;
&lt;li&gt;Ignores the &lt;code&gt;realm_admin&lt;/code&gt; group name and &lt;code&gt;view_admin&lt;/code&gt; group role because there is no corresponding role in the database.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After the automatic role assignment process completes, &lt;code&gt;Alice&lt;/code&gt; has default roles that reflect the IdP configuration:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;user_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;default_roles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;users&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;WHERE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;user_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Alice&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;user_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;default_roles&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;-----------+-------------------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Alice&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;     &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;orders_user&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;user_admin&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;row&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The automatic role assignment workflow occurs each time a client authenticates as the &lt;code&gt;Alice&lt;/code&gt; user. This ensures that the database role assignments reflect the current role assignments in the IdP.&lt;/p&gt;
&lt;h2 id=&#34;automatic-user-pruning&#34;&gt;Automatic user pruning&lt;/h2&gt;
&lt;p&gt;You can enable automatic user pruning to periodically drop users created by JIT user provisioning if they do not log in after a certain period of time. This cleanup service is managed by the following &lt;a href=&#34;../../../../en/sql-reference/config-parameters/security-parameters/&#34;&gt;database-level configuration parameters&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;EnableOAuthJITCleanup: Whether to enable cleanup (disabled by default).&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET EnableOAuthJITCleanup = 1; --enables the pruning service
=&amp;gt; ALTER DATABASE DEFAULT SET EnableOAuthJITCleanup = 0; --disables the pruning service
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;OAuth2UserExpiredInterval: The number of days a user must be inactive before it is dropped (14 by default). This is calculated based on the current date and the &lt;code&gt;LAST_LOGIN_TIME&lt;/code&gt; in the &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/users/#&#34;&gt;USERS&lt;/a&gt; system table.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

&lt;p&gt;The &lt;code&gt;LAST_LOGIN_TIME&lt;/code&gt; as recorded by the &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/users/#&#34;&gt;USERS&lt;/a&gt; system table is not persistent; if the database is restarted, the &lt;code&gt;LAST_LOGIN_TIME&lt;/code&gt; for users created by just-in-time user provisioning is set to the database start time (this appears as an empty value in &lt;code&gt;LAST_LOGIN_TIME&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;You can view the database start time by querying the &lt;a href=&#34;../../../../en/sql-reference/system-tables/v-catalog-schema/dbs/#&#34;&gt;DATABASES&lt;/a&gt; system table:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;database_name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;start_time&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;FROM&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;databases&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;database_name&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;          &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;start_time&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;---------------+-------------------------------
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;VMart&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;         &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2023&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;02&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;06&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;14&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;26&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;50&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;630054&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;05&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;row&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET OAuth2UserExpiredInterval = 20;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;GlobalHeirUsername: The user to reassign objects to if the owner is a JIT-provisioned (or LDAP) user that got dropped by the pruning service. If set to &lt;code&gt;&amp;lt;auto&amp;gt;&lt;/code&gt;, objects are reassigned to the &lt;code&gt;dbadmin&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; ALTER DATABASE DEFAULT SET GlobalHeirUsername = &amp;lt;auto&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The cleanup service runs daily and there can be a delay of up to 24 hours for dropping an expired user.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Security-and-Authentication: OAuth authentication parameters</title>
      <link>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/oauth-authentication-parameters/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/oauth-authentication-parameters/</guid>
      <description>
        
        
        &lt;p&gt;Vertica OAuth &lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-authentication/&#34;&gt;authentication records&lt;/a&gt; uses parameters to determine how to validate client OAuth tokens and how to contact the identity provider during the validation process. These parameters should be set with &lt;a href=&#34;../../../../en/sql-reference/statements/alter-statements/alter-authentication/#&#34;&gt;ALTER AUTHENTICATION&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;just-in-time-provisioning-parameters&#34;&gt;Just-in-time provisioning parameters&lt;/h2&gt;
&lt;p&gt;The following parameters configure &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/&#34;&gt;just-in-time user provisioning&lt;/a&gt; (JIT):&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;groups_claim_name&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Sets the group claim name for the authentication record. This setting overrides the &lt;code&gt;OAuth2JITGroupsClaimName&lt;/code&gt; &lt;a href=&#34;../../../../en/sql-reference/config-parameters/security-parameters/&#34;&gt;security parameter&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;jit_enabled&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Whether to enable &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/&#34;&gt;just-in-time user provisioning&lt;/a&gt;. This parameter accepts the following values:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&#39;yes&#39;&lt;/code&gt;: Vertica uses &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/just-time-user-provisioning/#automatic-role-assignment&#34;&gt;automatic role assignment&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&#39;no&#39;&lt;/code&gt; or unset: You must manually &lt;a href=&#34;../../../../en/sql-reference/statements/create-statements/create-user/&#34;&gt;create each user&lt;/a&gt; and &lt;a href=&#34;../../../../en/sql-reference/statements/grant-statements/grant-authentication/&#34;&gt;grant the user&lt;/a&gt; an &lt;code&gt;oauth&lt;/code&gt; authentication record before they can authenticate to Vertica with OAuth tokens.&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;oauth2_jit_authorized_roles&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;When set, the OAuth user specifies roles that can use JIT user provisioning. When omitted, any OAuth user can use JIT provisioning.
&lt;p&gt;This parameter accepts one or more roles as a comma-separated list.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;role_group_suffix&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;OpenText Directory Service (OTDS) only.
&lt;p&gt;Appends a value to the role or group name associated with the OAuth record. Vertica uses this value to identify users during authorization. Vertica recommends that you append your subscription ID in the following format: &lt;code&gt;@&lt;/code&gt;&lt;span class=&#34;code-variable&#34;&gt;subscriptionID&lt;/span&gt;.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;roles_claim_name&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Sets the roles claim name for the authentication record. This setting overrides the &lt;code&gt;OAuth2JITRolesClaimName&lt;/code&gt; &lt;a href=&#34;../../../../en/sql-reference/config-parameters/security-parameters/&#34;&gt;security parameter&lt;/a&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;validation-modes&#34;&gt;Validation modes&lt;/h2&gt;
&lt;p&gt;OAuth authentication records have two modes for validating OAuth tokens, each specified with the authentication parameter &lt;code&gt;validate_type&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;validate_type&lt;/code&gt; accepts one of the following values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;IDP&lt;/code&gt; (default): Validate OAuth tokens by contacting the identity provider. This validation type requires the client to specify their client secret. This should be used with confidential clients (set for each client by the identity provider).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;JWT&lt;/code&gt;: Validate OAuth tokens by verifying that it was signed by the identity provider&#39;s private key. This does not require Vertica to contact the identity provider for validation and should be used for public clients (set for each client by the identity provider).&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each validation mode uses a different set of parameters, which are detailed in the sections below.&lt;/p&gt;
&lt;h3 id=&#34;idp-validation-parameters&#34;&gt;IDP validation parameters&lt;/h3&gt;
&lt;p&gt;The following parameters configure OAuth authentication records that use the &lt;code&gt;IDP&lt;/code&gt; validation mode:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;client_id&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required. The ID of the confidential client application registered in the identity provider. Vertica uses this ID to call the introspection API to retrieve user grants.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;client_secret&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required. The secret of the confidential client application registered in the identity provider. This value is not shared with other clients.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;discovery_url&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required for &lt;code&gt;IDP&lt;/code&gt; validation if &lt;code&gt;introspect_url&lt;/code&gt; is not specified.
&lt;p&gt;Also known as the &lt;a href=&#34;https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationRequest&#34;&gt;OpenID Provider Configuration Document&lt;/a&gt; or the well-known configuration endpoint, this endpoint contains information about the configuration and endpoints of the identity provider.&lt;/p&gt;
&lt;p&gt;If you set the &lt;code&gt;discovery_url&lt;/code&gt;, you do not have to set any other endpoint parameters. If you specify &lt;code&gt;discovery_url&lt;/code&gt; and other endpoints, the &lt;code&gt;discovery_url&lt;/code&gt; takes precedence.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;introspect_url&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required if &lt;code&gt;discovery_url&lt;/code&gt; is not specified. Used by Vertica to introspect (validate) access tokens. You must specify this parameter if you do not specify the &lt;code&gt;discovery_url&lt;/code&gt;. For examples, see the &lt;a href=&#34;https://www.keycloak.org/docs/latest/securing_apps/#_token_introspection_endpoint&#34;&gt;Keycloak&lt;/a&gt; and &lt;a href=&#34;https://developer.okta.com/docs/reference/api/oidc/#introspect&#34;&gt;Okta&lt;/a&gt; documentation.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;auth_url&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required for &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/#single-sign-on-sso&#34;&gt;single-sign on (SSO)&lt;/a&gt;. The &lt;a href=&#34;https://www.keycloak.org/docs/latest/securing_apps/#authorization-endpoint&#34;&gt;authorization endpoint&lt;/a&gt; for your identity provider.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;token_url&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required for &lt;a href=&#34;../../../../en/security-and-authentication/client-authentication/oauth-2-0-authentication/configuring-oauth-authentication/#single-sign-on-sso&#34;&gt;single-sign on (SSO)&lt;/a&gt;. The &lt;a href=&#34;https://www.keycloak.org/docs/latest/securing_apps/#token-endpoint&#34;&gt;token endpoint&lt;/a&gt; for your identity provider.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;scope&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. The requested OAuth scopes, delimited with spaces. These scopes define the extent of access to the resource server (in this case, Vertica) granted to the client by the access token. For details, see the &lt;a href=&#34;https://www.oauth.com/oauth2-servers/scope/defining-scopes/&#34;&gt;OAuth documentation&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;validate_hostname&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. Boolean, whether Vertica verifies the &lt;code&gt;subjectAltName&lt;/code&gt; of the identity provider host when establishing a connection. If enabled, the IP address or hostname of the identity provider must be set as the &lt;code&gt;subjectAltName&lt;/code&gt; in its certificate. This parameter only applies to connections made by JDBC clients.
&lt;p&gt;Hostname verification is enabled by default.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h3 id=&#34;jwt-validation-parameters&#34;&gt;JWT validation parameters&lt;/h3&gt;
&lt;p&gt;The following parameters configure OAuth authentication records that use the &lt;code&gt;JWT&lt;/code&gt; validation mode.&lt;/p&gt;
&lt;p&gt;At least one of &lt;code&gt;jwt_rsa_public_key&lt;/code&gt;, &lt;code&gt;jwt_ec_public_key&lt;/code&gt;, or &lt;code&gt;jwt_jwks_url&lt;/code&gt; must be set for the authentication record to be active. You can configure any combination of these parameters.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;jwt_rsa_public_key&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. In PEM format, the RSA public key that corresponds to the private key used to sign the client&#39;s OAuth token. Vertica uses this to validate the OAuth token. If your identity provider does not natively provide PEM-formatted public keys, you must convert them to PEM format. For example, keys retrieved from an Okta endpoint are in JWK format and must be converted.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;jwt_ec_public_key&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. In PEM format, the EC (Elliptic Curve) public key that corresponds to the private key used to sign the client&#39;s OAuth token. This is the EC key equivalent of &lt;code&gt;jwt_rsa_public_key&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;jwt_jwks_url&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. URL to retrieve JSON Web Keys (JWKs) from the identity provider. All keys returned by this endpoint are used when validating a user logging in with a JWT. Using this parameter allows Vertica to automatically fetch signing keys, which eliminates the need to manually update keys during identity provider key rotation.
&lt;p&gt;For Keycloak, the URL format is: &lt;code&gt;https://&lt;/code&gt;&lt;span class=&#34;code-variable&#34;&gt;keycloak.host&lt;/span&gt;&lt;code&gt;/realms/&lt;/code&gt;&lt;span class=&#34;code-variable&#34;&gt;realm&lt;/span&gt;&lt;code&gt;/protocol/openid-connect/certs&lt;/code&gt;&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;jwt_issuer&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required. The issuer of the OAuth token. This value is set by the identify provider.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;jwt_user_mapping&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Required. The name of the Vertica user.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;jwt_accepted_audience_list&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. A comma-delimited list of values to accept from the client OAuth token&#39;s &lt;code&gt;aud&lt;/code&gt; field. If set, tokens must include in &lt;code&gt;aud&lt;/code&gt; one of the accepted audiences to authenticate.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;jwt_accepted_scope_list&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Optional. A comma-delimited list of values to accept from the client OAuth token&#39;s &lt;code&gt;scope&lt;/code&gt; field. If set, tokens must include in &lt;code&gt;scope&lt;/code&gt; at least one of the accepted scopes to authenticate.&lt;/dd&gt;
&lt;/dl&gt;

      </description>
    </item>
    
    <item>
      <title>Security-and-Authentication: Multi-factor authentication with TOTP</title>
      <link>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/mfa-authentication-with-totp/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/security-and-authentication/client-authentication/oauth-2-0-authentication/mfa-authentication-with-totp/</guid>
      <description>
        
        
        &lt;p&gt;OpenText™ Analytics Database now supports Multi-Factor Authentication (MFA) using Time-Based One-Time Passwords (Totp) when the client connects with the server. MFA adds an additional layer of security. Users need to verify their identity using a Totp in addition to their database login credentials.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
