This guide walks you through setting up Okta from scratch to work with the AWS Cognito Identity Pool for Bedrock access.
- Create Okta Developer Account
- Access Admin Console
- Create OIDC Application
- Create Test Users
- Assign Users to Application
- Collect Required Information
- Test the Setup
- Quota Monitoring Configuration
If you don't have an Okta account:
- Go to https://developer.okta.com/signup/
- Fill out the registration form:
- First Name
- Last Name
- Email (this will be your admin username)
- Country
- Click Sign Up
- Check your email for the activation link
- Click the activation link and set your password
- You'll receive your Okta domain (e.g.,
dev-12345678.okta.com)
Note: Save your Okta domain - you'll need it for the CloudFormation parameters!
- Log in to your Okta organization at
https://your-domain.okta.com - Click Admin in the top right corner to access the Admin Console
- You should see the Dashboard with various menu options on the left
- In the Admin Console, navigate to Applications → Applications
- Click Create App Integration button
- Select:
- Sign-in method: OIDC - OpenID Connect
- Application type: Native Application
- Click Next
Fill in the following settings:
- App integration name:
Amazon Bedrock CLI Access(or your preferred name) - Logo: Optional - you can skip this
Make sure these are checked:
- ✅ Authorization Code
- ✅ Refresh Token
- ✅ Resource Owner Password (optional, for testing)
Add this exact URI:
http://localhost:8400/callback
http://localhost:8400/logout
- Select Allow everyone in your organization to access
- Or select Limit access to selected groups if you want to restrict access
- Click Save
- You'll be taken to the application settings page
After saving, you'll see:
- Client ID: Something like
0oa1234567890abcde - Okta domain: Your domain like
dev-12345678.okta.com
Important: Copy the Client ID - you'll need it for the CloudFormation parameters!
- In the Admin Console, go to Directory → People
- Click Add Person button
Fill in the form:
- First name: Test
- Last name: User
- Username: testuser@example.com (must be email format)
- Primary email: testuser@example.com
- Password: Select Set by admin and enter a password
- ✅ User must change password on first login (optional)
- ❌ Send user activation email now (uncheck for testing)
Click Save
Repeat the process to create more test users:
developer1@example.comdeveloper2@example.com- etc.
- Go to Applications → Applications
- Click on your Amazon Bedrock CLI Access application
- Click the Assignments tab
- Click Assign → Assign to People
- Find your test user(s) in the list
- Click Assign next to each user
- Click Save and Go Back
- Click Done
- Go to Directory → People
- Click on a user (e.g.,
testuser@example.com) - Click the Applications tab
- Click Assign Applications
- Find and select Amazon Bedrock CLI Access
- Click Assign
- Click Save and Go Back
You now have everything needed for the CloudFormation deployment:
| Parameter | Your Value | Example |
|---|---|---|
| OktaDomain | Your Okta domain | dev-12345678.okta.com |
| OktaClientId | Your Client ID | 0oa1234567890abcde |
When running poetry run ccwb init, you'll be prompted for these values:
poetry run ccwb init
# The wizard will ask for:
# - Okta Domain: dev-12345678.okta.com (your domain from above)
# - Client ID: 0oa1234567890abcde (your Client ID from above)
# - AWS Region for infrastructure: us-east-1
# - Bedrock regions: us-east-1,us-west-2
# - Enable monitoring: Yes/NoThe CLI tool will handle all the CloudFormation configuration automatically.
- Go back to your application in Okta
- Click the General tab
- Verify:
- Client authentication: Use PKCE
- Redirect URIs include:
http://localhost:8400/callback - Grant types include: Authorization Code and Refresh Token
- Go to Reports → System Log
- Look for entries like:
- "User single sign on to app"
- "Add user to application membership"
- These should show Success status
- In your application, go to General tab
- Click Edit in the General Settings section
- Under Refresh Token, select:
- Rotate token after every use
- Grace period: 30 seconds (or your preference)
- Click Save
If you want to add department or group information:
- Go to Security → API
- Click on your Authorization Server (usually "default")
- Click Claims tab
- Click Add Claim
- Configure:
- Name:
department - Include in: ID Token, Access Token
- Value type: Expression
- Value:
user.department
- Name:
- Click Create
- Go to Directory → Groups
- Click Add Group
- Name:
bedrock-users - Description:
Users with Amazon Bedrock access - Add users to this group
- Assign the group to your application
If you're using the quota monitoring feature to track and limit user token usage, additional Okta configuration is required.
The quota monitoring API requires these scopes in your JWT tokens:
| Scope | Required? | Purpose |
|---|---|---|
openid |
Yes | Base OIDC scope |
email |
Yes | User email for quota tracking |
profile |
Recommended | User profile information |
groups |
Optional | Group membership for group-based quotas |
Note: The
groupsscope is only needed if you want to use group-based quota policies (e.g., different limits forengineeringvsdata-scienceteams).
- Go to Security → API → Authorization Servers
- Click on your authorization server (usually "default")
- Click the Scopes tab
- Click Add Scope
- Configure:
- Name:
groups - Display phrase:
Access your group memberships - Description:
Allows the app to see your group memberships - User consent:
Implicit
- Name:
- Click Create
To include group membership in JWT tokens:
- Go to Security → API → Authorization Servers
- Click on your authorization server (usually "default")
- Click the Claims tab
- Click Add Claim
- Configure:
- Name:
groups - Include in token type:
ID Token→Always - Value type:
Groups - Filter:
Matches regex→.*(includes all groups) - Include in:
Any scope(or select specific scopes)
- Name:
- Click Create
Token lifetimes affect how often quota checks occur:
- Go to Security → API → Authorization Servers
- Click on your authorization server
- Click the Access Policies tab
- Click on your policy, then edit the rule
- Configure token lifetimes:
- Access token lifetime:
1 hour(default, works well) - ID token lifetime:
1 hour(default) - Refresh token lifetime: As needed for your use case
- Access token lifetime:
Tip: Shorter token lifetimes mean more frequent quota checks but more re-authentication. The defaults work well for most use cases.
If using group-based quotas:
- Go to Directory → Groups
- Click Add Group
- Create groups matching your quota policy needs:
engineering- Engineering teamdata-science- Data science teampower-users- Users with higher limits
- Assign users to appropriate groups
- Assign groups to your Bedrock CLI application
After completing Okta configuration:
# Deploy the quota monitoring stack
poetry run ccwb deploy quota
# Set a default quota for all users (required)
poetry run ccwb quota set-default --monthly-limit 225M
# Optional: Set group-based quotas (requires groups claim)
poetry run ccwb quota set-group engineering --monthly-limit 500M
poetry run ccwb quota set-group data-science --monthly-limit 1B
# Optional: Set user-specific quotas
poetry run ccwb quota set-user power.user@company.com --monthly-limit 500M
# Test the quota API
poetry run ccwb test quota-apiTest that your JWT includes the expected claims:
- Complete an authentication flow with your application
- Decode the ID token at jwt.io
- Verify these claims are present:
email- Your user's email addressgroups- Array of group names (if configured)
For complete quota monitoring documentation, see Quota Monitoring Guide.
- Ensure the redirect URI is exactly:
http://localhost:8400/callback - Check for trailing slashes or typos
- Verify the user is assigned to the application
- Check if the user's account is active
- Ensure password meets Okta's policy requirements
- Go to Applications → Applications
- Click on your application
- The Client ID is on the General tab under "Client Credentials"
Once you've completed this Okta setup:
- Clone the repository:
git clone https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock.git cd claude-code-setup poetry install - Run the setup wizard:
poetry run ccwb init - Create a distribution package:
poetry run ccwb package - Test the deployment:
poetry run ccwb test --api - Distribute the
dist/folder to your users
-
Production Considerations:
- Use groups to manage access at scale
- Enable MFA for all users
- Set appropriate session timeouts
- Monitor the System Log regularly
-
Token Settings:
- Enable refresh token rotation
- Set reasonable token lifetimes
- Use PKCE (enabled by default for native apps)
-
User Management:
- Use Okta's password policies
- Implement account lockout policies
- Regular access reviews
- Dashboard:
https://your-domain.okta.com/admin/dashboard - Applications:
https://your-domain.okta.com/admin/apps/active - Users:
https://your-domain.okta.com/admin/users - System Log:
https://your-domain.okta.com/admin/reports/system_log
Remember to replace your-domain with your actual Okta domain!