Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update endpoints for Doktornarabote#1019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ezibrov wants to merge1 commit intoscribejava:master
base:master
Choose a base branch
Loading
fromezibrov:HH-133418
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff 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());
}

}

[8]ページ先頭

©2009-2025 Movatter.jp