Skip to content

Admin Token API: Reset OAuth Application Secrets

What does this MR do and why?

This MR adds support for resetting OAuth Application secrets.

🛠️ with ❤️ at Siemens

References

MR acceptance checklist

MR Checklist ( @nwittstruck)

How to set up and validate locally

  1. Enable the feature flag with rails c:
Feature.enable(:api_admin_token_revoke)
  1. You'll need to create two new tokens:

    1. A personal access token with admin_mode and api capabilities at: Preferences > Access tokens > Add new token
    2. An OAuth instance application at Admin area > Applications > Add new application that you can query.
  2. Now you can retrieve information about this token:

curl -k --request POST \
--url 'https://gdk.test:3443/api/v4/admin/token' \
--header 'Authorization: Bearer <Admin Token from Step 2.>' \
--header 'Content-Type: application/json' \
--data '{"token": "gloas-token-from-step-2-2"}'
  1. Now, revoke the token:
curl -k --request DELETE \
--url 'https://gdk.test:3443/api/v4/admin/token \       
--header 'Authorization: Bearer <Admin Token from Step 1.>' \
--header 'Content-Type: application/json' \
--data '{"token": "gloas-token-from-step-2-2"}'
  1. Query the token again - you should now see that the status changed to Not Found, as the secret has changed.

Related to #514909 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading