You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The extension module golang.org/x/oauth2 is often supported by API client implementations to supply credentials to an API endpoint.
In particular, the Go code generator of openapi-generator supports this.
Describe the solution you'd like
It would be very nice if a confidential.Client would implement the oauth2.TokenSource interface, so it can be used to generate tokens on demand. Automatic token refresh on expiry can then be trivially supported by calling oauth2.ReuseTokenSource.
Describe alternatives you've considered
It's not difficult to write a TokenSource wrapping a confidential.Client, but something provided by MSAL would be nice.
Hi @onitake, MSAL Go API is usually standard across MSALs. So on first look, this seems a little difficult to add. I'll be able to take a closer look at this next week and update you here.
Is your feature request related to a problem? Please describe.
The extension module golang.org/x/oauth2 is often supported by API client implementations to supply credentials to an API endpoint.
In particular, the Go code generator of openapi-generator supports this.
Describe the solution you'd like
It would be very nice if a confidential.Client would implement the oauth2.TokenSource interface, so it can be used to generate tokens on demand. Automatic token refresh on expiry can then be trivially supported by calling oauth2.ReuseTokenSource.
Describe alternatives you've considered
It's not difficult to write a TokenSource wrapping a confidential.Client, but something provided by MSAL would be nice.
Example:
Additional context
Usage with API clients generated by openapi-generator 5.x:
The text was updated successfully, but these errors were encountered: