forked from zendesk/zendesk_jwt_sso_examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassic_asp_jwt.asp
More file actions
26 lines (19 loc) · 780 Bytes
/
Copy pathclassic_asp_jwt.asp
File metadata and controls
26 lines (19 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!--Get the JWT implementation from https://github.com/zendesk/classic_asp_jwt -->
<!--#include file="jwt.asp" -->
<%
Dim sKey, sSubdomain, dAttributes, sParameter
' Set your key and Zendesk account subdomain
sKey = ""
sSubdomain = ""
Set dAttributes = Server.CreateObject("Scripting.Dictionary")
dAttributes.Add "jti", UniqueString
dAttributes.Add "iat", SecsSinceEpoch
dAttributes.Add "name", "Someone"
dAttributes.Add "email", "someone@example.com"
sParameter = JWTEncode(dAttributes, sKey)
sUrl = "https://" & sSubdomain & ".zendesk.com/access/jwt?jwt=" & sParameter
if not isempty(Request.QueryString("return_to")) then
sURL = sURL & "&return_to=" & Server.URLEncode(Request.QueryString("return_to"))
end if
Response.redirect sUrl
%>