Token prefixes: Add support for SCIM tokens

What does this MR do and why?

Token prefixes: Add support for SCIM tokens

Adds support for instance wide token prefixes for SCIM tokens, which have been added initially with !179852 (merged)

SCIM tokens now use the instance wide token prefixes, when they are configured. The new token format is <instance>-glsoat-token.

This feature is still behind the feature flag custom_prefix_for_all_token_types

With this custom prefix, it is easier to identify leaked tokens, because we can now skip all leaked tokens that start with gl. Now, we only need to look at tokens starting with my-company-name-.

🛠️ with ❤️ at Siemens

References

Screenshots or screen recordings

scim-1 scim-2 scim-before

How to set up and validate locally

  1. Enable feature flag via rails c:
Feature.enable(:custom_prefix_for_all_token_types)
  1. Follow the great instructions on how to test the existing prefix for SCIM tokens.
  2. Change the instance wide token prefix: Admin area > General > Account and limit > Instance token prefix, e.g. to mycustomprefix
  3. You can now see the new instance wide prefix being applied when generating new SCIM tokens for groups or for the instance.
  4. You can now either toggle the feature flag or (un-)set the instance wide token prefix. Existing tokens should continue to work, as well as new tokens that contain the prefix.

MR acceptance checklist

checklist

Related to #388379

Edited by Nicholas Wittstruck

Merge request reports

Loading