@@ -1680,7 +1680,9 @@ public MpimOpenResponse mpimOpen(RequestConfigurator<MpimOpenRequest.MpimOpenReq
16801680 public OAuthAccessResponse oauthAccess (OAuthAccessRequest req ) throws IOException , SlackApiException {
16811681 FormBody .Builder form = new FormBody .Builder ();
16821682 form .add ("code" , req .getCode ());
1683- form .add ("redirect_uri" , req .getRedirectUri ());
1683+ if (req .getRedirectUri () != null ) {
1684+ form .add ("redirect_uri" , req .getRedirectUri ());
1685+ }
16841686 form .add ("single_channel" , req .isSingleChannel () ? "1" : "0" );
16851687 String authorizationHeader = Credentials .basic (req .getClientId (), req .getClientSecret ());
16861688 return postFormWithAuthorizationHeaderAndParseResponse (form , endpointUrlPrefix + Methods .OAUTH_ACCESS , authorizationHeader , OAuthAccessResponse .class );
@@ -1695,7 +1697,9 @@ public OAuthAccessResponse oauthAccess(RequestConfigurator<OAuthAccessRequest.OA
16951697 public OAuthV2AccessResponse oauthV2Access (OAuthV2AccessRequest req ) throws IOException , SlackApiException {
16961698 FormBody .Builder form = new FormBody .Builder ();
16971699 form .add ("code" , req .getCode ());
1698- form .add ("redirect_uri" , req .getRedirectUri ());
1700+ if (req .getRedirectUri () != null ) {
1701+ form .add ("redirect_uri" , req .getRedirectUri ());
1702+ }
16991703 String authorizationHeader = Credentials .basic (req .getClientId (), req .getClientSecret ());
17001704 return postFormWithAuthorizationHeaderAndParseResponse (form , endpointUrlPrefix + Methods .OAUTH_V2_ACCESS , authorizationHeader , OAuthV2AccessResponse .class );
17011705 }
0 commit comments