-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add option in OAuthCred to load authUrlV2. #3777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e74b6fa to
4af9b2c
Compare
| { | ||
| credData = migratedCred; | ||
|
|
||
| // Re-write .credentials with Token URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the code left when we finish SPS->Token migration.
We still want to keep .credentials and .credentials_migrated for a while in this case.
| var migratedCred = store.GetMigratedCredentials(); | ||
| if (migratedCred != null) | ||
| if (migratedCred != null && | ||
| migratedCred.Scheme == Constants.Configuration.OAuth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hosted runner will have different auth schema.
| } | ||
|
|
||
| // make sure the credential authorizationUrl in the refreshed config match the current credential authorizationUrl for OAuth auth scheme | ||
| var authorizationUrl = _credData.Data.GetValueOrDefault("authorizationUrl", null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will make sure the .credentials_migrated is identical with .credentials for us to safely fallback.
4af9b2c to
231f9e1
Compare
Here is the normally flow we auth with service today:
.credentialsfile to create aVssCredentialobjectVssCredentialtoConnectAsyncfor different server, ex: RunnerServer, BrokerServer, RunServer, ActionsRunServer, etc.The service will send down a newer version of the
.credentialsconfig that looks like the following:I am changing the runner.listener to realize there might be 2 types of
VssCredential, one created withauthorizationUrl, another created withauthorizationUrlV2.Different
VssCredentialwill be used forConnectAsyncfor different server.authorizationUrlauthorizationUrlauthorizationUrlV2authorizationUrlV2This PR is not making real change of using
authorizationUrlV2, since we passallowAuthUrlV2: falsein all the places we createVssCredentialviaVssCredentials GetVssCredentials(IHostContext context, bool allowAuthUrlV2);https://github.com/github/actions-runner-admin/issues/1656