Configure Okta to use JWT
JWT with Okta
SnapLogic public APIs support JWT authentication. You can use Okta as your Identity Provider (IdP) as long as:
- The JWT is correctly signed and verifiable via a JWKS endpoint.
- The token contains the required claims (fields inside the JWT).
Here is an example which shows a generated token body with the required claims:
{
"iat": 1746477764,
"exp": 1746481364,
"sub": "[email protected]",
"aud": "https://elastic.snaplogic.com/api/1/rest/public",
"iss": "6255cabfb089cfac8f490573",
"org": "MyEnvironment"
}
iat: Issued-at time (Unix timestamp).exp: Expiration time.sub: The SnapLogic username (user identity).aud: The SnapLogic public API base URL (varies by POD – US, EMEA, UAT, etc.).iss: Issuer ID (configured in SnapLogic).org: SnapLogic org/environment name.
iat and exp values in this example are illustrative only. When generating a real JWT, set iat to the current time and exp to an appropriate expiration time based on your security requirements.Prerequisites
Before configuring Okta for JWT authentication with SnapLogic, ensure the following:
- You have completed the JWT configuration in SnapLogic. Refer to JWT configuration.
- You have administrative access to your Okta Admin console.
- An active user account exists within your organization's identity management system.
- The user account has appropriate permissions to access the API resources.
- Your organization has OAuth or OpenID Connect (OIDC) capabilities enabled.
Custom claims
SnapLogic supports custom claims for scenarios where standard claims cannot be modified in your IdP:
snaplogic_org: Use this if there is a conflict adding theorgclaim.snaplogic_username: Use this if thesubclaim cannot be set to the SnapLogic username.snaplogic_aud: Use this if theaudclaim cannot be modified to match the SnapLogic public API URL.
Okta configuration
Access the Okta Admin console
The Okta Admin console manages JWT authentication settings. Follow these steps to access and navigate the console:
- Navigate to your organization's Okta Admin console URL in your web browser.
- Click the Sign in button on the login page.
- Enter your administrative credentials and click the Sign in button to proceed to the next authentication step.
- When prompted, enter the answer to your configured security question.
- Click the Verify button to complete the authentication process.
Create an OAuth application
- In the Okta Admin console, navigate to .
- Click Create App Integration.
- Select OIDC - OpenID Connect as the sign-in method.
- Select Web Application as the application type.
- Enter your app's details:
- App integration name: Provide a descriptive name (e.g., "SnapLogic JWT Integration").
- Grant types: Select Authorization Code.
- Sign-in redirect URIs: Enter your callback URL (e.g.,
http://localhost:8000/callbackfor testing).
- Click Save.
- Note the Client ID and Client Secret from the application's settings page.
Configure Authorization Server
To add custom claims required by SnapLogic, create or configure a custom authorization server:
- In the Okta Admin console, navigate to .
- Under Authorization Servers, either use the default server or click Add Authorization Server to create a new one.
- If creating a new server:
- Provide a name (e.g., "SnapLogic Auth Server").
- Set the Audience to the SnapLogic public API URL:
https://elastic.snaplogic.com/api/1/rest/public(adjust for your POD: US, EMEA, UAT, etc.).
- Click Save.
Configure custom claims
Add the required SnapLogic claims to your authorization server:
- In your authorization server, navigate to the Claims tab.
- Click Add Claim.
- Add the
org(orsnaplogic_org) claim:- Name:
orgorsnaplogic_org - Include in token type: Select Access Token and ID Token
- Value type: Expression
- Value: Enter your SnapLogic environment name in quotes (e.g.,
"MyEnvironment") - Include in: Any scope
- Name:
- If needed, add the
snaplogic_usernameclaim:- Name:
snaplogic_username - Include in token type: Select Access Token and ID Token
- Value type: Expression
- Value:
user.emailoruser.login(depending on which matches your SnapLogic username) - Include in: Any scope
- Name:
- If
audcannot be modified, add thesnaplogic_audclaim:- Name:
snaplogic_aud - Include in token type: Select Access Token and ID Token
- Value type: Expression
- Value:
"https://elastic.snaplogic.com/api/1/rest/public"(adjust for your POD) - Include in: Any scope
- Name:
- Click Create for each claim.
Configure Access Policies and Scopes
- In your authorization server, navigate to the Access Policies tab.
- Create or modify a policy to allow access for your application.
- Add a rule that grants access to the required scopes (e.g.,
openid,profile,email). - Ensure the rule applies to your client application.
Obtain JWKS endpoint and Issuer ID
Collect the following values from your Okta authorization server to configure in SnapLogic Admin Manager:
- Navigate to your authorization server's settings page.
- Copy the Issuer URL (e.g.,
https://your-domain.okta.com/oauth2/default). - The JWKS endpoint URL is the issuer URL with
/v1/keysappended (e.g.,https://your-domain.okta.com/oauth2/default/v1/keys).
Use these values to configure JWT authentication in SnapLogic Admin Manager. Refer to JWT configuration for detailed steps.
Obtain the Authorization code
- In your Okta application settings, locate the authorization URL.
- Click the authorization URL link to initiate the OAuth flow.
- The system redirects you to an authorization page and generates a code in the URL.
- Copy the authorization code from the URL in your browser's address bar - this code appears as a parameter after
code=.
Test the JWT token
- Authentication: Send a POST request with the authorization code to the token endpoint to obtain a JWT:
POST https://your-domain.okta.com/oauth2/default/v1/token Content-Type: application/x-www-form-urlencoded grant_type=authorization_code& code=<authorization_code>& redirect_uri=<your_redirect_uri>& client_id=<your_client_id>& client_secret=<your_client_secret> - The response includes an
access_tokenandid_token. Use theid_tokenas your Bearer token. - Verify the token contains all required claims:
iss,sub,aud,exp,iatorg(orsnaplogic_org)snaplogic_username(ifsubdoesn't match SnapLogic username)snaplogic_aud(ifauddoesn't match SnapLogic API URL)
- Use the JWT for subsequent requests:
GET https://elastic.snaplogic.com/api/1/rest/public/... Authorization: Bearer <id_token> - Test your endpoints by sending requests with the JWT in the
Authorizationheader using a tool like Postman or curl.
Expected response: A successful response includes a 200 OK status code.
Troubleshooting
If JWT authentication fails, refer to JWT troubleshooting for common issues and solutions.