@@ -3359,18 +3359,6 @@ public void run() {
33593359 return ;
33603360 }
33613361 }
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- }
33743362
33753363 mStore .set (HOSTED_UI_KEY , hostedUIJSON .toString ());
33763364
@@ -3389,21 +3377,15 @@ public void run() {
33893377 throw new RuntimeException ("Failed to construct authorization url for OAuth" , e );
33903378 }
33913379
3392- Uri . Builder tokensUriBuilder ;
3380+ final Uri tokensUri ;
33933381 final Map <String , String > tokensBody = new HashMap <String , String >();
33943382 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" ));
34013384 tokensBody .put ("client_id" , hostedUIJSON .getString ("AppClientId" ));
34023385 tokensBody .put ("redirect_uri" , hostedUIJSON .getString ("SignInRedirectURI" ));
34033386 } catch (Exception e ) {
34043387 throw new RuntimeException ("Failed to construct tokens url for OAuth" , e );
34053388 }
3406- final Uri tokensUri = tokensUriBuilder .build ();
34073389
34083390 mOAuth2Client .authorize (authorizeUriBuilder .build (), new Callback <AuthorizeResponse >() {
34093391 @ Override
@@ -3492,18 +3474,6 @@ public void run() {
34923474 return ;
34933475 }
34943476 }
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- }
35073477
35083478 mStore .set (HOSTED_UI_KEY , hostedUIJSON .toString ());
35093479
0 commit comments