Reputation: 346
Why do we need to pass grant type from client application when using oauth protocol?.
Sometimes, when I use wrong grant type, it says that incorrect grant type, so if I can pass only the supported value, then passing this value is redundant. The server can simply pick the supported one. The client application shouldn't have to pass it.
If more than one grant types are available for client application to pass, then can't the client simply pass the least restrictive grant type?. Why should the client care about what is the most appropriate grant type. Does the client have to comply with some standards or legal issues?.
Upvotes: 2
Views: 697
Reputation: 117281
Grant types are part of the Oauth2 specification rfc6749 it is intended for use in telling the authorization server which type of authorization you are intending to use. Each grant type is intended for a different use case.
Asking the authorization to guess which type of authorization you want to use would IMO be a big security risk. Its better for the developer in question to out right tell the authorization server which grant type they are trying to use. This way the authorization server can then validate that what you are doing is correct.
Upvotes: 3