Skip to main content

Solid authentication with client credentials

Project description

Solid Client Credentials

Solid authentication with client credentials.

Unix Build Status Windows Build Status Coverage Status Scrutinizer Code Quality PyPI License PyPI Version PyPI Downloads

Setup

Requirements

  • Python 3.10+ (likely works with lower versions, but not tested)

Installation

$ pip install SolidClientCredentials

Use Case

!!! note Client credentials are not standardized, thus you can't run your application through any Solid pod. However, users from any provider can give your app access through standardized mechanisms (eg ACL).

You can use client credentials to create a server-side application that authenticates as a webId on ESS or CSS. After obtaining the client credentials for a webId, you can use them to make authenticated requests on behalf of this account. You will be able to access all resources this webId has access to. If you want to access data of other users, they must grant access rights to your apps webId.

See also: https://docs.inrupt.com/developer-tools/javascript/client-libraries/tutorial/authenticate-nodejs-script/

Usage

To use this package you first need valid client credentials (see below). Given the client credentials you can use it as follows:

from solid_client_credentials import SolidClientCredentialsAuth, DpopTokenProvider
import requests

client_id = 'your-id'
client_secret = 'your-secret'

# The server that provides your account (where you login)
issuer_url = 'https://login.inrupt.com'

# create a token provider
token_provider = DpopTokenProvider(
    issuer_url=issuer_url,
    client_id=client_id,
    client_secret=client_secret
)
# use the tokens with the requests library
auth = SolidClientCredentialsAuth(token_provider)

res = requests.get('https://example.org/private/stuff', auth=auth)
print(res.text)

Obtaining client credentials

This is currently only possible with ESS and CSS.

ESS

ESS allows to manually obtain client credentials: https://login.inrupt.com/registration.html

CSS

CSS allows to automatically obtain client credentials: https://communitysolidserver.github.io/CommunitySolidServer/5.x/usage/client-credentials/

You can also look at css_utils.py to see how this maps to python.

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

solidclientcredentials-1.0.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

solidclientcredentials-1.0.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file solidclientcredentials-1.0.2.tar.gz.

File metadata

  • Download URL: solidclientcredentials-1.0.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-49-generic

File hashes

Hashes for solidclientcredentials-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1a5ce1a5f1120a258df36dfafdf731959e36b2858074eea50b2c6c8bff02d7c3
MD5 fc69a5239f3dbd43b419af4b985ef007
BLAKE2b-256 4ab39c2f25cc9624eec2951d2a5ade6e7cbb4c9fad2b944f79df696e6f3a475b

See more details on using hashes here.

File details

Details for the file solidclientcredentials-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for solidclientcredentials-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e35bd7043b488cfd3b4bb2a34f162d406af78ef1c0f35dfb6f953368d07b3d8
MD5 2ac9d90d4f4f5be933a28aedff61ac28
BLAKE2b-256 b1ebba87978a223db4b44b8025aca0c866f79065d316981cb3e0e4f0c37f770c

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