This feature requires the Enterprise plan.
Prerequisites
- An Okta organization (e.g.
https://your-org.okta.com) - Admin access to create applications
- external_url
Setup
1. Create an Application in Okta
- Open your Okta admin console
- Go to Applications > Create App Integration
- Select OIDC - OpenID Connect as the sign-in method
- Select Web Application as the application type
- Click Next
- Configure the application:
- App integration name:
pgconsole(or your preferred name) - Grant type:
Authorization Code(default) - Sign-in redirect URIs:
- Sign-out redirect URIs: leave blank
- App integration name:
- Under Assignments, control who can access pgconsole:
- Limit access to selected groups - Only assigned users/groups can sign in. Select the groups that should have access.
- Skip group assignment for now - Enables Federation Broker Mode. When no users or groups are assigned, Okta allows any user who can authenticate (including users from federated Identity Providers) to access the application.
- Click Save
2. Get Client Credentials
- On the application’s General tab, find the Client Credentials section
- Copy the Client ID and Client secret
3. Get Issuer URL
Most setups use the default custom authorization server:- Org authorization server:
https://your-org.okta.com - Named custom authorization server:
https://your-org.okta.com/oauth2/<server-id>
4. Configure pgconsole
Add the Okta provider to yourpgconsole.toml:
pgconsole.toml
5. Restart pgconsole
Restart the application for changes to take effect. A “Continue with Okta” button will appear on the login page.Troubleshooting
You are not allowed to access this app
This error appears when a user tries to sign in. It comes from Okta before any token is issued. Two layers of Okta policies can cause it: Application Authentication Policy — Controls who can sign in to the application.- Go to Applications > select your app > Sign On tab
- Click the linked authentication policy name
- Check the policy rules — the user must match at least one rule that allows access
- To grant access, add the user/group to an existing Allow rule, or create a new rule with the action set to Allowed
/oauth2/default).
The default custom authorization server ships with a default policy and rule that allows all clients, the Authorization Code grant, and all scopes. No changes are needed unless your organization has modified these defaults.
If the defaults have been restricted:
- Go to Security > API > select your authorization server > Access Policies tab
- Verify at least one rule allows your pgconsole app with the
Authorization Codegrant type andopenid,email,profilescopes