ONTAP Rest API Discussions

Need help on example access token generation for SnapDiff API v3

jamesNJ
1,619 Views

Hello all,

We are just starting an effort to convert some code to SnapDiff v3 and REST.

We've received the SnapDiff v3 documentation, and also an activation key from our Netapp partner manager.

We are having trouble getting a basic example working from the documentation. I think we either have a bad key, or maybe doing something wrong with the initial access-token submission.  We are following the directions in section 3 of the doc, attempting to use the REST API /api/cluster/licensing/access-tokens.  I am issuing something similar to this:

 

curl -ku name:password -X POST \
"https://1.2.3.4/api/cluster/licensing/access_tokens?return_timeout=0" \
-H "accept:application/json" \
-d '{"grant_type":"client_credentials","client_id":"software","client_secret":"<base64encoded value>"}'

 

The <base64encoded value> I'm using was the "Signature" JSON field of the key file supplied to us.

 

I get back a rather nebulous message:

{
"error": {
"message": "Internal error. Failed to create access token.",
"code": "1115544"
}

 

Any thoughts on what might be going wrong ... or am I using an incorrect value for the client_secret?

 

Thanks

1 ACCEPTED SOLUTION

jamesNJ
1,558 Views

We had bee struggling on this for more than week ... turned out the key generation was bad. I got a new key this morning, and the example code works.

 

Thanks for the response, I appreciate it.

View solution in original post

2 REPLIES 2

AlexDawson
1,592 Views

Hi there, this is not my area, but I did some digging. It looks like for the client_secret, it is the specification of the client details and the signature, encoded into base64.

 

Decoded it will begin something like:
{"statusResp":{"contract_id":"123456","isv_long_name":"test 

 

So try encoding the entire JSON file with base64 and using that.

 

Let me know how it goes.

jamesNJ
1,559 Views

We had bee struggling on this for more than week ... turned out the key generation was bad. I got a new key this morning, and the example code works.

 

Thanks for the response, I appreciate it.

Public