Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3291252
wip
guyp-descope Jul 20, 2022
f15ea29
inital refactor
asafshen Jul 20, 2022
fb2f6cd
wip
guyp-descope Jul 20, 2022
e8685aa
wip
guyp-descope Jul 20, 2022
5f6f585
wip
guyp-descope Jul 20, 2022
7c08058
authhelper.py
asafshen Jul 20, 2022
125f18d
Merge branch 'split-by-auth-method' of github.com:descope/python-sdk …
guyp-descope Jul 20, 2022
df126b5
fix magiclink sample apps
asafshen Jul 20, 2022
497aab6
remove magic link from auth, add tests
asafshen Jul 20, 2022
a10948c
split oauth
asafshen Jul 20, 2022
f5f8a33
wip
guyp-descope Jul 20, 2022
18c8ceb
fix conflicts
guyp-descope Jul 20, 2022
4d67857
wip
guyp-descope Jul 20, 2022
0f76cb9
wip
guyp-descope Jul 20, 2022
4fa590c
wip
guyp-descope Jul 20, 2022
833ce22
wip
guyp-descope Jul 20, 2022
0d5e64c
updaet user email and phone
asafshen Jul 21, 2022
48b52d1
tests
asafshen Jul 21, 2022
f09098e
add totp sample app
asafshen Jul 21, 2022
fb968ca
Add SAML and WebauthN logic
guyp-descope Jul 23, 2022
e062d38
Add WebauthN web sample app (removed the basic webauthn sample app)
guyp-descope Jul 24, 2022
1d02fba
cross device magic link
asafshen Jul 24, 2022
5a9bd4c
update cross device
asafshen Jul 24, 2022
99c26e1
Merge branch 'split-by-auth-method' of github.com:descope/python-sdk …
asafshen Jul 24, 2022
2717602
small fixes
asafshen Jul 24, 2022
fe97d16
exchange
asafshen Jul 24, 2022
f682f49
oauth sample app
asafshen Jul 24, 2022
e25f173
Add webauthn tests and fixes
guyp-descope Jul 24, 2022
e2a5807
Merge branch 'split-by-auth-method' of github.com:descope/python-sdk …
guyp-descope Jul 24, 2022
7cc4e53
wip
guyp-descope Jul 24, 2022
10153a3
fix and adjust totp tests
guyp-descope Jul 24, 2022
0b29d06
tests
asafshen Jul 24, 2022
50b509c
Merge branch 'split-by-auth-method' of github.com:descope/python-sdk …
asafshen Jul 24, 2022
430e122
naming conventions
asafshen Jul 24, 2022
f61c300
fix packaging so authmethod folder will be packed as well
guyp-descope Jul 24, 2022
e84107f
Merge branch 'split-by-auth-method' of github.com:descope/python-sdk …
guyp-descope Jul 24, 2022
75a1259
add webauthn origin parameter
guyp-descope Jul 24, 2022
204515c
renaming, tests
asafshen Jul 24, 2022
4265f35
run pre-commit
asafshen Jul 25, 2022
864108b
add coverage
guyp-descope Jul 25, 2022
1931767
fix conflicts
guyp-descope Jul 25, 2022
f908ed9
tests
asafshen Jul 25, 2022
6114ff4
text changes
asafshen Jul 25, 2022
740fdc2
lint
asafshen Jul 25, 2022
ccd8a86
fix webauth
asafshen Jul 25, 2022
235dd00
errors
asafshen Jul 25, 2022
f755bce
urls
asafshen Jul 25, 2022
16777d2
precommit
asafshen Jul 25, 2022
6361b9d
webauthn add device
asafshen Jul 25, 2022
ea4ebce
update otp docs + update the email of the python package
guyp-descope Jul 25, 2022
c110ba8
webauth add
asafshen Jul 25, 2022
3f57935
fix logout api + doc
guyp-descope Jul 25, 2022
d4fc60d
Merge branch 'split-by-auth-method' of github.com:descope/python-sdk …
asafshen Jul 25, 2022
7682424
webauthn
asafshen Jul 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Replace any instance of `<ProjectID>` in the code below with your company's Pro
* Import and initialize the ExpresSDK for Python client in your source code

```code Python
from descope import DeliveryMethod, User, AuthClient
from descope import DeliveryMethod, User, DescopeClient
```

### 1. Customer Sign-up
Expand All @@ -42,14 +42,14 @@ In your sign-up route for OTP (for example, `myapp.com/signup`) generate a sign-

```code Python
user = User("newusername", "full name", "555-555-1212", "mytestmail@test.com")
auth_client.sign_up_otp(DeliveryMethod.EMAIL, "mytestmail@test.com, user)
descope_client.sign_up_otp(DeliveryMethod.EMAIL, "mytestmail@test.com, user)
```

### 2. Customer Sign-in
In your sign-in route for OTP (for exmaple, `myapp.com/login`) generate a sign-in request send the OTP verification code via the selected OTP delivery method. In the example below an email is sent to "mytestmail@test.com".

```code Python
auth_client.sign_in_otp(DeliveryMethod.EMAIL, "mytestemail@test.com")
descope_client.sign_in_otp(DeliveryMethod.EMAIL, "mytestemail@test.com")
}
```
```code Flask Decorator
Expand All @@ -62,7 +62,7 @@ auth_client.sign_in_otp(DeliveryMethod.EMAIL, "mytestemail@test.com")
In your verify customer route for OTP (for example, `myapp.com/verify`) verify the OTP from either a customer sign-up or sign-in. The validate_session_request function call will write the necessary tokens and cookies to validate each session interaction.

```code Python
claims, tokens = validate_session_request(signed_token: str, signed_refresh_token: str)
claims, tokens = validate_session_request(session_token: str, refresh_token: str)
```
```code Flask Decorator
@descope_verify_code_by_email
Expand All @@ -75,7 +75,7 @@ Session validation checks to see that the visitor to your website or application
In the code below the validates the original session tokens and cookies (`session_token`) and validates the tokens and cookies from the client. ValidateSession returns true if the user is authorized, and false if the user is not authorized. In addition, the session will automatically be extended if the user is valid but the sesssion has expired by writing the updated tokens and cookies to the response writer (w).

```code Python
claims, tokens = auth_client.validate_session_request('session_token', 'refresh_token')
claims, tokens = descope_client.validate_session_request('session_token', 'refresh_token')
```
```code Flask Decorator
@descope_validate_auth
Expand All @@ -87,7 +87,7 @@ claims, tokens = auth_client.validate_session_request('session_token', 'refresh_
This is currenly a placeholder section only - to demonstrate how the framework can include addtional SDK flows.
:::

This section will help you implement user authentication using Magiclinks. etc. etc. The flow for MagicLinks is
This section will help you implement user authentication using Magiclinks. etc. etc. The flow for MagicLinks is

```mermaid
flowchart LR
Expand All @@ -98,15 +98,15 @@ flowchart LR

### Prerequisites

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc laoreet diam vel dignissim posuere. Vestibulum consectetur ante justo, in pretium ligula sollicitudin ut.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc laoreet diam vel dignissim posuere. Vestibulum consectetur ante justo, in pretium ligula sollicitudin ut.

### 1. do this

Sed porttitor eu metus vitae molestie. Sed sed erat risus. Donec eu tempor leo. In hac habitasse platea dictumst. Etiam ornare non tellus eget ultricies.
Sed porttitor eu metus vitae molestie. Sed sed erat risus. Donec eu tempor leo. In hac habitasse platea dictumst. Etiam ornare non tellus eget ultricies.

### 2. do that

Praesent a eros ut est fermentum egestas. Nulla eget leo diam. Vestibulum nec mi nisi. In finibus est in tellus sodales mattis. Etiam gravida nisl id arcu commodo malesuada.
Praesent a eros ut est fermentum egestas. Nulla eget leo diam. Vestibulum nec mi nisi. In finibus est in tellus sodales mattis. Etiam gravida nisl id arcu commodo malesuada.

## ExpressStart with Oauth

Expand All @@ -130,4 +130,4 @@ python -m pytest tests/*

## License

The Descope ExpresSDK for Python is licensed for use under the terms and conditions of the [MIT license Agreement](https://github.com/descope/python-sdk/blob/main/LICENSE).
The Descope ExpresSDK for Python is licensed for use under the terms and conditions of the [MIT license Agreement](https://github.com/descope/python-sdk/blob/main/LICENSE).
2 changes: 1 addition & 1 deletion descope/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from descope.auth import AuthClient
from descope.common import (
REFRESH_SESSION_COOKIE_NAME,
SESSION_COOKIE_NAME,
DeliveryMethod,
)
from descope.descope_client import DescopeClient
from descope.exceptions import AuthException
Loading