@@ -9,7 +9,7 @@ Attribute VB_PredeclaredId = False
9
9
Attribute VB_Exposed = True
10
10
Implements IAuthenticator
11
11
''
12
- ' Facebook Authenticator v1 .0.0
12
+ ' Facebook Authenticator v2 .0.0
13
13
' (c) Tim Hall - https://github.com/timhall/Excel-REST
14
14
'
15
15
' Custom IAuthenticator for Facebook OAuth
@@ -100,25 +100,15 @@ End Property
100
100
' Public Methods
101
101
' ============================================= '
102
102
103
+ ''
104
+ ' Setup authenticator
105
+ ' --------------------------------------------- '
106
+
103
107
Public Sub Setup (ApplicationId As String , ApplicationSecret As String )
104
108
Me.ApplicationId = ApplicationId
105
109
Me.ApplicationSecret = ApplicationSecret
106
110
End Sub
107
111
108
- Private Sub IAuthenticator_BeforeExecute (Request As RestRequest )
109
- Request.AddQuerystringParam "access_token" , Me.Token
110
- End Sub
111
-
112
- Private Sub IAuthenticator_HttpOpen ( _
113
- http As MSXML2 .IXMLHTTPRequest, _
114
- Request As RestRequest , _
115
- BaseUrl As String , _
116
- Optional useAsync As Boolean = False )
117
-
118
- ' Perform standard http open
119
- Call http .Open (Request.MethodName(), Request.FullUrl(BaseUrl), useAsync)
120
- End Sub
121
-
122
112
Public Sub Login ()
123
113
On Error GoTo CleanUp
124
114
@@ -179,6 +169,44 @@ End Sub
179
169
' Private Methods
180
170
' ============================================= '
181
171
172
+ ''
173
+ ' Hook for taking action before a request is executed
174
+ '
175
+ ' @param {RestClient} Client The client that is about to execute the request
176
+ ' @param {RestRequest} Request The request about to be executed
177
+ ' --------------------------------------------- '
178
+
179
+ Private Sub IAuthenticator_BeforeExecute (ByVal Client As RestClient , ByRef Request As RestRequest )
180
+ Request.AddQuerystringParam "access_token" , Me.Token
181
+ End Sub
182
+
183
+ ''
184
+ ' Hook for taking action after request has been executed
185
+ '
186
+ ' @param {RestClient} Client The client that executed request
187
+ ' @param {RestRequest} Request The request that was just executed
188
+ ' @param {RestResponse} Response to request
189
+ ' --------------------------------------------- '
190
+
191
+ Private Sub IAuthenticator_AfterExecute (ByVal Client As RestClient , ByVal Request As RestRequest , ByRef Response As RestResponse )
192
+
193
+ End Sub
194
+
195
+ ''
196
+ ' Hook for overriding standard http open (used for HTTP Basic)
197
+ '
198
+ ' @param {MSXML2.IXMLHTTPRequest} http
199
+ ' @parma {RestClient} Client The client that is about to open request
200
+ ' @param {RestRequest} Request The request about to be opened
201
+ ' @param {String} BaseUrl
202
+ ' @param {Boolean} [useAsync=False]
203
+ ' --------------------------------------------- '
204
+
205
+ Private Sub IAuthenticator_HttpOpen (ByRef Http As Object , ByVal Client As RestClient , ByRef Request As RestRequest , BaseUrl As String , Optional UseAsync As Boolean = False )
206
+ ' Perform standard http open
207
+ Call Http .Open (Request.MethodName(), Request.FullUrl(BaseUrl), UseAsync)
208
+ End Sub
209
+
182
210
Private Function TokenRequest () As RestRequest
183
211
Set TokenRequest = New RestRequest
184
212
TokenRequest.Resource = "oauth/access_token"
0 commit comments