SDITools / adobeanalyticsr

R Client for Adobe Analytics API v2.0
Other
18 stars 9 forks source link

File-based JWT authentication #121

Closed charlie-gallagher closed 2 years ago

charlie-gallagher commented 2 years ago

Hey @benrwoodard I took a couple minutes to convert JWT authentication from the crude environment variable approach (all my fault...) to this much nicer file-based approach. It functions the same as with googleanalyticsr, like we discussed.

IMPORTANT: I wasn't the one who downloaded/generated our json file containing our authentication info -- I just inherited it. Do you know if it's possible to download the credentials, or do we need to clarify how to format the JSON file as well?

Example:

devtools::load_all(".")

aw_auth("jwt", file = "path/to/authfile.json")

Checklist:

charlie-gallagher commented 2 years ago

For what it's worth, I include a description of the JSON file fields in ?aw_auth

benrwoodard commented 2 years ago

Regarding the json file format that is downloaded from inside the developer.adobe console: The json file is downloaded and looks like this -->

image

Preferably we would not require the end-user to edit this file in any way and simply make another argument that would identify where the private.key file is located.

charlie-gallagher commented 2 years ago

Perfect, thank you! I'll use this as the reference

charlie-gallagher commented 2 years ago

@benrwoodard is API_KEY the same as CLIENT_ID? I don't see CLIENT_ID in the json

benrwoodard commented 2 years ago

Yes

charlie-gallagher commented 2 years ago

I changed things around slightly:

benrwoodard commented 2 years ago

@charlie-gallagher One quick question. I have a situation right now where the client will not give me the JSON file but has given me all the variables needed. Have you already described a way of manually creating the JSON file for auth?