From f15bee03b8716ae1a28bd955357cdb760fb0d24a Mon Sep 17 00:00:00 2001 From: Yannick Heinrich Date: Fri, 2 Dec 2016 13:43:46 +0100 Subject: [PATCH] Add app_metadata property to the token. Update the instanciation of the inputs according to the documentation. Add the possibility to create app_metadata within the token. --- Auth0Token.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Auth0Token.js b/Auth0Token.js index e236338..eff426f 100644 --- a/Auth0Token.js +++ b/Auth0Token.js @@ -19,6 +19,9 @@ var Auth0Token = function() { 'iat': now }; + if(JSON.stringify(this.appMetadata) !== '{}') { + bodyInput.app_metadata = this.appMetadata; + } return 'Bearer ' + jsrassign.jws.JWS.sign(null, headerInput, bodyInput, {b64: jsrassign.b64utob64(this.clientSecret)}); } } @@ -33,11 +36,12 @@ Auth0Token.title = "Auth0 Authorization Token"; Auth0Token.help = "https://github.com/LordZardeck/PAW-Auth0TokenDynamicValue"; Auth0Token.inputs = [ - DynamicValueInput("issuer", "Issuer", "String"), - DynamicValueInput("userId", "User Id", "String"), - DynamicValueInput("email", "User Email", "String"), - DynamicValueInput("clientId", "Client ID", "String"), - DynamicValueInput("clientSecret", "Client Secret", "SecureValue") + InputField("issuer", "Issuer", "String"), + InputField("userId", "User Id", "String"), + InputField("email", "User Email", "String"), + InputField("clientId", "Client ID", "String"), + InputField("clientSecret", "Client Secret", "SecureValue"), + InputField("appMetadata", "App Metadata", "JSON", {defaultValue: '{}'}) ] registerDynamicValueClass(Auth0Token);