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

Allow client:auth to force client_credential grant #245

Open
hnestmann opened this issue Aug 12, 2021 · 5 comments · May be fixed by #499
Open

Allow client:auth to force client_credential grant #245

hnestmann opened this issue Aug 12, 2021 · 5 comments · May be fixed by #499
Labels
api-change Change that will most likely break existing APIs and may be rolled out into a new major version enhancement New feature or request
Milestone

Comments

@hnestmann
Copy link
Collaborator

If dw.json is filled with user name and password. SFCC-CI will add "grant_type":"password" to the auth. This auth doesn't work sometimes, forcing the user to client up dw.json

@hnestmann hnestmann added the enhancement New feature or request label Aug 12, 2021
@hnestmann
Copy link
Collaborator Author

sfcc client:auth aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --type client_credentials

@tobiaslohr
Copy link
Contributor

Thanks for raising @hnestmann! There are two options I see:

  • Change the behaviour of command sfcc client:auth to only accept explicit arguments passed in case you have at least some arguments passed already. In your case, if you are passing client id and secret explicitly it will not read user creds from another source, like from the dw.json but expects them as being passed explicitly as well
  • Change command sfcc client:auth and only allow client_credential grant, but not resource_owner_password_credentials grant anymore. Reason being is, that with the Sandbox API now supporting client_credentials grant fully for automation use cases, I don't see any other use case left, which requires resource_owner_password_credentials anymore. Note, we would still allow a user to authenticate interactively using sfcc-ci auth:login

In any case, both options above are breaking changes and would have to walk into a new major version.

Thoughts?

@lisunovdv
Copy link
Contributor

Adding --type client_credentials option for sfcc client:auth (as @hnestmann mentioned) maybe the best solution...

@tobiaslohr tobiaslohr added the api-change Change that will most likely break existing APIs and may be rolled out into a new major version label Aug 31, 2021
@tobiaslohr tobiaslohr added this to the 3.0.x milestone Aug 31, 2021
@DenyVeyten
Copy link

+1 for resolving this issue, in our use case during local development we use JS API scripts whenever possible, but instance:export is not supported (another enhancement to report 😄), so we have to use client:auth that inevitably uses user from dw.json.
@tobiaslohr could you consider backward compatible change like the additional flag mentioned, to release it for 2.x version?

@jlbruno
Copy link
Member

jlbruno commented Aug 23, 2023

Can we get one of these fixes merged?
This has been open for two years, and it's completely broken when trying to use client:auth if the password in your dw.json is an access key instead of your account manager password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Change that will most likely break existing APIs and may be rolled out into a new major version enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants