Skip to content

Commit 443c243

Browse files
committed
refactor: revert adding polar parameters for access token call to BodyParameter
fix: removed actual client id and secret from polar example
1 parent 3a095e2 commit 443c243

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

scribejava-apis/src/main/java/com/github/scribejava/apis/polar/PolarOAuth20Service.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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]",

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/PolarAPI20Example.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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());

0 commit comments

Comments
 (0)