Smarter Multitenant oAuth Library
Custom authentication backends for hosted Smarter platforms. Includes payment and account status verification.
To verify subscription status, use the following API call:
curl -X ‘GET’ ‘https://api.am.smarter.sh/accounts/subscription-status/’ -H ‘accept: application/json’ -H ‘X-Client-Domain: platform.smarter.sh’ -H ‘X-Client-Username: lmcdaniel’
Returns HTTP 200 if the subscription is active. 40x otherwise.
- class smarter.lib.social_core.backends.multitenant.DjangoModelBackendMultitenant[source]
Bases:
ModelBackendCustom Django ModelBackend that also verifies payment status of the hosted platform.
- class smarter.lib.social_core.backends.multitenant.GithubOAuth2Multitenant(strategy=None, redirect_uri=None)[source]
Bases:
GithubOAuth2Custom GitHub OAuth2 backend that also verifies payment status of the hosted platform.
- class smarter.lib.social_core.backends.multitenant.GoogleOAuth2Multitenant(strategy=None, redirect_uri=None)[source]
Bases:
GoogleOAuth2Custom Google OAuth2 backend that also verifies payment status of the hosted platform.
- smarter.lib.social_core.backends.multitenant.SUBSCRIPTION_STATUS_API_URL = 'https://api.am.smarter.sh/accounts/subscription-status/'
//github.com/smarter-sh/account-manager
- Type:
API endpoint to verify subscription status. see https
- smarter.lib.social_core.backends.multitenant.verify_payment_status(username)[source]
Verify the payment status of a user by making an API call to the Account Manager subscription status endpoint. Returns True if the subscription is active, False otherwise. In case of errors, defaults to returning True to avoid blocking access due to transient issues.
- Return type: