I’ve created a Golang library for JWT authentication for add-ons here: atlassian-jwt. I have it working for READ, WRITE, etc scopes but for ACT_AS_USER, the docs say I need oauth2 support.
I’ve included the ACT_AS_USER scope in my atlassian-connect.json file but when the “installed” hook fires, I receive the same fields that I had before: key, clientKey, publicKey, sharedSecret, serverVersion, pluginsVersion, baseUrl, productType, description, eventType.
That certainly does seem odd. Would you post the relevant portion of your atlassian-connect.json file, and also the JSON structure that is posted to your installed end-point?
I’ve included the code below. You can see I ask for ACT_AS_USER and READ scopes. The only thing I can think of is that I’m only including webhook modules. Maybe the JIRA API understands enough to know that they don’t need ACT_AS_USER support so it doesn’t return the appropriate values for that? That seems a little far fetched but it’s the only explanation I have. If that is, indeed, a possibility, I can’t find modules that require ACT_AS_USER scope. Do you know of any I could use to test this hypothesis? Can you see anything else wrong with my requests?
Holy crap, I’m an idiot. I was copying the JSON into a struct and inspecting it because of my previous work on just the JWT. The struct didn’t include oauthClientID so when I marshalled the data, it just dropped it. It’s been there all along, I just wasn’t looking at the raw JSON.