Skip to content
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

OCM-4962 | Feat | Add OAuth login using PKCE #590

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

tirthct
Copy link
Contributor

@tirthct tirthct commented Jan 10, 2024

Changed

  • Added flag oauth-login (hidden for now)
  • Called sdk method to verify auth and get token

Tested

  • oauth-login should redirect user to Red Hat SSO : tested
  • Token should work as expected : tested

go.mod Outdated Show resolved Hide resolved
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
@tirthct tirthct marked this pull request as ready for review January 17, 2024 18:29
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
cmd/ocm/login/cmd.go Outdated Show resolved Hide resolved
@tylercreller
Copy link
Member

LGTM - let's plan to merge early next week

go.mod Outdated Show resolved Hide resolved
@cristianoveiga
Copy link
Contributor

@tirthct is this something that we can test? There are a few tests already for the login command under login_test.go

@tirthct
Copy link
Contributor Author

tirthct commented Jan 25, 2024

@tirthct is this something that we can test? There are a few tests already for the login command under login_test.go

Since oauth code flow requires user interaction (successful login in Red Hat sso) to get the token, we cannot generate an automated test here. However, we have tested the functionality in ocm-sdk as an example here : https://github.com/openshift-online/ocm-sdk-go/blob/main/examples/verify_authentication.go

@cristianoveiga
Copy link
Contributor

LGTM

@cristianoveiga cristianoveiga merged commit ea1c988 into openshift-online:main Jan 25, 2024
4 checks passed
@tirthct tirthct deleted the ocm-4962 branch January 25, 2024 20:32
tylercreller added a commit to tylercreller/ocm-cli that referenced this pull request Feb 6, 2024
* OCM-4962 | Feat | Add OAuth login using PKCE (openshift-online#590)

* OCM-5759 | feat: Add Device Code Flow (openshift-online#591)

* OCM-5281 | Feat | Add region validation from ocm-shards and list regions command (openshift-online#586)

* Add region validation from ocm-shards and list regions command

* Fixed mior debug changes

* Marked rh region list flag hidden in cmd

* Formatting change in example section in cmd file

* OCM-4964: Secure store config

* OCM-4964: Go mod tidy

* OCM-4964: go mod tidy

* OCM-4964: Secure store updates

* OCM-4965: Use keyring for oauth flows

* Temp: modify pub/release for testing

* Add auth method password

* Missed auth method test

---------

Co-authored-by: tirthct <tithakka@redhat.com>
@tylercreller tylercreller mentioned this pull request Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants