This looks like what I need.

Thanks Chris.

On Tuesday, February 11, 2020 at 7:45:56 PM UTC-5, Chris Broadfoot wrote:
>
> Try this package:
> https://pkg.go.dev/golang.org/x/oauth2/clientcredentials?tab=doc
>
> On Tue, Feb 11, 2020, 4:43 PM andrey mirtchovski <mirtc...@gmail.com 
> <javascript:>> wrote:
>
>> i would strongly advise against implementing advice received online
>> for something as important as auth. my suggestion is to work with curl
>> from the command line (examples are given on the webpage you linked)
>> until you have the process working. implementing that afterwards using
>> http.Client will be more or less trivial.
>>
>> that said, you may be missing a call to SetBasicAuth with the client
>> id and secret, or sourcing a JWT beforehand from /oauth/token
>>
>> On Tue, Feb 11, 2020 at 4:56 PM tmack8080 <terry....@gmail.com 
>> <javascript:>> wrote:
>> >
>> > Hi,
>> >
>> >
>> >
>> > I'm not a programmer.
>> >
>> > I have this working in PowerShell.
>> >
>> >
>> >
>> > Requirement:
>> >
>> > Query hardware vendor web APIs, using the device serial number, for 
>> device warranty status.
>> >
>> >
>> >
>> > The vendors require that the "client_id" and "client_secret", as well 
>> as the "grant_type=client_credentials" be passed.
>> >
>> >
>> >
>> > All of the documentation I've located discusses using Oauth for 3rd 
>> party authentication. Obviously, not what I'm doing. Can anyone point me to 
>> a tutorial that uses "client_credentials"? I've not found one.
>> >
>> >
>> >
>> > I tried using the example on the authO website; no luck: 
>> https://auth0.com/docs/api-auth/tutorials/client-credentials (you have 
>> select Go from the list of languages). When printing out the 'payload' 
>> variable I see it appended with a {0 -1} and I'm wondering if that's the 
>> problem:
>> >
>> >
>> > 
>> &{client_id=xxxxxxxxxx&client_secret=xxxxxxxxxx&grant_type=client_credentials
>>  
>> 0 -1}
>> >
>> > {
>> >
>> >   "error":"invalid_request",
>> >
>> >   "error_description":"Missing or duplicate parameters"
>> >
>> > }
>> >
>> >
>> >
>> > Thanks in advance.
>> >
>> > --
>> > You received this message because you are subscribed to the Google 
>> Groups "golang-nuts" group.
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an email to golan...@googlegroups.com <javascript:>.
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/64214d0a-1191-4f46-8bfd-2c716cdb2d3f%40googlegroups.com
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golan...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/CAK4xykVkQEspkzQ0D0wuZrznM4P1Mtt1KNXnobR9GZypxbUtrQ%40mail.gmail.com
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/faeb2e61-8d74-49f3-a393-45e9e5fe016a%40googlegroups.com.

Reply via email to