@@ -3359,18 +3359,6 @@ public void run() {
3359
3359
return ;
3360
3360
}
3361
3361
}
3362
- if (hostedUIOptions .getTokenQueryParameters () != null ) {
3363
- try {
3364
- JSONObject tokenParams = new JSONObject ();
3365
- for (Map .Entry <String , String > e : hostedUIOptions .getTokenQueryParameters ().entrySet ()) {
3366
- tokenParams .put (e .getKey (), e .getValue ());
3367
- }
3368
- hostedUIJSON .put ("TokenQueryParameters" , tokenParams );
3369
- } catch (JSONException e1 ) {
3370
- callback .onError (new Exception ("Failed to construct token query parameters" , e1 ));
3371
- return ;
3372
- }
3373
- }
3374
3362
3375
3363
mStore .set (HOSTED_UI_KEY , hostedUIJSON .toString ());
3376
3364
@@ -3389,21 +3377,15 @@ public void run() {
3389
3377
throw new RuntimeException ("Failed to construct authorization url for OAuth" , e );
3390
3378
}
3391
3379
3392
- Uri . Builder tokensUriBuilder ;
3380
+ final Uri tokensUri ;
3393
3381
final Map <String , String > tokensBody = new HashMap <String , String >();
3394
3382
try {
3395
- tokensUriBuilder = Uri .parse (hostedUIJSON .getString ("TokenURI" )).buildUpon ();
3396
- if (hostedUIOptions .getTokenQueryParameters () != null ) {
3397
- for (Map .Entry <String , String > e : hostedUIOptions .getTokenQueryParameters ().entrySet ()) {
3398
- tokensUriBuilder .appendQueryParameter (e .getKey (), e .getValue ());
3399
- }
3400
- }
3383
+ tokensUri = Uri .parse (hostedUIJSON .getString ("TokenURI" ));
3401
3384
tokensBody .put ("client_id" , hostedUIJSON .getString ("AppClientId" ));
3402
3385
tokensBody .put ("redirect_uri" , hostedUIJSON .getString ("SignInRedirectURI" ));
3403
3386
} catch (Exception e ) {
3404
3387
throw new RuntimeException ("Failed to construct tokens url for OAuth" , e );
3405
3388
}
3406
- final Uri tokensUri = tokensUriBuilder .build ();
3407
3389
3408
3390
mOAuth2Client .authorize (authorizeUriBuilder .build (), new Callback <AuthorizeResponse >() {
3409
3391
@ Override
@@ -3492,18 +3474,6 @@ public void run() {
3492
3474
return ;
3493
3475
}
3494
3476
}
3495
- if (hostedUIOptions .getTokenQueryParameters () != null ) {
3496
- try {
3497
- JSONObject tokenParams = new JSONObject ();
3498
- for (Map .Entry <String , String > e : hostedUIOptions .getTokenQueryParameters ().entrySet ()) {
3499
- tokenParams .put (e .getKey (), e .getValue ());
3500
- }
3501
- hostedUIJSON .put ("TokenQueryParameters" , tokenParams );
3502
- } catch (JSONException e1 ) {
3503
- callback .onError (new Exception ("Failed to construct token query parameters" , e1 ));
3504
- return ;
3505
- }
3506
- }
3507
3477
3508
3478
mStore .set (HOSTED_UI_KEY , hostedUIJSON .toString ());
3509
3479
0 commit comments