All URIs are relative to https://your-api-subdomain.onelogin.com
Method | HTTP request | Description |
---|---|---|
generate_token | POST /auth/oauth2/v2/token | Generate Token |
get_rate_limit | GET /auth/rate_limit | Get Rate Limit |
revoke_tokens | POST /auth/oauth2/revoke | Revoke Tokens |
OauthToken generate_token(generate_token_request, content_type=content_type)
Generate Token
Generate Token
- Basic Authentication (basicAuth):
import time
import os
import onelogin
from onelogin.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://your-api-subdomain.onelogin.com
# See configuration.py for a list of all supported configuration parameters.
configuration = onelogin.Configuration(
host = "https://your-api-subdomain.onelogin.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = onelogin.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with onelogin.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = onelogin.OAuth2Api(api_client)
generate_token_request = {"grant_type":"client_credentials"} # GenerateTokenRequest | Request Body to Generate OAuth Token
content_type = 'application/json' # str | (optional) (default to 'application/json')
try:
# Generate Token
api_response = api_instance.generate_token(generate_token_request, content_type=content_type)
print("The response of OAuth2Api->generate_token:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OAuth2Api->generate_token: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
generate_token_request | GenerateTokenRequest | Request Body to Generate OAuth Token | |
content_type | str | [optional] [default to 'application/json'] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad Request | - |
401 | Unauthorized | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetRateLimit200Response get_rate_limit()
Get Rate Limit
Get Rate Limit
- OAuth Authentication (OAuth2):
import time
import os
import onelogin
from onelogin.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://your-api-subdomain.onelogin.com
# See configuration.py for a list of all supported configuration parameters.
configuration = onelogin.Configuration(
host = "https://your-api-subdomain.onelogin.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with onelogin.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = onelogin.OAuth2Api(api_client)
try:
# Get Rate Limit
api_response = api_instance.get_rate_limit()
print("The response of OAuth2Api->get_rate_limit:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OAuth2Api->get_rate_limit: %s\n" % e)
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
400 | Bad Request | - |
401 | Unauthorized | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Error revoke_tokens(content_type=content_type, revoke_tokens_request=revoke_tokens_request)
Revoke Tokens
Revoke Tokens
- Basic Authentication (basicAuth):
import time
import os
import onelogin
from onelogin.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://your-api-subdomain.onelogin.com
# See configuration.py for a list of all supported configuration parameters.
configuration = onelogin.Configuration(
host = "https://your-api-subdomain.onelogin.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: basicAuth
configuration = onelogin.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with onelogin.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = onelogin.OAuth2Api(api_client)
content_type = 'application/json' # str | (optional) (default to 'application/json')
revoke_tokens_request = onelogin.RevokeTokensRequest() # RevokeTokensRequest | (optional)
try:
# Revoke Tokens
api_response = api_instance.revoke_tokens(content_type=content_type, revoke_tokens_request=revoke_tokens_request)
print("The response of OAuth2Api->revoke_tokens:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OAuth2Api->revoke_tokens: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
content_type | str | [optional] [default to 'application/json'] | |
revoke_tokens_request | RevokeTokensRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
400 | Bad Request | - |
401 | Unauthorized | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]