FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update endpoints for Doktornarabote by ezibrov · Pull Request #1019 · scribejava/scribejava · GitHub

Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package com.github.scribejava.apis;

import com.github.scribejava.core.builder.api.DefaultApi20;
import com.github.scribejava.core.model.OAuthConstants;
import com.github.scribejava.core.model.ParameterList;
import com.github.scribejava.core.model.Verb;
import com.github.scribejava.core.oauth2.clientauthentication.ClientAuthentication;
import com.github.scribejava.core.oauth2.clientauthentication.RequestBodyAuthenticationScheme;
import java.util.Map;

public class DoktornaraboteApi extends DefaultApi20 {

private static final String REDIRECT_PARAM_NAME = "redirect";

protected DoktornaraboteApi() {
}

Expand All @@ -17,11 +25,44 @@ public static DoktornaraboteApi instance() {

@Override
public String getAccessTokenEndpoint() {
return "https://auth.doktornarabote.ru/OAuth/Token";
return "https://id.doktornarabote.ru/api/v1/auth/token";
}

@Override
public Verb getAccessTokenVerb() {
return Verb.GET;
}

@Override
protected String getAuthorizationBaseUrl() {
return "https://auth.doktornarabote.ru/OAuth/Authorize";
return "https://www.doktornarabote.ru";
}

@Override
public ClientAuthentication getClientAuthentication() {
return RequestBodyAuthenticationScheme.instance();
}

@Override
public String getAuthorizationUrl(String responseType, String apiKey, String callback, String scope, String state,
Map<String, String> additionalParams) {
final ParameterList parameters = new ParameterList(additionalParams);
parameters.add(OAuthConstants.RESPONSE_TYPE, responseType);
parameters.add(OAuthConstants.CLIENT_ID, apiKey);

if (callback != null) {
parameters.add(REDIRECT_PARAM_NAME, callback);
}

if (scope != null) {
parameters.add(OAuthConstants.SCOPE, scope);
}

if (state != null) {
parameters.add(OAuthConstants.STATE, state);
}

return parameters.appendTo(getAuthorizationBaseUrl());
}

}

Back | FazBrowse Home | New Git URL