Skip to content

Commit e1d53a0

Browse files
author
Grace Yim
committed
Include baseUri when creating new instance of ToopherApi
1 parent 4343e29 commit e1d53a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/com/toopher/ToopherIframe.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.toopher;
22

3+
import java.net.URISyntaxException;
34
import java.nio.charset.Charset;
45
import java.util.*;
56
import java.net.URLEncoder;
@@ -187,7 +188,7 @@ public String getUserManagementUrl(String userName, Map<String, String> extras)
187188
* @throws SignatureValidationError Thrown when exceptional condition is encountered while validating data
188189
* @throws RequestError Thrown when postback resource type is invalid
189190
*/
190-
public Object processPostback(Map<String, String> params, String requestToken, Map<String, String> extras) throws SignatureValidationError, RequestError {
191+
public Object processPostback(Map<String, String> params, String requestToken, Map<String, String> extras) throws SignatureValidationError, RequestError, URISyntaxException {
191192
Map<String, String> toopherData = urlDecodeIframeData(params);
192193

193194
if (toopherData.containsKey("error_code")) {
@@ -201,7 +202,7 @@ public Object processPostback(Map<String, String> params, String requestToken, M
201202
} else {
202203
Map<String, String> validatedData = validateData(toopherData, requestToken, extras);
203204

204-
ToopherApi toopherApi = new ToopherApi(consumerKey, consumerSecret);
205+
ToopherApi toopherApi = new ToopherApi(consumerKey, consumerSecret, baseUri);
205206
String resourceType = validatedData.get("resource_type");
206207
if (resourceType.equals("authentication_request")) {
207208
return new AuthenticationRequest(createAuthenticationRequestJson(validatedData), toopherApi);

0 commit comments

Comments
 (0)