Zum Hauptinhalt springen

Obtain authorization from the resource owner

GET/v2/oauth2/authorize
API-Version
v2
Request-Methode
GET
Operation-ID
user-oauth-get-authorization

The OAuth 2.0 client requests authorization from the resource owner according to RFC6749‍. The authorization request is made indirectly via the authorization server as an intermediary.

Request​

Responses​

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/oauth2/authorize?grant_consent=true&grant_type=authorization_code&response_type=code&client_id=string&redirect_uri=string&scope=string&state=string&code_challenge=string&code_challenge_method=S256
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.user.oauthGetAuthorization({
"queryParameters": {
"grant_consent": true,
"grant_type": "authorization_code",
"response_type": "code",
"client_id": "string",
"redirect_uri": "string",
"scope": "string",
"state": "string",
"code_challenge": "string",
"code_challenge_method": "S256"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\OauthGetAuthorization\OauthGetAuthorizationRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new OauthGetAuthorizationRequest())
->withGrantConsent(true)
->withGrantType("authorization_code")
->withResponseType("code")
->withClientId("string")
->withRedirectUri("string")
->withScope("string")
->withState("string")
->withCodeChallenge("string")
->withCodeChallengeMethod("S256");
$response = $client->user()->oauthGetAuthorization($request);

var_dump($response->getBody();

Auf dieser Seite