Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 20 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
52 changes: 45 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,48 @@
# cli-authentication
# Descope CLI-Authentication Sample App

Sample app to authenticate CLI scripts with Descope methose - OTP, TOTP and Enchanted Links.
This repo showcase how to authenticate users using Node CLI and Descope Node SDK.
User is authenticated using an OTP sent to the provided email.
The method used is SignUpOrIn, which means if the provided user does not exist - it is created and then signed in.
Once user is signed in - you can use the session JWT to send to any backend service to be validated with Descope SDK.

Environment parameters needed:
## 🎨 Features
- [Descope](https://descope.com/) Node SDK 🔐
- CLI authentication using OTP via email
- Refresh access token with the received refresh token
- Get end user information with me()

|Variable|Description|
|-|-|
| `DESCOPE_PROJECT_ID` | Descope project ID |
| `REDIRECT_URI` | Redirect URI to be used with enchanted links |

## ✨ Made with...
- [Descope](https://www.descope.com/)

## ⚙️ Setup

1. Clone the repository:

```
git clone https://github.com/descope-sample-apps/svelte-sample-app.git
```

2. Install dependencies:

```
npm install
```

3. Have Descope project ID from your project

## 🔮 Running the Application

To start the application, run:

```
./start.sh login -p <PROJECT ID> -e <EMAIL>
```

## ⚠️ Issue Reporting

For any issues or suggestions, feel free to open an issue in the GitHub repository.

## 📜 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Loading