intercom / intercom-go

Go Bindings For Intercom
https://developers.intercom.io/reference
Other
71 stars 80 forks source link

Allow for access token based authorization header #68

Closed JonHMChan closed 7 years ago

JonHMChan commented 7 years ago

The README currently states that you can use the second field in NewClient with just an access token. However, the client interface here still only supports basic HTTP authentication instead of setting an Authorization : Bearer $ACCESS_TOKEN header on all requests. This fix allows for HTTP authentication with just an access token.

choran commented 7 years ago

Hi @JonHMChan, Thanks for submitting this. One thing we wanted to do with our updates to the bearer token was to make it backward compatible so that if there were users out there with very old but technically still valid API keys they could still use basic auth. For example, in the ruby SDK we allow the same method to be used to send in api key and app id or just the access token itself. Similarly here we would like to maybe create a new function NewClientWithToken for example that takes just one arg and would call the bearer auth header with the access token but then people could still use the original NewClient func if they still had an active API key. Does that make sense? Thanks again Cathal

choran commented 7 years ago

Hi @JonHMChan Just to follow up here, thanks for submitting this but I will close it for now. Like I said, this is something we want to get to too, i.e. create a new function that could be used with the bearer token and then leave this function available for people who still use the API keys (there are still a small number of customers with older api keys that are still valid) Not sure when we will get to it but its on our list, in the meantime if you want to update this as noted above then please do and I will review it asap but I understand if you are not able to update it. Thanks again Cathal