Solid authentication with client credentials
Project description
Solid Client Credentials
Solid authentication with client credentials.
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.
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(
token_endpoint=token_endpoint,
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file solidclientcredentials-1.0.1.tar.gz
.
File metadata
- Download URL: solidclientcredentials-1.0.1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-60-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f97326ea007a8de6851c41b5dc947700b92aa9e706b95d5d2755c9a96e9a9e9d |
|
MD5 | 2aed1b82dfe55dd5c5275c00f9c991de |
|
BLAKE2b-256 | 269253249ff6df16b1c2c56f2bfef15a3f1ef61c450a95beeb4d161b4a8be5f0 |
File details
Details for the file solidclientcredentials-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: solidclientcredentials-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.6 Linux/5.15.0-60-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a15c38ffdc60dcde0327853158c03fc4455c3e3aab6f4af49cb51908faa00b |
|
MD5 | 418666097ae72b5b071f35149cfe88d0 |
|
BLAKE2b-256 | eeea78b43f1358150711546345dbf01fa67ab19b1c3ff1c3c39ffe807b8f1d36 |