Skip to content

Latest commit

 

History

History
852 lines (572 loc) · 32 KB

AuthenticationApi.md

File metadata and controls

852 lines (572 loc) · 32 KB

corellium.AuthenticationApi

Request timeouts

Every API method accepts _request_timeout in seconds: a positive float for the urllib3 total timeout, or a pair of positive floats (connect, read). This controls HTTP transport waiting, not how long the server operation may run. It is not a wall-clock deadline for the operation or for all retries combined.

Transport timeouts raise urllib3.exceptions.TimeoutError subclasses such as ReadTimeoutError and ConnectTimeoutError. When retries are exhausted, urllib3 can instead raise urllib3.exceptions.MaxRetryError; inspect its reason to distinguish a timeout from other connection failures. Retry behavior depends on the HTTP method and Configuration.retries. These are client-side exceptions, not HTTP response statuses or SDK ApiException responses.

A timeout does not guarantee cancellation or rollback of an operation accepted by the server. For example, after a start request times out, the instance may still be starting or may already be running; the timeout alone does not establish its state or mean it was stopped or destroyed. The request might not have reached the server at all, leaving the instance off. Treat the outcome as unknown and fetch the instance's current state before deciding whether to retry. If it has since been destroyed, that lookup may return not found; the timeout itself does not prove destruction. Do not blindly repeat a state-changing request.

Catch urllib3.exceptions.TimeoutError and urllib3.exceptions.MaxRetryError separately from the SDK ApiException. MaxRetryError is not a subclass of TimeoutError. With _with_http_info the same rules apply. With _without_preload_content, a read timeout may also occur later when reading the returned response body.

All URIs are relative to https://app.corellium.com/api

Method HTTP request Description
v3_auth_login POST /v3/auth/login Log in
v3_auth_logout POST /v3/auth/logout Log out
v3_delete_api_token DELETE /v3/auth/apitoken Delete API token
v3_fetch_auth_provider_metadata GET /v3/auth/providers/fetch-metadata Fetch SAML metadata
v3_generate_api_token POST /v3/auth/apitoken Generate API token
v3_get_auth_provider_authorization_url GET /v3/auth/providers/{providerId}/authorization_url Get provider authorization URL
v3_get_auth_provider_callback GET /v3/auth/providers/{providerId}/callback Authentication provider callback (GET)
v3_get_auth_provider_sp_metadata GET /v3/auth/providers/{providerId}/spmetadata Get service provider metadata
v3_list_auth_provider_types GET /v3/auth/providers/types List authentication provider types
v3_list_auth_providers GET /v3/auth/providers List authentication providers
v3_post_auth_provider_callback POST /v3/auth/providers/{providerId}/callback Authentication provider callback (POST)

v3_auth_login

LoginResult v3_auth_login(login_body=login_body)

Log in

Start here. Almost every other call needs you to prove who you are by sending a token in the Authorization header: Authorization: Bearer <token>. There are two kinds of token:

  • API token (best for scripts and automation). A long-lived key you create once, in the web interface or with POST /v3/auth/apitoken. It is shown only once, so store it safely. You can send it directly as the Bearer token on every request, or exchange it here for a session token by sending apiToken.
  • Session token. A short-lived token (a JWT) returned by this call. Send it as the Bearer token until expiration, then log in again or renew it by sending it back as token.

Supply one of three credential types; when more than one is present they are resolved in this fixed order of precedence: (1) username + password (plus totpToken, a six-digit code from your authenticator app, when two-factor sign-in is enabled); (2) token, an existing session token, renewed for a fresh one; (3) apiToken, a persistent API key created by the user, not issued by login. The first credential type present wins and the rest are ignored. For example, sending both username/password and an apiToken authenticates via username/password. On success the response contains a newly-regenerated session token, its expiration time, and the session itself: the authenticated user and their domain. The apiToken is never returned. Renewing a Webplayer token instead returns the Webplayer session identifier and no user.

A 403 means the credentials were wrong (or a required two-factor code was missing or wrong).

Example

import corellium
from corellium.models.login_body import LoginBody
from corellium.models.login_result import LoginResult
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    login_body = corellium.LoginBody() # LoginBody |  (optional)

    try:
        # Log in
        api_response = api_instance.v3_auth_login(login_body=login_body)
        print("The response of AuthenticationApi->v3_auth_login:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_auth_login: %s\n" % e)

Parameters

Name Type Description Notes
login_body LoginBody [optional]

Return type

LoginResult

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Authentication succeeded. -
400 Missing or invalid credentials in the request body. -
403 Invalid username or password. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_auth_logout

v3_auth_logout()

Log out

Ends the current session: the session token you send becomes invalid, so later requests with it fail with 401. For OpenID Connect (single sign-on) users this also ends the session with the identity provider. API tokens are not affected; remove one with v3DeleteApiToken.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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 Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)

    try:
        # Log out
        api_instance.v3_auth_logout()
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_auth_logout: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Logout succeeded. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_delete_api_token

v3_delete_api_token()

Delete API token

Deletes your API token, so it can no longer be used to sign in. Scripts using it will get 401 until you give them a new one from v3GenerateApiToken.

Deletes are idempotent: a request made when no API token is saved is a successful no-op that still returns 204, and repeated calls return 204 as well. A 404 means the request path did not match a delete route, not that the target was missing.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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 Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)

    try:
        # Delete API token
        api_instance.v3_delete_api_token()
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_delete_api_token: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 The API token was deleted, or no token was saved. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_fetch_auth_provider_metadata

str v3_fetch_auth_provider_metadata(url)

Fetch SAML metadata

Fetch SAML metadata XML from a trusted provider URL. The URL must be HTTPS and from an allowed domain.

Example

import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    url = 'https://sso.okta.com/app/exk1a2b3c4d5e6f7g8h9/sso/saml/metadata' # str | HTTPS URL of the SAML metadata endpoint to fetch.

    try:
        # Fetch SAML metadata
        api_response = api_instance.v3_fetch_auth_provider_metadata(url)
        print("The response of AuthenticationApi->v3_fetch_auth_provider_metadata:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_fetch_auth_provider_metadata: %s\n" % e)

Parameters

Name Type Description Notes
url str HTTPS URL of the SAML metadata endpoint to fetch.

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

HTTP response details

Status code Description Response headers
200 SAML metadata document. -
400 Missing or non-HTTPS URL parameter. -
403 The URL domain is not in the allowed list. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_generate_api_token

ApiTokenResult v3_generate_api_token()

Generate API token

Creates a new API token for you: a long-lived key for scripts, CI jobs and SDKs, so they do not need your password. The response contains the token; it is shown only this once and cannot be retrieved later, so store it somewhere safe (for example a secrets manager). Each user has one API token at a time: generating a new one replaces the old one, which stops working immediately. Use it as Authorization: Bearer <apiToken>, or exchange it for a session token with v3AuthLogin.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.api_token_result import ApiTokenResult
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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 Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)

    try:
        # Generate API token
        api_response = api_instance.v3_generate_api_token()
        print("The response of AuthenticationApi->v3_generate_api_token:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_generate_api_token: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiTokenResult

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 A freshly generated API token. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_get_auth_provider_authorization_url

v3_get_auth_provider_authorization_url(provider_id, type=type, code=code, email=email, token=token)

Get provider authorization URL

Starts single sign-on with the given identity provider by redirecting the caller's browser there (302). Open this URL in a browser, not from a script: after the user signs in at the provider, the provider sends the browser back to the callback route, which finishes signing in.

Example

import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    provider_id = 'sso.example.com' # str | Provider identifier.
    type = 'type_example' # str | Sign-up flow type. (optional)
    code = 'INVITE1234' # str | Sign-up code for subscriber invites and trial requests. (optional)
    email = 'jane.doe@example.com' # str | Sign-up email (may differ from SSO email). (optional)
    token = '<token>' # str | Sign-up token for a team invite. (optional)

    try:
        # Get provider authorization URL
        api_instance.v3_get_auth_provider_authorization_url(provider_id, type=type, code=code, email=email, token=token)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_get_auth_provider_authorization_url: %s\n" % e)

Parameters

Name Type Description Notes
provider_id str Provider identifier.
type str Sign-up flow type. [optional]
code str Sign-up code for subscriber invites and trial requests. [optional]
email str Sign-up email (may differ from SSO email). [optional]
token str Sign-up token for a team invite. [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
302 Success — redirects the caller to the identity provider's authorization URL. * Location - URL the client is redirected to.
404 No provider with the given providerId. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_get_auth_provider_callback

v3_get_auth_provider_callback(provider_id, error=error, error_description=error_description)

Authentication provider callback (GET)

Handle the final authorization response from an SSO provider and redirect back to the client.

Example

import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    provider_id = 'sso.example.com' # str | Provider identifier.
    error = 'access_denied' # str | Error code from the provider. (optional)
    error_description = 'The user denied the request.' # str | Error description from the provider. (optional)

    try:
        # Authentication provider callback (GET)
        api_instance.v3_get_auth_provider_callback(provider_id, error=error, error_description=error_description)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_get_auth_provider_callback: %s\n" % e)

Parameters

Name Type Description Notes
provider_id str Provider identifier.
error str Error code from the provider. [optional]
error_description str Error description from the provider. [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
302 Success — redirects the caller back to the application after handling the callback. * Location - URL the client is redirected to.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_get_auth_provider_sp_metadata

str v3_get_auth_provider_sp_metadata(provider_id)

Get service provider metadata

Return the SAML service provider metadata XML for the given authentication provider.

Example

import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    provider_id = 'sso.example.com' # str | Provider identifier.

    try:
        # Get service provider metadata
        api_response = api_instance.v3_get_auth_provider_sp_metadata(provider_id)
        print("The response of AuthenticationApi->v3_get_auth_provider_sp_metadata:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_get_auth_provider_sp_metadata: %s\n" % e)

Parameters

Name Type Description Notes
provider_id str Provider identifier.

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

HTTP response details

Status code Description Response headers
200 Service provider metadata document. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -
404 The provider does not expose service provider metadata. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_list_auth_provider_types

AuthProviderTypesListResponse v3_list_auth_provider_types(limit=limit, offset=offset)

List authentication provider types

Required role: Domain administrator.

Return schemas describing the supported authentication provider types.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.auth_provider_types_list_response import AuthProviderTypesListResponse
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# 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 Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    limit = 100 # float | Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. (optional) (default to 100)
    offset = 0 # float | How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. (optional) (default to 0)

    try:
        # List authentication provider types
        api_response = api_instance.v3_list_auth_provider_types(limit=limit, offset=offset)
        print("The response of AuthenticationApi->v3_list_auth_provider_types:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_list_auth_provider_types: %s\n" % e)

Parameters

Name Type Description Notes
limit float Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. [optional] [default to 100]
offset float How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. [optional] [default to 0]

Return type

AuthProviderTypesListResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Paginated list of supported authentication provider types. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_list_auth_providers

AuthProvidersListResponse v3_list_auth_providers(limit=limit, offset=offset)

List authentication providers

Lists the ways users can sign in to your domain, such as username and password or single sign-on (SSO) through an identity provider like Okta. Needs no sign-in, so a login page can call it to show the right buttons. To sign in with an SSO provider, send the user's browser to its authorizationUrl.

Example

import corellium
from corellium.models.auth_providers_list_response import AuthProvidersListResponse
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    limit = 100 # float | Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. (optional) (default to 100)
    offset = 0 # float | How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. (optional) (default to 0)

    try:
        # List authentication providers
        api_response = api_instance.v3_list_auth_providers(limit=limit, offset=offset)
        print("The response of AuthenticationApi->v3_list_auth_providers:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_list_auth_providers: %s\n" % e)

Parameters

Name Type Description Notes
limit float Most results to return in one page. Whole number from 1 to 1000; defaults to 100. A value outside that range is rejected with 400. [optional] [default to 100]
offset float How many results to skip before this page starts; defaults to 0. To get the next page, add `limit` to the previous `offset`. [optional] [default to 0]

Return type

AuthProvidersListResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Paginated list of configured authentication providers. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

v3_post_auth_provider_callback

v3_post_auth_provider_callback(provider_id)

Authentication provider callback (POST)

Handle the final authorization response from an SSO provider (POST binding) and redirect back to the client.

Example

import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.AuthenticationApi(api_client)
    provider_id = 'sso.example.com' # str | Provider identifier.

    try:
        # Authentication provider callback (POST)
        api_instance.v3_post_auth_provider_callback(provider_id)
    except Exception as e:
        print("Exception when calling AuthenticationApi->v3_post_auth_provider_callback: %s\n" % e)

Parameters

Name Type Description Notes
provider_id str Provider identifier.

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
302 Success — redirects the caller back to the application after handling the callback. * Location - URL the client is redirected to.

[Back to top] [Back to API list] [Back to Model list] [Back to README]