Resolution
Ensure the Octopus Users security token from the external authentication provider includes the correct groups/roles which are mapped to the Octopus Team. The Octopus user who is not mapped to the correct teams must re-logon to Octopus for any Octopus Teams to be added/removed.
Symptom
The Octopus user wont have the correct Octopus permissions as they are not associated with the correct Octopus Team. Administrators may not see the user mapped to the correct team unless the user logs in post external authentication provider group/role add. The exact same thing can happen on an external authentication provider group/role removal, the removal in the Octopus Team will not take affect until that user logs into Octopus again.
Scope: when this is the right article
- This article is written for an Octopus administrator or a user with permissions to add an Octopus user to an Octopus team.
- After adding the Octopus user to a group/role in the external authentication provider, the Octopus user is not part of the correct Octopus Team when they logon using the external authentication provider.
- The Octopus user has been added to a group/role in the external authentication provider but is not showing up in the Octopus Team yet on the Configuration > Teams > TeamName page using the 'Show all members' button.
Cause
The Octopus user's security token may not include the mapped Octopus Team group/role or the user may not have logged in yet for the new security token permissions to have been applied in Octopus.
Diagnosis and fix
Ensure the Octopus user has been added to the correct group/role in the external authentication provider. They must then logout of Octopus (if they are already logged in) and log back in again using the authentication providers relevant button in Octopus. They should then be mapped to the correct Octopus Team.
If the re-logon does not work the user must check their security token for the external authentication provider groups/roles and ensure the one mapped to the Octopus Team is present in the security token.
To do this the Octopus administrator must:
- For both Okta and EntraID you need to remove the Client Secret in Octopus before performing the actions below. It’s impossible to inspect the JWT within the Network tab of your browser’s developer tools (the ID_Token field in Step 2) if you use OAuth code flow with PKCE (with a Client Secret specified in your Okta/EntraID configuration in Octopus). An Octopus administrator would need to remove the Client Secret, which would revert to Implicit flow authentication. The Octopus administrator can re-enter the Client Secret back into Octopus when they have finished the user permissions troubleshooting.
From here the Octopus user needs to:
-
Open your browser’s Developer Tools and enable Network logging, making sure the network logging is preserved across requests. In Chrome Dev Tools, this is called “Preserve Log”.
-
Attempt to sign into Octopus using the external authentication provider and find the HTTP POST coming back to your Octopus instance from that provider on a route like /api/users/authenticatedToken/"provider-name">. You should see an id_token field in the HTTP POST body.
- Grab the contents of the id_token field and paste that into the JWT IO website, which will decode the token for you. You should then see the groups/roles that the security token includes. These are the groups/roles that should be mapped to the relevant Octopus Teams.
Verify
The Octopus user needs to logon to Octopus again after verifying they have the right groups/roles in the security token and those groups/roles have been mapped to the correct Team in Octopus.
Related
- Octopus Authentication Main Page - Octopus Authentication Main Page
- Security Token roles Guide EntraID - Security Token roles Guide for EntraID
- Security Token group Guide Okta - Security Token group Guide for Okta