Skip to main content

Trimble Authentication module Client Library for Python

Project description

trimble-id

Trimble Identity SDK for Python

Getting Started

Installation

You can install with pip:

pip install trimble-id

Configure Trimble Identity

Create a new application in the Trimble Developer Console portal and configure the following settings:

To register your application in Trimble Developer Console:

  1. On the left pane select "Applications".

  2. On the Applications home page, in the top right corner select + NEW APPLICATION. The Create Application page displays.

  3. Select Continue to enter the applications details.

    Field Description
    Name Name of your application
    Description Provide a description for the application.
  4. Configure OAuth application grant types Client Credentials in order to use this SDK.

  5. Select "Create Application" to save changes.

Take note of the Client ID and URLs under the "Basic Information" section. You'll need these values to configure the SDK.

Scopes

Trimble Identity uses scopes to determine the aud claim in the returned access token. Scope is mandatory for the application to work. You can use the scope as the application name registered in the Trimble Developer Console. For example, if you have registered an application with the name "test", then it must be registered in the format {some_uuid}-"test". For eg., 12345678-1234-1234-1234-123456789012-test.

For more information, see Authentication documentation.

Usage Reference

Well-Known URL endpoint

The well-known URL endpoint is used to retrieve the authorization, token and user info endpoints for a given environment. The following endpoints are available for the staging and production environments:

Endpoint https://id.trimble.com/.well-known/openid-configuration

OpenID Endpoint Provider

This endpoint provider is used to retrieve the endpoints from a well-known URL endpoint.

Usage

from trimble.id.open_id_endpoint_provider import OpenIdEndpointProvider

endpoint_provider = OpenIdEndpointProvider("https://id.trimble.com/.well-known/openid-configuration")
auth_endpoint = await endpoint_provider.retrieve_authorization_endpoint()
token_endpoint = await endpoint_provider.retrieve_token_endpoint()

Fixed Endpoint Provider

This endpoint provider is used to provide a fixed set of endpoints.

Usage

from trimble.id.fixed_endpoint_provider import FixedEndpointProvider

endpoint_provider = FixedEndpointProvider("https://authorization.url", "https://token.url", "https://userinfo.url")
endpoint = await endpoint_provider.retrieve_authorization_endpoint()

Client Credential Token Provider

This token provider is used to retrieve an access token using the client credentials grant type.

Usage

from trimble.id.client_credential_token_provider import ClientCredentialTokenProvider

token_provider = ClientCredentialTokenProvider(endpoint_provider, "client_id", "client_secret").with_scopes(["scope"])

access_token = await token_provider.retrieve_token()

NOTE: Refer samples for better understanding.

Sample Code

See here for Sample Code for reference.

Release notes

See here for releases

Raise an issue

To provide feedback or report a bug, please raise an issue on our issue tracker.

Support

Send email to support@trimble.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trimble-id-0.0.1rc3.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trimble_id-0.0.1rc3-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file trimble-id-0.0.1rc3.tar.gz.

File metadata

  • Download URL: trimble-id-0.0.1rc3.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for trimble-id-0.0.1rc3.tar.gz
Algorithm Hash digest
SHA256 003d71d807afc2449164de212669abc6a284f60321b741ab84e2fab8e77a4cb4
MD5 eb75298bb0043d8f31a950bb2221aacc
BLAKE2b-256 4f6f5699cfe9a7cf7adbfc5c65fad7a2adb88456c9fa12d44e3c9cfd53c9045f

See more details on using hashes here.

File details

Details for the file trimble_id-0.0.1rc3-py3-none-any.whl.

File metadata

  • Download URL: trimble_id-0.0.1rc3-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for trimble_id-0.0.1rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 5ea107c41a5e89f8859185df3ff207530e55b070fc3bd534094ecaf67f5d6c8b
MD5 36da87bdeddbff99f58a749768f4032f
BLAKE2b-256 05f1e2303e575acd3e1ee9fc945577ed5353fa20189db98f5eddb1e1e2068658

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page