MGMT-20908: Add support for the OAuth authorization code flow#3
MGMT-20908: Add support for the OAuth authorization code flow#3jhernand wants to merge 1 commit intoopenshift-assisted:masterfrom
Conversation
Currently the server requires the offine token in the `OFFLINE_TOKEN` environment variable, or in a request header. But use of offline tokens is deprected, and will be removed in the future. To avoid using them this patch adds an optional mechanism to use the OAuth authorization code flow, intended for use when the server is executed locally by the user. When the server starts it checks if the `USE_AUTHORIZATION_CODE_FLOW` environment variable is set to `true`. If it is then the authorization URL will be opened with the local browser, so that the user can provide the credentials. Then the authorization server will send the authorization code to the `/oauth/callback` endpoint, and the MCP sever will exchange that code for the refresh and access tokens. The refresh token is then used as it was the offline token. Related: https://issues.redhat.com/browse/MGMT-20908 Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
|
@jhernand: This pull request references MGMT-20908 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jhernand The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @jhernand! It looks like this is your first PR to openshift-assisted/assisted-service-mcp 🎉 |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Replaced by #5 . |
Currently the server requires the offine token in the
OFFLINE_TOKENenvironment variable, or in a request header. But use of offline tokens is deprected, and will be removed in the future. To avoid using them this patch adds an optional mechanism to use the OAuth authorization code flow, intended for use when the server is executed locally by the user. When the server starts it checks if theUSE_AUTHORIZATION_CODE_FLOWenvironment variable is set totrue. If it is then the authorization URL will be opened with the local browser, so that the user can provide the credentials. Then the authorization server will send the authorization code to the/oauth/callbackendpoint, and the MCP sever will exchange that code for the refresh and access tokens. The refresh token is then used as it was the offline token.Related: https://issues.redhat.com/browse/MGMT-20908