Skip to content

OAuth2 "password" grant type #27

Closed

Description

@vadrem

Hello,
I would like to know does this project support the ability to use "password" grant type?
By default is "client_credentials" is used oauth2.authorization-grant-type=client_credentials.
If yes, then where (how) can I to set username and password for token request?

Activity

  1. oliemansm commented on Apr 14, 2021

    @oliemansm
    Member

    Password grant type is not something you'd use for a backend integration. That's what you would use when you have an actual user trying to login with username and password. So you also wouldn't have that username and password as properties, but instead would have some kind of UI where the user would enter those.

  2. vadrem commented on Apr 14, 2021

    @vadrem
    Author

    i assumed my one BE service 1 is a client for another BE service 2 (resource server on graphql-java-kickstart/graphql-spring-boot). Accordingly, service 1 keeps in itself username and password, and could receive token without UI.
    For example: https://docs.spring.io/spring-security/site/docs/current/reference/html5/#using-the-access-token-2

    ok

    Another question. If I create a custom (my) WebClient , then your GraphQLWebClient will use my WebClient or yours WebClient created by this starter,
    Sorry if the question is asked awkwardly

  3. oliemansm commented on Apr 14, 2021

    @oliemansm
    Member

    You're first paragraph is correct, that is how it works. But that's the client credentials grant you're describing here. But instead of username and password it's using the client id and secret in a similar way. Make sure to read up on the various available grants and usages instead of asking that kind of details here. The https://auth0.com site has nice documentation about the various flows.

    Regarding your other question. As you can see in the autoconfiguration class it'll create a WebClient instance in case it's missing. So if you're already providing a WebClient bean, then it'll use that one. That's normal Spring Boot convention. See:

    .

  4. vadrem commented on Apr 14, 2021

    @vadrem
    Author

    Thanks for your answers

  5. locked and limited conversation to collaborators on Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions