Currently Insomnia only has support for customizing the scope parameter for OAuth 2 authentication (under "Advanced Options"). It would be useful to also have support for other OAuth 2 parameters, resource in particular.
Microsoft Azure's Active Directory OAuth 2 requires the use of the resource parameter for service-to-service access: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-service-to-service#request-an-access-token.
I attempted to work around this by manually appending a resource query parameter (e.g. https://login.microsoftonline.com/{{azure.tenant_id}}/oauth2/token?resource=https%3A%2F%2Fmanagement.core.windows.net%2F), however, this does not seem to work. As an alternative, Insomnia could support merging those parameters instead of overwriting them. It could be argued that overwriting the parameters is actually in violation of RFC 6749:
The endpoint URI MAY include an "application/x-www-form-urlencoded"
formatted (per Appendix B) query component ([RFC3986] Section 3.4),
which MUST be retained when adding additional query parameters. The
endpoint URI MUST NOT include a fragment component.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
As mentioned on Slack, I'll upon this back up 馃憤
It shouldn't be too hard for someone who wants to pick it up. Here's a very similar PR for reference https://github.com/getinsomnia/insomnia/pull/1009
I started this work and have created a pull request (#1174) with the changes.
Most helpful comment
As mentioned on Slack, I'll upon this back up 馃憤
It shouldn't be too hard for someone who wants to pick it up. Here's a very similar PR for reference https://github.com/getinsomnia/insomnia/pull/1009