SAP Knowledge Base Article - Public

3461484 - How to get the OAuth token for CLI command


  • You have created an OAuth Client in Datasphere and would like to use it in the CLI command
  • You are facing issues with using the OAuth credentials in the CLI command


SAP Datasphere


  1. Ensure that the Redirect URI is set to http://localhost:8080/ as mentioned in Create OAuth2.0 Clients to Authenticate Against SAP Datasphere ("Redirect URI")
  2. Run the command datasphere logout . This is to logout of any earlier logins which you may have done
  3. Run the command datasphere config cache clean to clear the cache
  4. Run the command datasphere config cache init --host https://<tenantname> --authorization-url https://<tenant name> --token-url https://<tenant name>/oauth/token --client-id "<client id>" --client-secret "<client secret>"
  5. After step 4 there will be a window open asking to login to your datasphere tenant
  6. Once you login you can close the window and then start using the command line commands. There is no need for the authorization code moving forward

See Also


Command Line, Oauth, CLI, comand , KBA , DS-DI-CON , Connections , How To


SAP Datasphere 1.0