# trimble-id
Trimble Identity SDK for Python
## <a name="getting-started">Getting Started</a>
### Installation
You can install with `pip`:
```sh
pip install trimble-id
```
### Configure Trimble Identity
Create a new application in the [Trimble Developer Console](https://developer.console.trimble.com) 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](https://developer.trimble.com/docs/authentication).
## <a name="usage-reference">Usage Reference</a>
### 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:
<table>
<tbody>
<tr>
<th>Endpoint</th>
<td>https://id.trimble.com/.well-known/openid-configuration</td>
</tr>
</tbody>
</table>
## OpenID Endpoint Provider
This endpoint provider is used to retrieve the endpoints from a well-known URL endpoint.
### Usage
```python
from trimble.id 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
```python
from trimble.id 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
```python
from trimble.id 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](https://github.com/trimble-oss/trimble-id-sdk-docs-for-python/blob/main/samples) for reference.
## Release notes
See here for [releases](https://github.com/trimble-oss/trimble-id-sdk-docs-for-python/blob/main/release-notes/CHANGELOG.md)
## Raise an issue
To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/trimble-oss/trimble-id-sdk-docs-for-python/issues).
## <a name="support">Support</a>
Send email to [support@trimble.com](mailto:support@trimble.com)
Raw data
{
"_id": null,
"home_page": "https://github.com/trimble-oss/trimble-id-sdk-docs-for-python",
"name": "trimble-id",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "Trimble, TrimbleID, Trimble Identity",
"author": "Trimble Inc.",
"author_email": "sdk@trimble.com",
"download_url": "https://files.pythonhosted.org/packages/c3/fa/f32d71ecaafdc16cd13fc02511e64069b997b28323e24396af8118d684a1/trimble_id-0.1.0.tar.gz",
"platform": null,
"description": "# trimble-id\n\nTrimble Identity SDK for Python\n\n## <a name=\"getting-started\">Getting Started</a>\n\n### Installation\n\nYou can install with `pip`:\n\n```sh\npip install trimble-id\n```\n\n### Configure Trimble Identity\n\nCreate a new application in the [Trimble Developer Console](https://developer.console.trimble.com) portal and configure the following settings:\n\nTo register your application in Trimble Developer Console:\n\n1. On the left pane select \"Applications\".\n\n2. On the Applications home page, in the top right corner select + NEW APPLICATION. The Create Application page displays.\n\n3. Select Continue to enter the applications details.\n\n | Field | Description |\n | ----------- | ----------- |\n | Name | Name of your application |\n | Description | Provide a description for the application. |\n\n4. Configure OAuth application grant types `Client Credentials` in order to use this SDK.\n\n5. Select \"Create Application\" to save changes.\n\nTake note of the Client ID and URLs under the \"Basic Information\" section. You'll need these values to configure the SDK.\n\n**Scopes**\n\nTrimble 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.\n\nFor more information, see [Authentication documentation](https://developer.trimble.com/docs/authentication).\n\n## <a name=\"usage-reference\">Usage Reference</a>\n\n### Well-Known URL endpoint\nThe 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:\n\n<table>\n <tbody>\n <tr>\n <th>Endpoint</th>\n <td>https://id.trimble.com/.well-known/openid-configuration</td>\n </tr>\n </tbody>\n</table>\n\n## OpenID Endpoint Provider\n\nThis endpoint provider is used to retrieve the endpoints from a well-known URL endpoint.\n\n### Usage\n```python\nfrom trimble.id import OpenIdEndpointProvider\n\nendpoint_provider = OpenIdEndpointProvider(\"https://id.trimble.com/.well-known/openid-configuration\")\nauth_endpoint = await endpoint_provider.retrieve_authorization_endpoint()\ntoken_endpoint = await endpoint_provider.retrieve_token_endpoint()\n```\n\n## Fixed Endpoint Provider\n\nThis endpoint provider is used to provide a fixed set of endpoints.\n\n### Usage\n```python\nfrom trimble.id import FixedEndpointProvider\n\nendpoint_provider = FixedEndpointProvider(\"https://authorization.url\", \"https://token.url\", \"https://userinfo.url\")\nendpoint = await endpoint_provider.retrieve_authorization_endpoint()\n```\n\n## Client Credential Token Provider\n\nThis token provider is used to retrieve an access token using the client credentials grant type.\n\n### Usage\n```python\nfrom trimble.id import ClientCredentialTokenProvider\n\ntoken_provider = ClientCredentialTokenProvider(endpoint_provider, \"client_id\", \"client_secret\").with_scopes([\"scope\"])\n\naccess_token = await token_provider.retrieve_token()\n```\n\n> **_NOTE:_** Refer samples for better understanding.\n\n## Sample Code\n\nSee here for [Sample Code](https://github.com/trimble-oss/trimble-id-sdk-docs-for-python/blob/main/samples) for reference.\n\n## Release notes\n\nSee here for [releases](https://github.com/trimble-oss/trimble-id-sdk-docs-for-python/blob/main/release-notes/CHANGELOG.md)\n\n## Raise an issue\n\nTo provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/trimble-oss/trimble-id-sdk-docs-for-python/issues).\n\n## <a name=\"support\">Support</a>\n\nSend email to [support@trimble.com](mailto:support@trimble.com)\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Trimble Authentication module Client Library for Python",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/trimble-oss/trimble-id-sdk-docs-for-python"
},
"split_keywords": [
"trimble",
" trimbleid",
" trimble identity"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9d781c522c15482ff5036f0098771a039341790807ddb772c5c7c292cd8b09eb",
"md5": "4ef93d12df65e6ea71f5301a46a5b563",
"sha256": "c2fa9acd8ef9cdb6f6ba97cdfdcfadc6232ca82971223105617124f879b776cd"
},
"downloads": -1,
"filename": "trimble_id-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4ef93d12df65e6ea71f5301a46a5b563",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 16228,
"upload_time": "2024-12-04T06:43:10",
"upload_time_iso_8601": "2024-12-04T06:43:10.357798Z",
"url": "https://files.pythonhosted.org/packages/9d/78/1c522c15482ff5036f0098771a039341790807ddb772c5c7c292cd8b09eb/trimble_id-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c3faf32d71ecaafdc16cd13fc02511e64069b997b28323e24396af8118d684a1",
"md5": "3131f22a2c2f603a64d9b13acc3ae919",
"sha256": "5dee208be28d49e89815f8883bbf614d27ae8c5cac76a9da0dfa78fc49f3b8db"
},
"downloads": -1,
"filename": "trimble_id-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3131f22a2c2f603a64d9b13acc3ae919",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11835,
"upload_time": "2024-12-04T06:43:12",
"upload_time_iso_8601": "2024-12-04T06:43:12.059482Z",
"url": "https://files.pythonhosted.org/packages/c3/fa/f32d71ecaafdc16cd13fc02511e64069b997b28323e24396af8118d684a1/trimble_id-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-04 06:43:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "trimble-oss",
"github_project": "trimble-id-sdk-docs-for-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "trimble-id"
}