You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# API Gateway authorizer function context var example
50
+
# How to use this asset?
46
51
47
52
## Build and deploy the functions
48
53
@@ -59,23 +64,23 @@ fdk.handle(function(input){
59
64
"principal": "myprincipal",
60
65
"scope": ["fnsimplejs"],
61
66
"clientId": "clientIdFromHeader",
62
-
"expiresAt": "2023-12-31T00:00:00+00:00",
67
+
"expiresAt": "2025-12-31T00:00:00+00:00",
63
68
"context": {
64
69
"username": input.token
65
70
}
66
71
}
67
72
} else {
68
73
json = {
69
74
"active": false,
70
-
"expiresAt": "2023-12-31T00:00:00+00:00",
75
+
"expiresAt": "2025-12-31T00:00:00+00:00",
71
76
"wwwAuthenticate": "Bearer realm=\"www.com\""
72
77
}
73
78
}
74
79
return json;
75
80
})
76
81
</pre>
77
82
78
-
The authorizer function will pass on the <code>username</code> in <code>auth context</code> as a custom variable. The value for it is set from REST call input as <code>token</code> on the <ahref="fnauthjs/func.js#L52">line 52</a>.
83
+
The authorizer function will pass on the <code>username</code> in <code>auth context</code> as a custom variable. The value for it is set from REST call input as <code>token</code> on the <ahref="files/fnauthjs/func.js#L52">line 52</a>.
0 commit comments