unchase / Unchase.Odata.Connectedservice

:scroll: A Visual Studio extension for connecting to OData services with generating client-side C# proxy-classes
Apache License 2.0
44 stars 13 forks source link

Add oauth2.0 support #57

Closed lianying closed 2 years ago

lianying commented 3 years ago

Please add oauth2.0 support

unchase commented 3 years ago

Hi, @lianying Can you describe what do you mean? And how should it look like?

axellejamous commented 3 years ago

For me this would be useful too. I currently have an oData endpoint I'd like to consume, however the only available authentication option is through client_credentials. Their basic authentication doesn't work as the endpoint hasn't been made public. I don't know how one would implement this into the extension, though since OAuth2.0 would require you to first make another call to retrieve an authentication header from https://login.microsoftonline.com/ + tenantId.

ChrisSchaller commented 3 years ago

As authentication is outside of the OData specification, the guidance around authentication is simply to manage authentication itself outside of the OData request pipeline, and to implement an OnMessageCreating function to interact with the transport layer and inject any headers or cookies that may be required.

unchase commented 3 years ago

In this case, customization in the connected service is not advisable.