File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
main/java/com/github/scribejava/apis/polar
test/java/com/github/scribejava/apis/examples Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -24,16 +24,16 @@ protected OAuthRequest createAccessTokenRequest(AccessTokenRequestParams params)
2424
2525 getApi ().getClientAuthentication ().addClientAuthentication (request , getApiKey (), getApiSecret ());
2626
27- request .addBodyParameter (OAuthConstants .CODE , params .getCode ());
27+ request .addParameter (OAuthConstants .CODE , params .getCode ());
2828 final String callback = getCallback ();
2929 if (callback != null ) {
30- request .addBodyParameter (OAuthConstants .REDIRECT_URI , callback );
30+ request .addParameter (OAuthConstants .REDIRECT_URI , callback );
3131 }
32- request .addBodyParameter (OAuthConstants .GRANT_TYPE , OAuthConstants .AUTHORIZATION_CODE );
32+ request .addParameter (OAuthConstants .GRANT_TYPE , OAuthConstants .AUTHORIZATION_CODE );
3333
3434 final String pkceCodeVerifier = params .getPkceCodeVerifier ();
3535 if (pkceCodeVerifier != null ) {
36- request .addBodyParameter (PKCE .PKCE_CODE_VERIFIER_PARAM , pkceCodeVerifier );
36+ request .addParameter (PKCE .PKCE_CODE_VERIFIER_PARAM , pkceCodeVerifier );
3737 }
3838 if (isDebug ()) {
3939 log ("created access token request with body params [%s], query string params [%s]" ,
Original file line number Diff line number Diff line change @@ -28,10 +28,10 @@ private PolarAPI20Example() {
2828 public static void main (String ... args ) throws Exception {
2929
3030 // Replace these with your client id and secret fron your app
31- final String clientId = "1a86ac29-7ea3-473a-81d9-8ea582214558 " ;
32- final String clientSecret = "0dc23e1d-b677-4da0-bb14-311949898a95 " ;
31+ final String clientId = "your api client " ;
32+ final String clientSecret = "your api secret " ;
3333 final String scope = "accesslink.read_all" ;
34- final String callback = "http://localhost " ;
34+ final String callback = "your api callback " ;
3535 final OAuth20Service service = new ServiceBuilder (clientId ).apiSecret (clientSecret ).defaultScope (scope )
3636 //your callback URL to store and handle the authorization code sent by Polar
3737 .callback (callback ).build (PolarAPI20 .instance ());
You can’t perform that action at this time.
0 commit comments