-
Notifications
You must be signed in to change notification settings - Fork 26
/
cLibOAuth.RequestURL.asp
108 lines (94 loc) · 3.41 KB
/
cLibOAuth.RequestURL.asp
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<%
'******************************************************************************
' CLASS: cLibOAuthRequestURL
' PURPOSE:
'
' AUTHOR: sdesapio DATE: 04.04.10 LAST MODIFIED: 04.04.10
'******************************************************************************
Class cLibOAuthRequestURL
'**************************************************************************
'***'PRIVATE CLASS MEMBERS
'**************************************************************************
Private m_objUtils
Private m_strConsumerSecret
Private m_strEndPoint
Private m_strMethod
Private m_strParameters
Private m_strTokenSecret
'**************************************************************************
'***'CLASS_INITIALIZE / CLASS_TERMINATE
'**************************************************************************
Private Sub Class_Initialize()
Set m_objUtils = Nothing
m_strTokenSecret = ""
End Sub
Private Sub Class_Terminate()
Set m_objUtils = Nothing
End Sub
'**************************************************************************
'***'PUBLIC PROPERTIES
'**************************************************************************
Public Property Let ConsumerSecret(pData)
m_strConsumerSecret = pData
End Property
Public Property Let EndPoint(pData)
m_strEndPoint = pData
End Property
Public Property Let Method(pData)
m_strMethod = pData
End Property
Public Property Let Parameters(pData)
m_strParameters = pData
End Property
Public Property Let TokenSecret(pData)
m_strTokenSecret = pData
End Property
'**************************************************************************
'***'PRIVATE PROPERTIES
'**************************************************************************
Private Property Get Utils
If m_objUtils Is Nothing Then
Set m_objUtils = New cLibOAuthUtils
End If
Set Utils = m_objUtils
End Property
'**************************************************************************
'***'PUBLIC FUNCTIONS
'**************************************************************************
'**************************************************************************
' FUNCTION: Get_RequestURL
' PARAMETERS:
' PURPOSE:
'
' AUTHOR: sdesapio DATE: 04.04.10 LAST MODIFIED: 04.04.10
'**************************************************************************
Public Function Get_RequestURL()
Dim strSignature : strSignature = Get_Signature()
strSignature = Utils.URLEncode(strSignature)
Get_RequestURL = _
m_strEndPoint & "?" & _
m_strParameters & "&" & _
"oauth_signature=" & strSignature
End Function
'**************************************************************************
'***'PRIVATE FUNCTIONS
'**************************************************************************
'**************************************************************************
' FUNCTION: Get_Signature
' PARAMETERS:
' PURPOSE:
'
' AUTHOR: sdesapio DATE: 04.04.10 LAST MODIFIED: 11.23.11
'**************************************************************************
Private Function Get_Signature()
Dim strBaseSignature : strBaseSignature = _
m_strMethod & "&" & _
Utils.URLEncode(m_strEndPoint) & "&" & _
Utils.URLEncode(m_strParameters)
Dim strSecret : strSecret = _
Utils.URLEncode(m_strConsumerSecret) & "&" & _
Utils.URLEncode(m_strTokenSecret)
Get_Signature = b64_hmac_sha1(strSecret, strBaseSignature)
End Function
End Class
%>