Skip to main content

Flink authentication

The Flink connector authenticates to the Gravitino server with the setting table.catalog-store.gravitino.gravitino.client.auth.type, which accepts basic or oauth2. The Datastrato Enterprise server accepts both. Leaving the setting unset makes the connector fall back to Flink's own security settings, or to simple, which sends a user name with no password and which the server does not accept.

Quick start​

The example signs the connector in to a server that uses OAuth, with a client registered at the identity provider the server trusts. The connector requests a token with the client credentials grant, sending it to serverUri joined with tokenPath.

  1. Add the OAuth settings to the Flink configuration, in place of the Basic settings from the Flink connector Quick start.

    flink-conf.yaml
    table.catalog-store.kind: gravitino
    table.catalog-store.gravitino.gravitino.uri: https://{gravitino_host}
    table.catalog-store.gravitino.gravitino.metalake: {metalake}
    table.catalog-store.gravitino.gravitino.client.auth.type: oauth2
    table.catalog-store.gravitino.gravitino.client.oauth2.serverUri: https://{idp_host}
    table.catalog-store.gravitino.gravitino.client.oauth2.tokenPath: {token_path}
    table.catalog-store.gravitino.gravitino.client.oauth2.credential: {client_id}:{client_secret}
    table.catalog-store.gravitino.gravitino.client.oauth2.scope: {scope}
  2. Restart Flink, open the SQL client, and list the catalogs. The metalake's catalogs appear when the sign-in works.

    Confirm the connector is signed in
    SHOW CATALOGS;

Basic mode​

Basic mode sends a user name and password from the server's local user store. The server must have Basic authentication enabled; see How to authenticate. The Flink connector Quick start shows a complete configuration.

PropertyTypeDefaultDescriptionRequired
table.catalog-store.gravitino.gravitino.client.auth.typestring(none)basicYes
table.catalog-store.gravitino.gravitino.client.basic.usernamestring(none)User name in the local user storeYes, for Basic
table.catalog-store.gravitino.gravitino.client.basic.passwordstring(none)Password for that userYes, for Basic

OAuth mode​

OAuth mode requests an access token from the identity provider with the client credentials grant. The Quick start shows a complete configuration.

PropertyTypeDefaultDescriptionRequired
table.catalog-store.gravitino.gravitino.client.auth.typestring(none)oauth2Yes
table.catalog-store.gravitino.gravitino.client.oauth2.serverUristring(none)Base address of the identity providerYes, for OAuth
table.catalog-store.gravitino.gravitino.client.oauth2.tokenPathstring(none)Token endpoint path, joined to serverUriYes, for OAuth
table.catalog-store.gravitino.gravitino.client.oauth2.credentialstring(none)Client credentials as {client_id}:{client_secret}Yes, for OAuth
table.catalog-store.gravitino.gravitino.client.oauth2.scopestring(none)Scope to request with the tokenYes, for OAuth