Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 4.3 KB

AuthorizeService.md

File metadata and controls

48 lines (35 loc) · 4.3 KB

AuthorizeService

A list of all methods in the AuthorizeService service. Click on the method name to view detailed information about that method.

Methods Description
authorize_client The Authorize Client endpoint initiates the OAuth Authorization Code flow by redirecting the user to UPS for logging-in and authorize the client application. To begin the authorization flow, the application constructs a URL using the application's client Id, the redirect URI, the scope of permissions requested, and a random string used for subsequent verification. A successful response redirects back to the client with an authorization code that can be exchanged for an access token.

authorize_client

The Authorize Client endpoint initiates the OAuth Authorization Code flow by redirecting the user to UPS for logging-in and authorize the client application. To begin the authorization flow, the application constructs a URL using the application's client Id, the redirect URI, the scope of permissions requested, and a random string used for subsequent verification. A successful response redirects back to the client with an authorization code that can be exchanged for an access token.

  • HTTP Method: GET
  • Endpoint: /security/v1/oauth/authorize

Parameters

Name Type Required Description
client_id str ✅ The public identifier for your application, obtained when you, the developer first registered the application.
redirect_uri str ✅ URL that tells the authorization server where to send the user back to after they approve the request.
response_type str ✅ Valid Values: code
state str ❌ A random string generated by the application and included in the request to prevent CSRF attacks. The application checks that the same value is returned after the user authorizes the app.
scope str ❌ One or more space-separated strings indicating which permissions the application is requesting.

Example Usage Code Snippet

from ups_0auth_code import Ups0authCode, Environment

sdk = Ups0authCode(
    username="YOUR_USERNAME",
    password="YOUR_PASSWORD",
    base_url=Environment.DEFAULT.value
)

result = sdk.authorize.authorize_client(
    client_id="client_id",
    redirect_uri="redirect_uri",
    response_type="response_type",
    state="state",
    scope="scope"
)

print(result)