Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Accessing scopes from Javascript

I have a product configured with three scopes as a comma separated list - s1,s2,s3. After the VerifyApiKey policy is executed, I call a javascript policy in which I use...

scopes = context.getVariable("verifyapikey.VerifyApiKey.ValidateClientId.app.scopes");

... however I can see in the trace I am returned...

verifyapikey.VerifyApiKey.ValidateClientId.app.scopes : [Ljava.lang.String;@25af067c

Is it possible to access the list of scopes from a javascript policy?

Thanks, Sean

Solved Solved
0 4 570
1 ACCEPTED SOLUTION

The suggestion here: http://stackoverflow.com/questions/23663591/cant-c... no longer works.

Instead I have generated a dummy access token, in order to retrieve the scopes in the generated response.

View solution in original post

4 REPLIES 4