diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..1cd9745822 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +/articles/quickstart @auth0/dx-sdks-engineer +/articles/libraries @auth0/dx-sdks-engineer +/articles/cms @auth0/dx-sdks-engineer +/articles/quickstart/webapp/express @pdillon diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 49861ab9d9..bd61ed03a3 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,8 +1,3 @@ diff --git a/.github/workflows/check-content-version.yml b/.github/workflows/check-content-version.yml new file mode 100644 index 0000000000..8d471da8b9 --- /dev/null +++ b/.github/workflows/check-content-version.yml @@ -0,0 +1,22 @@ +name: Check Content Version + +on: + schedule: + - cron: '0 * * * *' # Runs every hour + workflow_dispatch: # Allows manual trigger from GitHub Actions tab + +jobs: + run-script: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Make script executable + run: chmod +x scripts/check-version.sh + shell: bash + + - name: Run check-version.sh script + run: scripts/check-version.sh + shell: bash \ No newline at end of file diff --git a/.github/workflows/clean-redirects-pr.yml b/.github/workflows/clean-redirects-pr.yml new file mode 100644 index 0000000000..06b704805c --- /dev/null +++ b/.github/workflows/clean-redirects-pr.yml @@ -0,0 +1,34 @@ +# Cleanup redirects config file. +name: Redirects cleanup PR + +on: + schedule: + - cron: '0 7 * * 1' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Get current date + id: date + run: echo "current_date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - name: Checkout + uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14.17' + cache: 'yarn' + - run: yarn + - run: yarn run clean-redirects + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3 + with: + commit-message: Redirects config cleanup ${{ env.current_date }} + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + signoff: false + branch: clean_redirects_action_${{ env.current_date }} + delete-branch: true + title: 'Redirects config cleanup ${{ env.current_date }}' \ No newline at end of file diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000000..3c1be5f76d --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,34 @@ +name: Integration Tests +on: + pull_request: + branches: master + +concurrency: + group: pr-integration-tests-${{ github.event.pull_request.id }} + cancel-in-progress: true + +jobs: + tests: + name: Trigger Tests + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@6c999acf206f5561e19f46301bb310e9e70d8815 # v7.0.7 on 2025-03-20 + - name: Wait for Tests Results + uses: convictional/trigger-workflow-and-wait@v1.6.1 + with: + owner: ${{ secrets.NOTIFY_ORG }} + repo: ${{ secrets.NOTIFY_REPO }} + github_token: ${{ secrets.NOTIFY_PAT_TOKEN }} + workflow_file_name: integration-tests.yml + ref: master + wait_interval: 90 + client_payload: '{ "docsBranch": "${{ steps.branch-name.outputs.current_branch }}", "pullRequest": "${{ github.event.pull_request.number }}", "postStatus": "true" }' + propagate_failure: true + trigger_workflow: true + wait_workflow: true diff --git a/.github/workflows/push-notify.yml b/.github/workflows/push-notify.yml new file mode 100644 index 0000000000..a47e96380d --- /dev/null +++ b/.github/workflows/push-notify.yml @@ -0,0 +1,21 @@ +name: Push Notify +on: + workflow_dispatch: + push: + branches: + - main + - master +jobs: + dispatch: + runs-on: ubuntu-latest + steps: + - name: Webhook Notify + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.NOTIFY_PAT_TOKEN }} + script: | + await github.rest.repos.createDispatchEvent({ + owner: '${{ secrets.NOTIFY_ORG }}', + repo: '${{ secrets.NOTIFY_REPO }}', + event_type: 'docs_repo_webhook' + }) \ No newline at end of file diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml new file mode 100644 index 0000000000..19d6073644 --- /dev/null +++ b/.github/workflows/semgrep.yml @@ -0,0 +1,15 @@ +name: Semgrep +on: + pull_request: {} +jobs: + semgrep: + name: Scan + runs-on: ubuntu-latest + container: + image: returntocorp/semgrep + if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot') + steps: + - uses: actions/checkout@v3 + - run: semgrep ci + env: + SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index d8aa748141..58ce0eb185 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ config.json .idea # Visual Studio Code -.vscode/* +.vscode # Sublime Text *.sublime-project @@ -21,3 +21,4 @@ config.json *.swo Session.vim .netrwhist +.vscode \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..6e01ce3ba0 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,6 @@ +{ + "singleQuote": true, + "arrowParens": "always", + "printWidth": 120, + "trailingComma": "es5" +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 0aa52fd8a6..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -// Place your settings in this file to overwrite default and user settings. -{ - "editor.formatOnSave": false -} diff --git a/.vscode/spell.json b/.vscode/spell.json deleted file mode 100644 index e5133a8669..0000000000 --- a/.vscode/spell.json +++ /dev/null @@ -1 +0,0 @@ -{"language":"en","ignoreWordsList":["NuGet","RS256","Auth0","GitHub"],"mistakeTypeToStatus":{"Passive voice":"Hint","Spelling":"Error","Complex Expression":"Disable","Hidden Verbs":"Information","Hyphen Required":"Disable","Redundant Expression":"Disable","Did you mean...":"Disable","Repeated Word":"Warning","Missing apostrophe":"Warning","Cliches":"Disable","Missing Word":"Disable","Make I uppercase":"Warning"},"languageIDs":["markdown","text"],"ignoreRegExp":["/\\(.*\\.(jpg|jpeg|png|md|gif|JPG|JPEG|PNG|MD|GIF)\\)/g","/((http|https|ftp|git)\\S*)/g"]} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7d9f8afb9..0418e709cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ The following is a set of guidelines for contributing to the Auth0 documentation * Read and follow the [Style Guide](STYLEGUIDE.md). * Consult the [Words](WORDS.md) document for Auth0 specific spellings and definitions. * Always use relative URLs for internal `auth0.com/docs` links. For example, if the absolute path to the document is `https://auth0.com/docs/identityproviders`, use `/identityproviders`. These links will be correctly formatted in the build process. -* Do not hard code links to Auth0 sites like `docs.auth0.com` or `manage.auth0.com`. Instead, use [Parameter Aliases](#parameter-aliases), such as `${manage_url}`. +* Do not hard code links to Auth0 sites like `docs.auth0.com` or `manage.auth0.com`. Instead, use [Document Variables](#document-variables), such as `${manage_url}`. * Name files with all lowercase using dashes (-) to separate words. If using a date in the file name, it should be in the format YYYY-MM-DD. For example, `this-is-my-file.md` or `this-is-a-title-2015-10-01.md`. * Do not store images in external locations like Dropbox, CloudUp, or the Auth0 CDN. Link to images in this repo using a relative path `![ALT_TEXT](/media/folder/image-name.png)`. The image will be uploaded to the CDN and the link will be formatted during the build process. Do not forget to set the alternate text for each image. * Keep images to no more than 750 pixels wide. @@ -69,11 +69,33 @@ Additionally, you can send variables to the included document: ## Markdown -Markdown on this site conforms to the [CommonMark](http://commonmark.org/) spec. Additionally, there are a few custom markdown features available as described below. +Markdown on this site conforms to the [CommonMark](http://commonmark.org/) spec. Additionally, there are a few custom Markdown features available as described below. + +You should [test your Markdown](http://markdownlivepreview.com) to ensure the formatting is correct. ### Headings -One common mistake with formatting of headings is to not include a space between the hashes and the text. Some markdown processors allow this, but we do not. You must put a space as shown below. +Add one to six `#` symbols before your heading text to create your header. The number of # you use determines the size of the heading. + +``` +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 +``` + +The header text above renders as follows: + +# H1 +## H2 +### H3 +#### H4 +##### H5 +###### H6 + +One common mistake with formatting of headings is to not include a space between the hashes and the text. Some Markdown processors allow this, but we do not. You must put a space as shown below. INVALID: `#My Heading` @@ -82,8 +104,8 @@ VALID: `# My Heading` ### UI Components General advice: -- Don't add custom UI components with HTML unless it's really necessary. -- Don't add any element before the main title. If you want to show some general information for the whole doc put the element after the main title. +- Do not add custom UI components with HTML unless it's really necessary. +- Do not add any element before the main title. If you want to show some general information for the whole doc put the element after the main title. - Try to keep the amount of UI components on your docs to a minimum. They make the documentation more difficult to read and cut the reading flow. - Only use the `blockquote` element (`>` in markdown) to represent actual quotes. Use a `note` or a `panel` if you want to highlight the information. @@ -95,7 +117,7 @@ Only use this if the content is brief (one to four lines), if not use the `panel ```markdown ::: note - If you need a refresher on the OAuth 2.0 protocol, you can go through our OAuth 2.0 article. +If you need a refresher on the OAuth 2.0 protocol, you can go through our OAuth 2.0 article. ::: ``` @@ -145,7 +167,7 @@ Description ::: ::: panel-warning Security Warning -It is important to understand that the Authorization Code flow should only be used in cases such as a Regular Web Application where the Client Secret can be safely stored. In cases such as a Single Page Application, the Client Secret is available to the client (in the web browser), so the integrity of the Client Secret cannot be maintained. That is why the [Implicit Grant flow](/api-auth/grant/implicit) is more appropriate in that case. +It is important to understand that the Authorization Code flow should only be used in cases such as a Regular Web Application where the Client Secret can be safely stored. In cases such as a Single-Page Application, the Client Secret is available to the client (in the web browser), so the integrity of the Client Secret cannot be maintained. That is why the [Implicit Flow](/flows/concepts/implicit) is more appropriate in that case. ::: ``` @@ -266,7 +288,7 @@ For close-ups and other screenshots that do not include the browser window, appl You can set various properties of articles in the front matter of the document. Each document should have the `title` and `description` properties set. You can set other variables depending on the document. -`toc` adds a table of content dropdown at the top of the document, that lists all the paragraphs of the doc. By default it's disabled. Set it to `true` to display the dropdown. +`toc` adds a table of content dropdown at the top of the document, that lists all the paragraphs of the doc. By default it is disabled. Set it to `true` to display the dropdown. Example front matter: @@ -297,14 +319,14 @@ url: /path/to/document We use a pre-commit hook that lints the edited files to ensure a consistent style in the docs. We use [markdownlint](https://github.com/DavidAnson/markdownlint) with the rules specified in the `.markdownlint.json` file in the root of the repo to do this. You can [check more about the linting rules](https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md). -You won't be able to commit if your edited file don't follow these guidelines. +You will not be able to commit if your edited file does not follow these guidelines. -If you are using VS Code as your code editor, it's highly recommended to install the [MarkdownLint VS Code Extension](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint). +If you are using VS Code as your code editor, it is highly recommended to install the [MarkdownLint VS Code Extension](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint). ## Sidebar When you are adding a new article you should always add a link to it in the `config/sidebar.yml` file. -It's really important to represent all our articles in the sidebar because this will help the user see where they are inside the documentation. +It is really important to represent all our articles in the sidebar because this will help the user see where they are inside the documentation. You can add titles to the sidebar using the attribute `category`: @@ -369,10 +391,10 @@ To create and submit a job to Wordy: You will need to provide the following pieces of information: * **Language**: Set to *English (US)*. * **Content rewrite**: Select this option if you are okay with your editor rewriting your text for improved flow and natural use of language. If this option is *not* selected, your editor will simply check for spelling, grammar, punctuation, consistency, and structure. -* **Brief to editor**: Provide any information you'd like your editor to keep in mind when editing your work. For a starter snippet, please see our sample on [Notes to Wordy Editors](wordy-guide.md) +* **Brief to editor**: Provide any information you would like your editor to keep in mind when editing your work. For a starter snippet, please see our sample on [Notes to Wordy Editors](wordy-guide.md) * **Save my brief and language settings for future jobs**: Select this box to persist your chosen settings. 5. Upload files. You may choose to upload external files containing your text or paste in the text you want edited. -6. After you've completed the above steps, you'll get an instant price quote and an approximate delivery time for your job. If this is acceptable to you, click on **Create Job** to begin the editing process. +6. After you have completed the above steps, you will get an instant price quote and an approximate delivery time for your job. If this is acceptable to you, click on **Create Job** to begin the editing process. ### Word Count and Wordy Submissions @@ -386,7 +408,7 @@ It is helpful to include some instructions for the Wordy editors to let them kno ### Notes -* You can cancel a job if it hasn’t been picked up by an editor. If the job has been picked up, you can contact the editor and request a cancellation, though it is at the editor's discretion whether or not to cancel the job. +* You can cancel a job if it has not been picked up by an editor. If the job has been picked up, you can contact the editor and request a cancellation, though it is at the editor's discretion whether or not to cancel the job. * During the editing process, you can contact your editor from the job's page. You can include last-minute instructions, corrections, and so on. Conversely, your editor can contact you during the process if they have any questions about your text. You will be notified by email if you receive any messages. * If you are unsatisfied with the work completed by your editor, you can send your work back. This includes issues where you find errors in the text or the instructions in your brief haven't been followed. You can contact your editor by using the **Conversation History** feature on the job's page. @@ -534,7 +556,7 @@ Each framework will have a set of articles that comprise the quickstarts. The se #### Libraries -As appropriate every framework/language should have libraries to help with common functions. THese libraries will include things like: +As appropriate, every framework/language should have libraries to help with common functions. These libraries will include things like: * Management API Libraries * Authentication API Libraries @@ -563,7 +585,7 @@ In this way, each section of the quickstart has a sample showing the appropriate ##### Sample README’s -The README for each sample folder should be written to reflect the objectives of the sample and should also show some important code snippets. The goal is to give the reader context in a quick and concise way while outlining exactly what learning outcomes can be expected. It’s important to make content within each README specific to the subject sample. +The README for each sample folder should be written to reflect the objectives of the sample and should also show some important code snippets. The goal is to give the reader context in a quick and concise way while outlining exactly what learning outcomes can be expected. It is important to make content within each README specific to the subject sample. * **Example**: 02-User-Profile * **Title**: “User Profile” @@ -587,12 +609,12 @@ Each sample repo should have appropriate CI setup. You should use the appropriat In the case of things like iOS and Android samples, we should build with multiple version of Android/Xcode, etc. You can see an example here: 1. No need to write code or specialized guide for mobile -2. We don't have a lot of stuff finished to be doing this one in mobile. +2. We do not have a lot of stuff finished to be doing this one in mobile. 3. No need to write code or specialized guide for mobile until we allow users to enroll mfa from mobile apps. Currently is web only ### Seed Projects -Each quickstart should have a seed project. The seed projects are hosted in github in the `auth0-samples` organization. In order to add a seed project to a quickstart simply use the `_package` include. +Each quickstart should have a seed project. The seed projects are hosted on github in the `auth0-samples` organization. In order to add a seed project to a quickstart simply use the `_package` include. The seed project packager service replaces placeholder configuration values with the values of the user's real application. This means the sample is ready to use without additional configuration. The strings that get set are shown below. @@ -608,7 +630,7 @@ These values can be replaced in any file in the repo. Common examples of where y | `TENANT` | `{TENANT}` | The tenant name of the currentAuth0 account. | `CALLBACK_URL` | `{CALLBACK_URL}` | This sets the callback url for the application. | | `MOBILE_CUSTOM_SCHEME` | `{MOBILE_CUSTOM_SCHEME}` | This a unique ID for mobile apps. The string is `a0` + the value of the client ID. | -| `RANDOM_STRING_64` | `{RANDOM_STRING_64}` | This is a random string. Typically used for things like encryption keys, etc. For security reasons we set this with a reasonable default so if end-users forget to change them, they wont all be something like `YOUR_ENCRYPTION_KEY`. | +| `RANDOM_STRING_64` | `{RANDOM_STRING_64}` | This is a random string. Typically used for things like encryption keys, etc. For security reasons, we set this with a reasonable default so if end-users forget to change them, they won't all be something like `YOUR_ENCRYPTION_KEY`. | Example `.env` file: @@ -757,10 +779,9 @@ When writing docs you can use the following variables instead of hard-coding the | Variable | Description | Default Value | | :---------------------------- | :----------------------------------------- | :-------------------------------------- | | `manage_url` | The url to the management portal. | `https://manage.auth0.com` | -| `auth0js_url` | The url to the auth0.js v7 CDN location. | | +| `auth0js_url` | The url to the auth0.js CDN location. | | | `auth0js_urlv8` | The url to the auth0.js v8 CDN location. | | | `lock_url` | The url to the Lock script CDN location. | | -| `lock_passwordless_url` | The url to the Passwordless Lock script CDN location. | | | `env.DOMAIN_URL_SUPPORT` | Support Center URL | `https://support.auth0.com` | ### User Specific Variables @@ -867,7 +888,7 @@ example/ index.yml ``` -This limitation is a result of the implementation of `AutoVersionPlugin`, and how the paths are calculated for the different versions. Fixing this is possible, but makes things a little more tricky, so I decided to cut it from the first version of the feature. If it's a desired behavior we can always add it later. +This limitation is a result of the implementation of `AutoVersionPlugin`, and how the paths are calculated for the different versions. Fixing this is possible, but makes things a little more tricky, so I decided to cut it from the first version of the feature. If it is a desired behavior we can always add it later. #### Case Sensitive diff --git a/LICENSE b/LICENSE index 0d651713af..9595798aa0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Auth0, Inc. (http://auth0.com) +Copyright (c) 2015-present Auth0, Inc. (http://auth0.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 46ec9f5e12..1388ddcc84 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,29 @@ # Auth0 Documentation -This is the repository for the Auth0 documentation. + +This repository contains the Auth0 Quickstarts, but most other documentation content in this repository is no longer up to date, and is not the source of content at https://auth0.com/docs. Pull requests and issues for Quickstarts can still be submitted here, but most other content is no longer hosted on GitHub and therefore no longer open-source. If you are an Auth0 employee trying to make a change to other documentation, please [submit a ticket](https://auth0team.atlassian.net/servicedesk/customer/portal/9) or contact the Documentation Team to request access to our content management system. + **Please review the [Contributing Guidelines](CONTRIBUTING.md) before sending a PR or opening an issue.** -## Running the Docs Site -You can run and test the docs site locally (you will need access - only employees). For instructions on running the site and testing see the [README](https://github.com/auth0/auth0-docs/blob/master/README.md) (requires Auth0 team access). +* If you are looking for the application that *hosts* the Docs content, see [auth0-docs](https://github.com/auth0/auth0-docs). +* If you would like to modify the Management API v2 API docs, they are generated from the [api2](https://github.com/auth0/api2) repository. + +Both of the above repositories require team access. + +## Editing Docs Content +Auth0 Docs are no longer maintained in this Github repository. Employees can request access to our content management system to update Docs directly. Outside contributors can submit requests under the [Issues](https://github.com/auth0/docs/issues) section in this repository. + +## Editing Quickstart Content + +* You can edit the Quickstarts by using the GitHub web editor and editing a file. This is best suited for typos and small changes. +* You can also pull down the `/docs` repo to your computer via Git and edit files in your local editor before pushing a new branch (or a branch to your own fork of the project). You can then go to GitHub.com and start a PR. We will be able to review the changes in a Heroku test application prior to merging. +* Lastly, you can [run and test the docs site locally](https://github.com/auth0/auth0-docs/blob/master/README.md) (access available to Auth0 employees only). This option is best suited for repeat contributors or for complex contributions. You gain the benefit of locally testing and viewing your changed or added pages, navigation, and config, but you also gain the complexity of dealing with the local docs app, setting it up, and keeping it updated. + +Regardless of which option you use, please review any relevant sections of the [Contributing Guidelines](CONTRIBUTING.md) before sending a PR. ## Issue Reporting -If you found a bug or have a feature request, please report it in this repository's [issues](https://github.com/auth0/docs/issues) section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. +If you find a bug or inaccuracy in the documentation content, please report it in this repository's [issues](https://github.com/auth0/docs/issues) section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues. ## Author diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 5a4e27545d..12a59bbc8c 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -2,13 +2,13 @@ This style guide covers the terminology and content specific to Auth0, along with some comments on common writing issues. -For general software-industry styles and terminology, see the [Microsoft Manual of Style](https://eucalyptus.atlassian.net/wiki/download/attachments/76611622/microsoft_manual_of_style_fourth_edition.pdf?version=2&modificationDate=1424379604164&api=v2). +For general software-industry styles and terminology, see the [Microsoft Writing Style Guide](https://docs.microsoft.com/en-us/style-guide/welcome/). ## Voice * Address the reader directly: "you". Use "we" only for Auth0's recommendations. -* Use active voice. -* For instructions, use imperative mood. +* Use the active voice. +* For instructions, use the imperative mood. | **Incorrect** | **Correct** | | --- | --- | @@ -21,11 +21,11 @@ For general software-industry styles and terminology, see the [Microsoft Manual | --- | --- | | The user enters his password. | The user enters their password. | -* Avoid gerunds in headings and main body. +* Avoid gerunds in headings and the main body. | **Incorrect** | **Correct** | | --- | --- | -| Saving User Authentication Data | Save User Authentication Data | +| Saving User Authentication Data. | Save User Authentication Data. | | Setting up the authorization process requires an ID Token and a valid Access Token. | To set up the authorization process, you need an ID Token and a valid Access Token. | ## Body text @@ -110,6 +110,16 @@ For general software-industry styles and terminology, see the [Microsoft Manual | Mar. 15 | March 15 | | 15 March 2048 | March 15, 2048 | +* Endpoint names should be capitalized when used in-text: Discovery endpoint, Authorization endpoint, Token endpoint. +* Endpoints with names longer than one or two words should also be capitalized with the exception of prepositions and articles (i.e. with, to, the, a, an) such as Update a Hook endpoint. +* Endpoint names denoted as a path should not be capitalized but should be in monospace font: `/authorize,` `/post_user_import,` `/clients.` + +| **Incorrect** | **Correct** | +| --- | --- | +| You will need to access the discovery endpoint. | You will need to access the Discovery endpoint.| +| The get user endpoint allows you to search based on a variety of criteria. | The Get User endpoint allows you to search based on a variety of criteria. | +| The POST /login/callback endpoint can accept a sing-on SAML request from an identity provider. | The POST '/login/callback' endpoint can accept a sing-on SAML request from an identity provider. | + * Spell out whole numbers from zero to nine. * Write numerically numbers from 10 up and fractions. * Spell out any number that starts a sentence. @@ -122,10 +132,10 @@ For general software-industry styles and terminology, see the [Microsoft Manual | 14 plugins are available. | Fourteen plugins are available. | | Configure 12 50GB drives | Configure twelve 50GB drives. | -* For additional information that is up to four lines long, use [notes](/blob/master/CONTRIBUTING.md#note). -* For additional information that is longer than four lines, use [panels](https://github.com/auth0/docs/blob/master/CONTRIBUTING.md#panels). -* For critical security information up to four lines long, use [warnings](https://github.com/auth0/docs/blob/master/CONTRIBUTING.md#warning). -* For critical security information longer than four lines, use [panel warnings](https://github.com/auth0/docs/blob/master/CONTRIBUTING.md#panel-warning). +* For additional information that is up to four lines long, use [notes](CONTRIBUTING.md#note). +* For additional information that is longer than four lines, use [panels](CONTRIBUTING.md#panels). +* For critical security information up to four lines long, use [warnings](CONTRIBUTING.md#warning). +* For critical security information longer than four lines, use [panel warnings](CONTRIBUTING.md#panel-warning). ## Vocabulary @@ -180,7 +190,7 @@ For general software-industry styles and terminology, see the [Microsoft Manual ### The dashboard -* Dashboard: the [Auth0 management console](${manage_url}) +* Dashboard: the [Auth0 management console](${manage_url}). * The dashboard elements are called "section", "tab", "field". * Dashboard-related terminology: ![](/media/readme/structure.png) @@ -191,4 +201,4 @@ For general software-industry styles and terminology, see the [Microsoft Manual * Tenant: a logical isolation unit of the products we offer. Examples of Auth0 tenants: `foo.auth0.com`, `bar.auth0.com` * Auth0 tenants: regular cloud tenants * Subscription: a contract or service plan. Examples of subscriptions: trial, free, developer or developer-pro -* Private instances: appliance instances +* Private Cloud/Managed Private Cloud: single-tenant deployment diff --git a/WORDS.md b/WORDS.md index 96d6f6142a..4764298894 100644 --- a/WORDS.md +++ b/WORDS.md @@ -4,7 +4,7 @@ This document contains spellings and definitions as they are to be used in the A - **Login / Log in**: Use *log in* as a verb, or *login* as a noun. Do NOT use *log into* or *login to*. - **Logout / Log out**: Use *log out* as a verb, or *logout* as a noun. - **Setup / Set up**: Use *set up* as a verb, or *setup* as a noun. -- **Multi-factor**: Use instead of multifactor in the case of multi-factor authentication. +- **Multi-factor**: Use *multi-factor* instead of *multifactor* in the case of multi-factor authentication. - **Rollout / Roll out**: Use *rollout* as a noun and *roll out* as a verb. Do not use `roll-out`. - **Email**: Use the un-hyphenated "email" to refer to an email address. - **Click**: Use "Click on" when referring to text links in a webpage or UI, "Click" when referring to a button. For example: Click **Save**. Click on **This link**. @@ -39,10 +39,10 @@ When writing about tokens, capitalize specific token names as follows: * Access Token * Refresh Token -#### Within Appliance subscriptions +#### Within Private Cloud subscriptions * **Auth0 tenants** refers to regular cloud tenants -* **Private instances** refers to appliance instances +* **Private Cloud** or **Managed Private Cloud** refers to a single-tenant deployment ### TL;DR diff --git a/app.json b/app.json index 0b45ad2eb6..838727dbce 100644 --- a/app.json +++ b/app.json @@ -2,6 +2,12 @@ "name": "auth0-docs-content", "scripts": { }, + "formation": { + "web": { + "quantity": 1, + "size": "standard-2x" + } + }, "env": { "NPM_CONFIG_PRODUCTION": { "required": true @@ -15,6 +21,9 @@ "HEROKU_APP_NAME": { "required": true }, + "HEROKU_PARENT_APP_NAME": { + "required": true + }, "GIT_SSH_KEY": { "required": true } diff --git a/articles/_includes/_api-auth-customize-tokens.md b/articles/_includes/_api-auth-customize-tokens.md index 460c8a3a61..0c5ca2a2e3 100644 --- a/articles/_includes/_api-auth-customize-tokens.md +++ b/articles/_includes/_api-auth-customize-tokens.md @@ -15,5 +15,5 @@ function(user, context, callback) { ``` ::: panel-warning Namespacing Custom Claims -Auth0 returns profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID Tokens or Access Tokens, they must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims) to avoid possible collisions with standard OIDC claims. For example, if you choose the namespace `https://foo.com/` and you want to add a custom claim named `myclaim`, you would name the claim `https://foo.com/myclaim`, instead of `myclaim`. You can [add namespaced claims using Rules](#optional-customize-the-tokens). +Auth0 returns profile information in a [structured claim format as defined by the OpenID Connect (OIDC) specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID Tokens or Access Tokens, they must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims) to avoid possible collisions with standard OIDC claims. You can [add namespaced claims using Rules](#optional-customize-the-tokens). ::: diff --git a/articles/_includes/_api_auth_intro.md b/articles/_includes/_api_auth_intro.md index 5c08bc937f..c7b3365570 100644 --- a/articles/_includes/_api_auth_intro.md +++ b/articles/_includes/_api_auth_intro.md @@ -1,3 +1,3 @@ ::: note -**New to Auth?** Learn [How Auth0 works](/overview) and read about [API authorization](/api-auth). +**New to Auth0?** Learn how Auth0 works and read about implementing API authentication and authorization using the OAuth 2.0 framework. ::: diff --git a/articles/_includes/_callback_url.md b/articles/_includes/_callback_url.md index cfe0b9e0f9..3d4851c568 100644 --- a/articles/_includes/_callback_url.md +++ b/articles/_includes/_callback_url.md @@ -1,5 +1,5 @@ -### Configure Callback URLs + -A callback URL is a URL in your application where Auth0 redirects the user after they have authenticated. +### Configure Callback URLs -You need to whitelist the callback URL for your app in the **Allowed Callback URLs** field in your [Application Settings](${manage_url}/#/applications/${account.clientId}/settings). If you do not set any callback URL, your users will see a mismatch error when they log in. \ No newline at end of file +A callback URL is a URL in your application where Auth0 redirects the user after they have authenticated. The callback URL for your app must be added to the **Allowed Callback URLs** field in your Application Settings. If this field is not set, users will be unable to log in to the application and will get an error. diff --git a/articles/_includes/_checksession_polling.md b/articles/_includes/_checksession_polling.md index 89d2c15614..9030fb5770 100644 --- a/articles/_includes/_checksession_polling.md +++ b/articles/_includes/_checksession_polling.md @@ -1,3 +1,3 @@ -In some multi-application scenarios, where Single Log Out is desired (a user logging out of one application needs to be logged out of other applications), an application can be set up to periodically poll Auth0 using `checkSession()` to see if a session exists. If the session does not exist, you can then log the user out of the application. The same polling method can be used to implement silent authentication for a Single Sign On scenario. +In some multi-application scenarios, where Single Logout is desired (a user logging out of one application needs to be logged out of other applications), an application can be set up to periodically poll Auth0 using `checkSession()` to see if a session exists. If the session does not exist, you can then log the user out of the application. The same polling method can be used to implement silent authentication for a Single Sign-on (SSO) scenario. -The poll interval between checks to `checkSession()` should be at least 15 minutes between calls to avoid any issues in the future with rate limiting of this call. \ No newline at end of file +The poll interval between checks to `checkSession()` should be at least 15 minutes between calls to avoid any issues in the future with rate limiting of this call. diff --git a/articles/_includes/_co_authenticate_errors.md b/articles/_includes/_co_authenticate_errors.md index 3f0ba837a4..af87d27465 100644 --- a/articles/_includes/_co_authenticate_errors.md +++ b/articles/_includes/_co_authenticate_errors.md @@ -12,7 +12,6 @@ The error description is human readable. It **should not be parsed by any code** | 401 | unauthorized_client | Cross origin login not allowed. | | 400 | unsupported_credential_type | Unknown credential type parameter. | | 400 | invalid_request | Unknown realm non-existent-connection. | -| 403 | access_denied | Invalid user credentials. | | 403 | access_denied | Wrong email or password. | | 403 | access_denied | Authentication error | | 403 | blocked_user | Blocked user | diff --git a/articles/_includes/_contact-sales.md b/articles/_includes/_contact-sales.md index 5cbeffc9e2..b5a08e1e82 100644 --- a/articles/_includes/_contact-sales.md +++ b/articles/_includes/_contact-sales.md @@ -1,3 +1,3 @@ ## More Information -If you have specific support requirements or need more information on the Professional Services we offer, please [contact sales](https://auth0.com/?contact=true). +If you have specific support requirements or need more information about the Professional Services we offer, please [contact Auth0 Sales](https://auth0.com/get-started?place=documentation%20post&type=link&text=contact%20auth0%20sales). diff --git a/articles/_includes/_create_resource_server.md b/articles/_includes/_create_resource_server.md index d35141540d..e879837b6a 100644 --- a/articles/_includes/_create_resource_server.md +++ b/articles/_includes/_create_resource_server.md @@ -1,6 +1,6 @@ ## Create the API -Your resource server (API) needs to be configured to verify the Access Token and any claims contained within it. When you create a resource server in your Auth0 dashboard, it utilizes the RS256 signature method by default, meaning that Access Tokens are signed using Auth0's private key for your account. Verification is done using the corresponding public key. You can read more about the [JSON Web Key Set (JWKS)](/jwks) standard and also view the [public key](https://${account.namespace}/.well-known/jwks.json) for your Auth0 account (https://${account.namespace}/.well-known/jwks.json). +Your resource server (API) needs to be configured to verify the Access Token and any claims contained within it. When you create a resource server in your Auth0 dashboard, it utilizes the RS256 signature method by default, meaning that Access Tokens are signed using Auth0's private key for your account. Verification is done using the corresponding public key. You can read more about the [JSON Web Key Set (JWKS)](/tokens/concepts/jwks) standard and also view the [public key(s)](https://${account.namespace}/.well-known/jwks.json) for your Auth0 account (https://${account.namespace}/.well-known/jwks.json). You can also learn how to [manage your signing keys](/tokens/guides/manage-signing-keys). You can use any [recommended JWT library](https://jwt.io) to validate the standard claims returned in the token. The following example will demonstrate how to create a resource server API with Node. You can find more information about resource server implementations in the [Access Token documentation](https://auth0.com/docs/api-auth/config/asking-for-access-tokens). @@ -21,7 +21,7 @@ const jwt = require('express-jwt'); const jwksRsa = require('jwks-rsa'); const authenticate = jwt({ - // Dynamically provide a signing key based on the kid in the header and the singing keys provided by the JWKS endpoint. + // Dynamically provide a signing key based on the kid in the header and the signing keys provided by the JWKS endpoint. secret: jwksRsa.expressJwtSecret({ cache: true, rateLimit: true, diff --git a/articles/_includes/_deprecate-delegation.md b/articles/_includes/_deprecate-delegation.md new file mode 100644 index 0000000000..7317d51f14 --- /dev/null +++ b/articles/_includes/_deprecate-delegation.md @@ -0,0 +1,3 @@ +::: warning +By default, delegation is disabled for tenants without an add-on in use as of 8 June 2017. Legacy tenants who currently use an add-on that requires delegation may continue to use this feature. If delegation functionality is changed or removed from service at some point, customers who currently use it will be notified beforehand and given ample time to migrate. +::: \ No newline at end of file diff --git a/articles/_includes/_deprecate-impersonation.md b/articles/_includes/_deprecate-impersonation.md index 5eac3124cf..4f58b1bb31 100644 --- a/articles/_includes/_deprecate-impersonation.md +++ b/articles/_includes/_deprecate-impersonation.md @@ -1,3 +1,3 @@ -:::warning -Impersonation has been deprecated and will not be enabled for customers in the future. The functionality will continue to work for the customers that currently have it enabled. If at some point the impersonation feature is changed or removed from service, customers who currently use it will be notified beforehand and given ample time to migrate. -::: \ No newline at end of file +::: warning +Impersonation has been deprecated and will not be enabled for new customers. The functionality will continue to work for existing customers who currently have it enabled. If at some point the impersonation feature is changed or removed from service, customers who currently use it will be notified beforehand and given ample time to migrate. +::: diff --git a/articles/_includes/_email-domain-blacklist.md b/articles/_includes/_email-domain-blacklist.md new file mode 100644 index 0000000000..1fdcdd1fc2 --- /dev/null +++ b/articles/_includes/_email-domain-blacklist.md @@ -0,0 +1,3 @@ +::: warning +Auth0 blacklists certain "false" domains commonly used during testing. Use real email addresses to avoid disruption or `domain is blacklisted` errors. +::: diff --git a/articles/_includes/_embedded_login_warning.md b/articles/_includes/_embedded_login_warning.md index 09391e236d..f37d242c2d 100644 --- a/articles/_includes/_embedded_login_warning.md +++ b/articles/_includes/_embedded_login_warning.md @@ -1,3 +1,3 @@ ::: warning -Embedded login for web uses Cross Origin Authentication. In some browsers [this can be unreliable](/cross-origin-authentication#limitations-of-cross-origin-authentication) if you do not set up a [Custom Domain](/custom-domains) **and host your app on the same domain**. Using Custom Domains with Auth0 is a paid feature. If you cannot use Custom Domains, consider [migrating to Universal Login](/guides/login/migration-embedded-universal). +Embedded login for web uses Cross Origin Authentication. In some browsers [this can be unreliable](/cross-origin-authentication#limitations) if you do not set up a [Custom Domain](/custom-domains) **and host your app on the same domain**. Using Custom Domains with Auth0 is a paid feature. If you cannot use Custom Domains, consider [migrating to Universal Login](/guides/login/migration-embedded-universal). ::: \ No newline at end of file diff --git a/articles/_includes/_enable-third-party-apps-info.md b/articles/_includes/_enable-third-party-apps-info.md new file mode 100644 index 0000000000..e540021871 --- /dev/null +++ b/articles/_includes/_enable-third-party-apps-info.md @@ -0,0 +1,3 @@ +::: note +To use this feature, you must [enable third-party applications for your Auth0 tenant](/applications/guides/enable-third-party-apps). +::: diff --git a/articles/_includes/_enable_idp_initiated.md b/articles/_includes/_enable_idp_initiated.md deleted file mode 100644 index 374a3e9221..0000000000 --- a/articles/_includes/_enable_idp_initiated.md +++ /dev/null @@ -1,26 +0,0 @@ -If you are using [Auth0.js](/libraries/auth0js), you have to update the **webAuth.parseHash** of the [library](/libraries/auth0js/v9#extract-the-authresult-and-get-user-info) and set the flag **__enableIdPInitiatedLogin** to `true`. - -```javascript -var data = webAuth.parseHash( - { - ... - __enableIdPInitiatedLogin: true - ... - } -``` - -If you're using [Lock](/lock), you can include the flag using the options parameter sent to the constructor. - -```javascript -const lock = new Auth0Lock(clientID, domain, options) -``` - -Here's the flag itself: - -```javascript -var options = { - _enableIdPInitiatedLogin: true -}; -``` - -Note that the **enableIdPInitiatedLogin** flag is preceded by **one** underscore when used with Lock and **two** underscores when used with the auth0.js library. diff --git a/articles/_includes/_enforce-claim-namespacing.md b/articles/_includes/_enforce-claim-namespacing.md new file mode 100644 index 0000000000..3b593d6ccf --- /dev/null +++ b/articles/_includes/_enforce-claim-namespacing.md @@ -0,0 +1,5 @@ +::: warning +By default, Auth0 always enforces namespacing; any custom claims with non-namespaced identifiers will be silently excluded from tokens. + +We do allow non-OIDC claims without a namespace for legacy tenants using a non-OIDC-conformant pipeline with the **Legacy User Profile** enabled, but we strongly recommend that legacy tenants migrate to an OIDC-conformant flow. +::: \ No newline at end of file diff --git a/articles/_includes/_http-method.html b/articles/_includes/_http-method.html index 42cf02bee8..cacd38d8f0 100644 --- a/articles/_includes/_http-method.html +++ b/articles/_includes/_http-method.html @@ -1,4 +1,4 @@ -
+

${http_method} ${path} -

\ No newline at end of file + \ No newline at end of file diff --git a/articles/_includes/_ip_whitelist.md b/articles/_includes/_ip_whitelist.md index 76a8d744b5..a3d9ad21b8 100644 --- a/articles/_includes/_ip_whitelist.md +++ b/articles/_includes/_ip_whitelist.md @@ -1,3 +1,3 @@ -## Network Firewall - +::: note Network Firewall If you are behind a firewall, this feature may require [whitelisting of the appropriate Auth0 IP addresses](/guides/ip-whitelist) to work properly. +::: diff --git a/articles/_includes/_libraries_support_frameworks.html b/articles/_includes/_libraries_support_frameworks.html index 3e3ec91472..b14527fae5 100644 --- a/articles/_includes/_libraries_support_frameworks.html +++ b/articles/_includes/_libraries_support_frameworks.html @@ -27,16 +27,6 @@ v1
Supported
- - Auth0 ASP.NET 4.5 Owin - v2 -
Supported
- - - Auth0 ASP.NET - v1 -
Supported
- OIDC Client for .NET Desktop and Mobile applications v1 @@ -47,15 +37,5 @@ v3
Supported
- - Auth0 with UWP applications - v1 -
Community
- - - Auth0 application for Winforms and WPF - v0.9 -
Community
- diff --git a/articles/_includes/_libraries_support_lock.html b/articles/_includes/_libraries_support_lock.html index 54a62fd2f9..b23b2b155f 100644 --- a/articles/_includes/_libraries_support_lock.html +++ b/articles/_includes/_libraries_support_lock.html @@ -18,7 +18,7 @@
Supported
- + Lock.Android v1
Bug fixes
@@ -27,7 +27,7 @@ v2
Supported
- + Lock for iOS v1 v1
Bug fixes
diff --git a/articles/_includes/_libraries_support_sdks.html b/articles/_includes/_libraries_support_sdks.html index 662bb4932a..9fae1bad76 100644 --- a/articles/_includes/_libraries_support_sdks.html +++ b/articles/_includes/_libraries_support_sdks.html @@ -7,6 +7,16 @@ + + Auth0 Single Page Application SDK + v1 +
Supported
+ + + Auth0 React SDK + v1 +
Supported
+ Auth0.js v9 @@ -27,11 +37,6 @@ v4
Supported
- - - v3 -
Supported
- Auth0 Java v1 @@ -49,7 +54,7 @@ Auth0 PHP - v5 + v7.3
Supported
diff --git a/articles/_includes/_linking_accounts.md b/articles/_includes/_linking_accounts.md index f79677c8ea..547909a2a2 100644 --- a/articles/_includes/_linking_accounts.md +++ b/articles/_includes/_linking_accounts.md @@ -1,4 +1,4 @@ -There may be situations when your users want to log in with multiple accounts that they own. In these cases, you may want to link these accounts together so that they are all reflected in the user's Auth0 profile. For example, if a user has signed up with an email and password (which provides very little information about them), you can ask them to link their account to an OAuth provider like Facebook or Google to gain access to their social profile. For a detailed description of linking accounts, see the [full documentation](https://auth0.com/docs/link-accounts). +There may be situations when your users want to log in with multiple accounts that they own. In these cases, you may want to link these accounts together so that they are all reflected in the user's Auth0 profile. For example, if a user has signed up with an email and password (which provides very little information about them), you can ask them to link their account to an OAuth provider like Facebook or Google to gain access to their social profile. See [User Account Linking](/users/concepts/overview-user-account-linking) for details. ## Linking Accounts diff --git a/articles/_includes/_lock_auth0js_deprecations_notice.md b/articles/_includes/_lock_auth0js_deprecations_notice.md index f989f7af01..9e03f9bb98 100644 --- a/articles/_includes/_lock_auth0js_deprecations_notice.md +++ b/articles/_includes/_lock_auth0js_deprecations_notice.md @@ -1,3 +1,3 @@ ::: panel-warning Lock and Auth0.js Deprecations -The Lock v8, v9, and v10 widgets as well as the Auth0.js v6, v7, and v8 SDKs are deprecated and should be migrated away from prior to their removal from service on July 16, 2018. The [Deprecation Guidance](/migrations/guides/legacy-lock-api-deprecation) page provides details about update recommendations. +The Lock v8, v9, and v10 widgets as well as the Auth0.js v6, v7, and v8 SDKs are deprecated and should be migrated away from prior to their removal from service on July 16, 2018. ::: \ No newline at end of file diff --git a/articles/_includes/_logout_url.md b/articles/_includes/_logout_url.md new file mode 100644 index 0000000000..ed3e9ac189 --- /dev/null +++ b/articles/_includes/_logout_url.md @@ -0,0 +1,11 @@ + + +### Configure Logout URLs + +A logout URL is a URL in your application that Auth0 can return to after the user has been logged out of the authorization server. This is specified in the `returnTo` query parameter. The logout URL for your app must be added to the **Allowed Logout URLs** field in your Application Settings. If this field is not set, users will be unable to log out from the application and will get an error. + +<% if (typeof(returnTo) !== "undefined") { %> + ::: note + If you are following along with the sample project you downloaded from the top of this page, the logout URL you need to add to the **Allowed Logout URLs** field is `${returnTo}`. + ::: +<% } %> diff --git a/articles/_includes/_metadata_on_signup_warning.md b/articles/_includes/_metadata_on_signup_warning.md new file mode 100644 index 0000000000..1af9aab000 --- /dev/null +++ b/articles/_includes/_metadata_on_signup_warning.md @@ -0,0 +1,3 @@ +::: note +When setting the `user_metadata` field using the Authentication API's [Signup endpoint](/api/authentication?javascript#signup), you are limited to a maximum of 10 `String` fields and 500 characters. +::: diff --git a/articles/_includes/_native_passwordless_warning.md b/articles/_includes/_native_passwordless_warning.md index 11aeffa50a..04eaae8300 100644 --- a/articles/_includes/_native_passwordless_warning.md +++ b/articles/_includes/_native_passwordless_warning.md @@ -1,3 +1,3 @@ ::: warning -Passwordless functionality should not be embedded in native apps until Auth0 libraries can be updated to properly support it. Until that time, passwordless authentication can still be achieved by using [Universal Login](/connections/passwordless/native-passwordless-universal) via the web. +This functionality has been deprecated in native. After June 2017, tenants cannot use the native passwordless flow. The functionality will continue to work for tenants that currently have it enabled. If at some point the passwordless mode feature is changed or removed from service, customers who currently use it will be notified beforehand and given ample time to migrate. ::: diff --git a/articles/_includes/_new_api.html b/articles/_includes/_new_api.html index 5ef9d7f6ff..924a36341f 100644 --- a/articles/_includes/_new_api.html +++ b/articles/_includes/_new_api.html @@ -1,5 +1,5 @@ <% if (account.userName) { %> -

In the APIs section in dashboard, click the Create API button. Provide a Name and Identifier for your API. You must choose the RS256 signing algorithm. Once it is created, navigate to the Scopes tab and create the applicable scopes for your API.

+

In the APIs section in dashboard, click the Create API button. Provide a Name and Identifier for your API. You must choose the RS256 signing algorithm. Once it is created, navigate to the Scopes tab and create the applicable scopes for your API.

<% } else { %> -

Create an Auth0 account (or login) navigate to the APIs section in Dashboard. Click the Create API button and provide a Name and Identifier for your API. You must choose the RS256 signing algorithm. Once it is created, navigate to the Scopes tab and create the applicable scopes for your API.

+

Create an Auth0 account (or login) navigate to the APIs section in Dashboard. Click the Create API button and provide a Name and Identifier for your API. You must choose the RS256 signing algorithm. Once it is created, navigate to the Scopes tab and create the applicable scopes for your API.

<% } %> \ No newline at end of file diff --git a/articles/_includes/_new_app.md b/articles/_includes/_new_app.md index 6552703e35..4d390027eb 100644 --- a/articles/_includes/_new_app.md +++ b/articles/_includes/_new_app.md @@ -1,18 +1,28 @@ ## Configure Auth0 ### Get Your Application Keys -When you signed up for Auth0, a new application was created for you, or you could have created a new one. +When you signed up for Auth0, a new application was created for you, or you could have created a new one. You will need some details about that application to communicate with Auth0. You can get these details from the Application Settings section in the Auth0 dashboard. -Your will need some details about that application to communicate with Auth0. You can get these details from the [Application Settings](${manage_url}/#/applications/${account.clientId}/settings) section in the Auth0 dashboard. +<% if(typeof hideDashboardScreenshot === 'undefined' || hideDashboardScreenshot !== true) { %> +![App Dashboard](/media/articles/dashboard/client_settings.png) +<% } %> + +<% if(typeof isPublicClient === 'undefined' || isPublicClient === true) { %> +::: note +When using the Default App with a Native or Single Page Application, ensure to update the **Token Endpoint Authentication Method** to `None` and set the **Application Type** to either `SPA` or `Native`. +::: +<% } %> You need the following information: -* **Client ID** -* **Domain** -::: note -If you download the sample from the top of this page these details are filled out for you. +* **Domain** +* **Client ID** +<% if(typeof showClientSecret !== 'undefined' && showClientSecret === true) { %> +* **Client Secret** +<% } %> -If you have more than one application in your account, the sample comes with the values for your **Default App**. +<% if(typeof hideDownloadSample === 'undefined' || hideDownloadSample !== true) { %> +::: note +If you download the sample from the top of this page, these details are filled out for you. ::: - -![App Dashboard](/media/articles/dashboard/client_settings.png) +<% } %> diff --git a/articles/_includes/_parental-consent.md b/articles/_includes/_parental-consent.md new file mode 100644 index 0000000000..eaa0337c61 --- /dev/null +++ b/articles/_includes/_parental-consent.md @@ -0,0 +1,3 @@ +::: note +If you require a specialized consent prompt, for example a parental consent, you need to build your own custom consent form. Be aware that laws vary according to country. +::: \ No newline at end of file diff --git a/articles/_includes/_rbac_methods.md b/articles/_includes/_rbac_methods.md new file mode 100644 index 0000000000..57feb5baa3 --- /dev/null +++ b/articles/_includes/_rbac_methods.md @@ -0,0 +1,8 @@ +Currently, we provide two ways of implementing [role-based access control (RBAC)](/authorization/concepts/rbac), which you can use in place of or in combination with your API's own internal access control system: + +* [Authorization Core](/authorization/guides/how-to) +* [Authorization Extension](/extensions/authorization-extension) + +We are expanding our Authorization Core feature set to match the functionality of the Authorization Extension. Our new core RBAC implementation improves performance and scalability and will eventually provide a more flexible RBAC system than the Authorization Extension. + +For now, both implement the key features of RBAC and allow you to restrict the custom scopes defined for an API to those that have been assigned to the user as permissions. For a comparison, see [Authorization Core vs. Authorization Extension](/authorization/concepts/core-vs-extension). \ No newline at end of file diff --git a/articles/_includes/_rbac_vs_extensions.md b/articles/_includes/_rbac_vs_extensions.md new file mode 100644 index 0000000000..58e7c0af76 --- /dev/null +++ b/articles/_includes/_rbac_vs_extensions.md @@ -0,0 +1,5 @@ +::: warning +The [Authorization Core](/authorization/guides/how-to) feature set and [Authorization Extension](/extensions/authorization-extension) are completely separate features. To manage groups, roles, or permissions, you will need to use the feature they were originally created in. + +Although the [Delegated Administration Extension](/extensions/delegated-admin) and the [Authorization Core](/authorization/guides/how-to) feature set are completely separate features, you can use the Authorization Core feature set to create and manage roles for the DAE if you use a rule. To learn how, see [Sample Use Cases: Rules with Authorization](/authorization/concepts/sample-use-cases-rules#manage-delegated-administration-extension-roles-using-the-authorization-core-feature-set). +::: \ No newline at end of file diff --git a/articles/_includes/_refresh_token_rotation_panel.md b/articles/_includes/_refresh_token_rotation_panel.md new file mode 100644 index 0000000000..bb3221d0ff --- /dev/null +++ b/articles/_includes/_refresh_token_rotation_panel.md @@ -0,0 +1,3 @@ +::: note +If you have [Refresh Token Rotation](/tokens/concepts/refresh-token-rotation) enabled, a new Refresh Token is generated with each request and issued along with the Access Token. When a Refresh Token is exchanged, the previous Refresh Token is invalidated but information about the relationship is retained by the authorization server. +::: diff --git a/articles/_includes/_refresh_token_rotation_recommended.md b/articles/_includes/_refresh_token_rotation_recommended.md new file mode 100644 index 0000000000..5f52feeac1 --- /dev/null +++ b/articles/_includes/_refresh_token_rotation_recommended.md @@ -0,0 +1,3 @@ +::: panel Refresh Token Rotation +Recent advancements in user privacy controls in browsers adversely impact the user experience by preventing access to third-party cookies. Auth0 recommends using [Refresh Token Rotation](/tokens/concepts/refresh-token-rotation), which provides a secure method for using refresh tokens in SPAs while providing end-users with seamless access to resources without the disruption in UX caused by browser privacy technology like ITP. +::: diff --git a/articles/_includes/_samesite_none.md b/articles/_includes/_samesite_none.md new file mode 100644 index 0000000000..9449a343c0 --- /dev/null +++ b/articles/_includes/_samesite_none.md @@ -0,0 +1,10 @@ +::: note +Previously in Auth0, the [`samesite` cookie attribute](/sessions/concepts/cookie-attributes) options were `true`, `false`, `strict` or `lax`. If you didn't set the attribute manually, Auth0 would use the default value of `false`. + +Effective February 2020, Google Chrome v80 will change the way it handles cookies. To that end, Auth0 plans on implementing the following changes to how it handles cookies: + +* Cookies without the `samesite` attribute set will be set to `lax` +* Cookies with `sameSite=none` must be secured, otherwise they cannot be saved in the browser's cookie jar + +The goal of these changes are to improve security and help mitigate CSRF attacks. +::: diff --git a/articles/_includes/_test-this-endpoint.md b/articles/_includes/_test-this-endpoint.md index a6c6a1ff29..e2d873ea5d 100644 --- a/articles/_includes/_test-this-endpoint.md +++ b/articles/_includes/_test-this-endpoint.md @@ -1,5 +1,4 @@ -You can use our **Authentication API Debugger** extension to test this endpoint. In order to do so you need to be logged in and have installed the [Authentication API Debugger extension](/extensions/authentication-api-debugger). - + Click on **Install Debugger** to go to the article that explains how (you only have to do this once). <% diff --git a/articles/_includes/_token_signature.md b/articles/_includes/_token_signature.md new file mode 100644 index 0000000000..6af09f7685 --- /dev/null +++ b/articles/_includes/_token_signature.md @@ -0,0 +1,9 @@ + + +### Verify JWT Token Signature setting + +JSON Web Tokens (JWTs) should be signed using the RS256 signing algorithm where possible, as it provides [enhanced security over HS256](https://auth0.com/docs/tokens/concepts/signing-algorithms#our-recommendation). + +RS256 is the default, but if you are [running into errors](https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token) you can verify your settings by clicking on **Show Advanced Settings** at the bottom of your Auth0 Application settings screen in the dashboard. Click the **OAuth** tab to show the signature algorithm configuration. **JsonWebToken Signature Algorithm** should be set to **RS256**, and the **OIDC Conformant** setting should be enabled. + +![Token Signature Algorithm configuration](/media/articles/applications/token-signature-algorithm.png) diff --git a/articles/_includes/_users_update_normalized_profile_attributes.md b/articles/_includes/_users_update_normalized_profile_attributes.md new file mode 100644 index 0000000000..822a2e3d50 --- /dev/null +++ b/articles/_includes/_users_update_normalized_profile_attributes.md @@ -0,0 +1,3 @@ +By default, user profile attributes provided by identity providers other than Auth0 (such as Google, Facebook, Twitter) are not directly editable because they are updated from the identity provider each time the user logs in. + +To be able to edit the `name`, `nickname`, `given_name`, `family_name`, or `picture` root attributes on the normalized user profile, you must [configure your connection sync with Auth0](/dashboard/guides/connections/configure-connection-sync) so that user attributes will be updated from the identity provider only on user profile creation. These root attributes will then be available to be [edited individually](/api/management/guides/users/update-root-attributes-users) or [by bulk import](/api/management/guides/users/set-root-attributes-user-import) using the Management API. diff --git a/articles/_includes/_uses-delegation.md b/articles/_includes/_uses-delegation.md new file mode 100644 index 0000000000..2a157656f4 --- /dev/null +++ b/articles/_includes/_uses-delegation.md @@ -0,0 +1,3 @@ +::: warning +This feature uses delegation. By default, delegation is disabled for tenants without an add-on in use as of 8 June 2017. Legacy tenants who currently use an add-on that requires delegation may continue to use this feature. If delegation functionality is changed or removed from service at some point, customers who currently use it will be notified beforehand and given ample time to migrate. In addition, note that delegation does not support the use of custom domains so any features depending on it may not be fully functional alongside a custom domain. +::: diff --git a/articles/_includes/_version_warning_api.md b/articles/_includes/_version_warning_api.md index 66611c792b..bf86f5773c 100644 --- a/articles/_includes/_version_warning_api.md +++ b/articles/_includes/_version_warning_api.md @@ -1,3 +1,3 @@ ::: warning -This version of the Management API has been deprecated. We recommend that you use the [new version](/api/management/v2) instead. +This version of the Management API has been deprecated. We recommend that you use the [new version](/api/management/v2) instead. Please refer to the [Migration Guide](/migrations/guides/management-api-v1-v2) for more information. ::: diff --git a/articles/_includes/_version_warning_lock.md b/articles/_includes/_version_warning_lock.md index fecd55b49d..707490b682 100644 --- a/articles/_includes/_version_warning_lock.md +++ b/articles/_includes/_version_warning_lock.md @@ -1,3 +1,3 @@ ::: version-warning -This document covers a deprecated version of Lock which uses endpoints that have been removed from service. It will no longer function as expected. We recommend that you [migrate to Lock v11](/libraries/lock/v11/migration-guide) as soon as possible. +This document covers a deprecated version of Lock which uses endpoints that have been removed from service. It will no longer function as expected. We recommend that you migrate to Lock v11 as soon as possible. ::: \ No newline at end of file diff --git a/articles/_includes/_web_origins.md b/articles/_includes/_web_origins.md new file mode 100644 index 0000000000..27ba7150f1 --- /dev/null +++ b/articles/_includes/_web_origins.md @@ -0,0 +1,5 @@ + + +### Configure Allowed Web Origins + +You need to add the URL for your app to the **Allowed Web Origins** field in your Application Settings. If you don't register your application URL here, the application will be unable to silently refresh the authentication tokens and your users will be logged out the next time they visit the application, or refresh the page. \ No newline at end of file diff --git a/articles/_includes/_webtask.md b/articles/_includes/_webtask.md new file mode 100644 index 0000000000..71356fc124 --- /dev/null +++ b/articles/_includes/_webtask.md @@ -0,0 +1,3 @@ +::: warning +Only tenants created prior to 17 July 2018 have access to Webtask.io and the Webtask CLI. If you are an enterprise customer with a newer tenant, please contact your account representative to request access. Other requests can be made through the [Auth0 Contact Form](https://auth0.com/get-started?place=documentation%20post&type=link&text=auth0%20contact%20form) and will be evaluated on a case-by-case basis. +::: diff --git a/articles/addons/azure-blob-storage.md b/articles/addons/azure-blob-storage.md index d9bf7d076b..fa945a5c8b 100644 --- a/articles/addons/azure-blob-storage.md +++ b/articles/addons/azure-blob-storage.md @@ -1,6 +1,8 @@ --- addon: Azure Blob Storage +title: Azure Blob Storage Add-on thirdParty: true +public: false url: /addons/azure-blob-storage alias: - azure blob storage @@ -13,13 +15,15 @@ topics: articles: - authenticate contentType: how-to -description: This tutorial will show you how to use the Auth0 to authenticate and authorize Azure Blob Storage. +description: Learn how to use Auth0 to authenticate and authorize Azure Blob Storage. useCase: integrate-third-party-apps --- -# Azure Blob Storage Addon +# Azure Blob Storage Add-on -Here's a sample call to the delegation endpoint to get the SAS: +<%= include('../_includes/_uses-delegation') %> + +Here's a sample call to the delegation endpoint to get the Shared Access Signature (SAS): ```text POST https://${account.namespace}/delegation @@ -47,7 +51,7 @@ The result of calling the delegation endpoint will be something like: } ``` -You can use the blob SAS token either by appending it to a url directly or by passing it to one of the Azure Storage SDKs. +You can use the blob SAS token either by appending it to a URL directly or by passing it to one of the Azure Storage SDKs. ```text GET https://{STORAGEACCOUNT}.blob.core.windows.net/mycontainer/myblob.txt?st=2015-01-08T18%3A45%3A14Z&se=2015-01-08T18%3A50%3A14Z&sp=r&sv=2014-02-14&sr=b&sig=13ABC456... diff --git a/articles/addons/azure-mobile-services.md b/articles/addons/azure-mobile-services.md index 3e494778c1..2d88dd226a 100644 --- a/articles/addons/azure-mobile-services.md +++ b/articles/addons/azure-mobile-services.md @@ -1,6 +1,8 @@ --- -addon: Azure Mobile Services +addon: Windows Azure Mobile Services +title: Windows Azure Mobile Services Add-on thirdParty: true +public: false url: /addons/azure-mobile-services image: /media/platforms/azure.png snippets: @@ -18,14 +20,22 @@ topics: - addons contentType: how-to useCase: integrate-third-party-apps -description: This tutorial will show you how to use the Auth0 to authenticate and authorize Azure Mobile Services. +description: Learn how to use Auth0 to authenticate and authorize Windows Azure Mobile Services (WAMS). --- -# Azure Mobile Services Addon +# Windows Azure Mobile Services Add-on + +<%= include('../_includes/_uses-delegation') %> ## 1. Create an application -WAMS endpoints can be used from anywhere. For example: [Android](/native-platforms/android), [iOS](/native-platforms/ios-objc), [Windows UWP C#](/native-platforms/windows-uwp-csharp), [JavaScript](/application-platforms/vanillajs) or [Windows Phone](/native-platforms/windowsphone). You can use any of these tutorials for configuring an app that interacts with WAMS. +Windows Azure Mobile Services (WAMS) endpoints can be used from anywhere. To configure an app that interacts with WAMS, you can use any of the following tutorials: + +- [Android](/quickstart/native/android) +- [iOS](/quickstart/native/ios-objc) +- [Windows UWP C#](/quickstart/native/windows-uwp-csharp) +- [JavaScript](/quickstart/spa/vanillajs) +- [Windows Phone](/quickstart/native/wpf-winforms) The samples that you can download from the Azure Portal are a good starting point. @@ -43,7 +53,7 @@ The important aspects of these lines are: 1. The `Auth0Client` class takes 2 parameters: your `namespace` and the `clientId` of the application. 2. There are various overloads for the `LoginAsync` method. In the example above, all options will be presented to the user. You can use other versions of `LoginAsync` to direct login to a specific provider. For example: `LoginAsync("github")` will have users login exclusively with GitHub. -3. The `GetDelegationToken` call exchanges the application token (received in step #2) for another token to be used for with WAMS. +3. The `GetDelegationToken` call exchanges the application token (received in step #2) for another token to be used with WAMS. 4. The input for the `GetDelegationToken` method is the `clientID` of your WAMS enabled app. 5. A new `MobileServiceUser` object is created with the new information. @@ -51,7 +61,7 @@ The `GetDelegationToken` call allows your app to interact with multiple WAMS API For example, you can login a user with GitHub, then connect them to WAMS and also interact with an AWS hosted endpoint. The delegation call allows you to flow the identity of the user securely across multiple environments. -## 3. Using the user identity in the WAMS backend +## 3. Use the user identity in the WAMS backend The final step is to use the information in the token in the server code. Most likely you will have to do the following two things: diff --git a/articles/addons/azure-sb.md b/articles/addons/azure-sb.md index 6415a4dafe..da89208289 100644 --- a/articles/addons/azure-sb.md +++ b/articles/addons/azure-sb.md @@ -1,6 +1,8 @@ --- addon: Azure Service Bus +title: Azure Service Bus Add-on thirdParty: true +public: false url: /addons/azure-sb alias: - Azure Service Bus @@ -13,12 +15,14 @@ articles: - authenticate contentType: how-to useCase: integrate-third-party-apps -description: This tutorial will show you how to use the Auth0 to authenticate and authorize Azure Service Bus. +description: Learn how to use Auth0 to authenticate and authorize Azure Service Bus. --- -# Azure Service Bus Addon +# Azure Service Bus Add-on -Here's a sample call to the delegation endpoint to get the SAS: +<%= include('../_includes/_uses-delegation') %> + +Here's a sample call to the delegation endpoint to get the Shared Access Signature (SAS): ```text POST https://${account.namespace}/delegation diff --git a/articles/addons/index.md b/articles/addons/index.md index 0e9878cd7f..bd86928457 100644 --- a/articles/addons/index.md +++ b/articles/addons/index.md @@ -1,32 +1,48 @@ --- url: /addons -description: How to setup Application Addons, like Amazon Web Services and Azure Blob Storage, with your Auth0 app. +title: Add-ons +description: Learn about add-ons and how they are related to Auth0-registered Applications. +public: false topics: - - addons -contentType: - - index - - how-to -useCase: integrate-third-party-apps + - applications + - add-ons +contentType: + - concept + - index +useCase: + - build-an-app + - integrate-third-party-apps --- -# Auth0 Application Addons +# Add-ons -Addons are plugins associated with an Application in Auth0. Usually, they are 3rd party APIs used by the application that Auth0 generates Access Tokens for (such as Salesforce, Azure Service Bus, Azure Mobile Services, SAP, and so on). +<%= include('../_includes/_uses-delegation') %> -## How to configure an Addon +Add-ons are plugins associated with an application registered with Auth0. Usually, they are third-party APIs used by application(s) for which Auth0 generates Access Tokens (e.g., Salesforce, Azure Service Bus, Windows Azure Mobile Services, SAP). -Go to [Dashboard > Applications > Settings > Addons](${manage_url}/#/applications/${account.clientId}/addons) page and use the toggle to enable the add-on you want to configure. +Some typical scenarios for using add-ons include: -![Application Addons](/media/addons/manage-addons.png) +* **Accessing External APIs**: Using the Delegation endpoint, you can exchange your application's Access Token for a third-party service's (e.g., Salesforce, Amazon) Access Token. -Each integration is different and requires different parameters and configuration. Once the addon is activated, you will see tailored instructions with details on how to integrate with it in the dashboard. +* **Integrating with Applications using SAML2/WS-Federation**: Since Add-ons allow you to configure every aspect of the SAML2/WS-Federation integration, they allow you to integrate with any custom or Single Sign-on (SSO) integration that does not currently enjoy built-in Auth0 support. -## Additional information for specific Addons +![Addons Example Diagram](/media/articles/applications/applications-addon-types.png) -- Amazon Web Services: For more info on how to use delegation with the AWS API Gateway, see the [AWS API Gateway](/integrations/aws-api-gateway/delegation) Tutorial -- [Azure Blob Storage](/addons/azure-blob-storage) -- [Azure Mobile Services](/addons/azure-mobile-services) -- [Azure Service Bus](/addons/azure-sb) -- [Salesforce (sandbox)](/addons/salesforce-sandbox) -- [Salesforce](/addons/salesforce) -- [SAP OData](/addons/sap-odata) +## Available Add-ons + +- Amazon Web Services +- Firebase +- Layer +- Salesforce +- Salesforce (Sandbox) +- SAP +- Azure Mobile Services +- Azure Service Bus +- Azure Blob Storage +- SAML2 +- WS-Fed + +## Keep reading + +- [View Add-ons](/dashboard/guides/applications/view-addons) +- [Set Up Add-Ons](/dashboard/guides/applications/set-up-addons) \ No newline at end of file diff --git a/articles/addons/salesforce-sandbox.md b/articles/addons/salesforce-sandbox.md index b3e41c7abe..79bd815fe1 100644 --- a/articles/addons/salesforce-sandbox.md +++ b/articles/addons/salesforce-sandbox.md @@ -1,11 +1,13 @@ --- addon: Salesforce (sandbox) +title: Salesforce (Sandbox) Add-on thirdParty: true +public: false url: /addons/salesforce-sandbox alias: - salesforce image: /media/addons/salesforce_sandbox_api.svg -description: This tutorial will show you how to use the Auth0 to authenticate and authorize your Salesforce (Sandbox) services. +description: Learn how to use Auth0 to authenticate and authorize your Salesforce (Sandbox) services. topics: - salesforce - addons @@ -13,9 +15,11 @@ useCase: integrate-third-party-apps contentType: how-to --- -# Salesforce (Sandbox) Addon +# Salesforce (Sandbox) Add-on -Auth0 supports both the __production__ connection to Salesforce and the __Sandbox__, the only difference being the endpoints hosted by Salesforce: `https://login.salesforce.com` and `https://test.salesforce.com` respectively. +<%= include('../_includes/_uses-delegation') %> + +Auth0 supports both the __production__ connection to Salesforce and the __Sandbox__, the only difference being the endpoints hosted by Salesforce: `https://login.salesforce.com` and `https://test.salesforce.com`, respectively. ::: note Under the hood, Auth0 uses OAuth 2.0 JWT Bearer Token Flow to obtain an Access Token. All details of construction of the right JWT are taken care of by Auth0. diff --git a/articles/addons/salesforce.md b/articles/addons/salesforce.md index 459ccf89d4..54aa6bb93e 100644 --- a/articles/addons/salesforce.md +++ b/articles/addons/salesforce.md @@ -1,11 +1,13 @@ --- addon: Salesforce +title: Salesforce Add-on alias: - salesforce url: addons/salesforce thirdParty: true +public: false image: /media/addons/salesforce.svg -description: This tutorial will show you how to use the Auth0 to authenticate and authorize your Salesforce services. +description: Learn how to use Auth0 to authenticate and authorize your Salesforce services. topics: - salesforce - addons @@ -13,9 +15,11 @@ useCase: integrate-third-party-apps contentType: how-to --- -# Salesforce Addon +# Salesforce Add-on -Auth0 supports both the __production__ connection to Salesforce and the __Sandbox__, the only difference being the endpoints hosted by Salesforce: `https://login.salesforce.com` and `https://test.salesforce.com` respectively. +<%= include('../_includes/_uses-delegation') %> + +Auth0 supports both the __production__ connection to Salesforce and the __Sandbox__, the only difference being the endpoints hosted by Salesforce: `https://login.salesforce.com` and `https://test.salesforce.com`, respectively. The integration also supports getting tokens for __Salesforce Community Sites__. For this to work, you need to pass two additional parameters: diff --git a/articles/addons/sap-odata.md b/articles/addons/sap-odata.md index 8f12ed5b8d..4c5db1bcce 100644 --- a/articles/addons/sap-odata.md +++ b/articles/addons/sap-odata.md @@ -1,10 +1,12 @@ --- addon: SAP OData +title: SAP OData Add-on alias: - sap url: /addons/sap-odata image: /media/addons/sap_api.svg -description: This tutorial will show you how to use the Auth0 to authenticate and authorize your SAP OData services. +description: Learn how to use Auth0 to authenticate and authorize your SAP OData services. +public: false topics: - sap - addons @@ -13,14 +15,16 @@ useCase: integrate-third-party-apps contentType: how-to --- -# SAP OData Addon +# SAP OData Add-on + +<%= include('../_includes/_uses-delegation') %> ::: warning This integration is in experimental mode. Contact us if you have questions. ::: ::: note - Under the hood, Auth0 uses SAML 2.0 Bearer Assertion Flow for OAuth 2.0 to obtain an Access Token. All details of construction of the right SAML token are taken care of by Auth0. + Under the hood, Auth0 uses SAML 2.0 Bearer Assertion Flow for OAuth 2.0 to obtain an Access Token. All details of construction of the right SAML token are taken care of by Auth0. ::: ![](/media/articles/server-apis/sap-data-flow.png) diff --git a/articles/analytics/_includes/_install.md b/articles/analytics/_includes/_install.md new file mode 100755 index 0000000000..4e86feb323 --- /dev/null +++ b/articles/analytics/_includes/_install.md @@ -0,0 +1,20 @@ +## Install + +To add the <%- name %> integration to your app, include a reference to the `Auth0 Analytics.js` script on any pages with Auth0 Lock. Include the script reference **after**** Lock *and* set the configuration options before the script reference. + +``` + + + +``` + +::: note +The script version above uses a placeholder version `X.Y.Z`. For example, to reference release, 1.3.1 use `https://cdn.auth0.com/js/analytics/1.3.1/analytics.min.js`. You can [find the latest release's version number](https://github.com/auth0/auth0-analytics.js/releases/) on GitHub. +::: diff --git a/articles/analytics/_includes/_usage.md b/articles/analytics/_includes/_usage.md new file mode 100755 index 0000000000..9d4a7485c2 --- /dev/null +++ b/articles/analytics/_includes/_usage.md @@ -0,0 +1,20 @@ +## Usage + +After installation on your site, you will start collecting data. Auth0 Analytics will immediately begin sending events to <%- name %>. + +You will see the following events being logged: + +* Auth0 Lock show +* Auth0 Lock hide +* Auth0 Lock unrecoverable_error +* Auth0 Lock authenticated +* Auth0 Lock authorization_error +* Auth0 Lock forgot_password ready +* Auth0 Lock forgot_password submit +* Auth0 Lock signin submit +* Auth0 Lock signup submit +* Auth0 Lock federated login + +Note that some events that Lock emits like `hash_parsed` are not used for analytics purposes. Also, be aware that some events are only available in newer versions of Lock. If you are using an older version of Lock you will only see some of these events. We suggest upgrading to the latest version of Lock to get the most of the Auth0 Analytics integration. + +For more information on the events that are sent see the [Lock API documentation](/libraries/lock/v11/api#on-). diff --git a/articles/analytics/guides/facebook-analytics.md b/articles/analytics/guides/facebook-analytics.md new file mode 100644 index 0000000000..bc4093476f --- /dev/null +++ b/articles/analytics/guides/facebook-analytics.md @@ -0,0 +1,69 @@ +--- +description: Learn how to install and configure the Facebook Analytics for Auth0 integration. +topics: + - facebook + - analytics +public: false +contentType: how-to +useCase: + - manage-analytics + - analyze-external-analytics +--- +# Integrate Facebook Analytics with Auth0 + +Install and configure the **Facebook Analytics for Auth0** integration on your own page that is using [Lock](/libraries/lock) or the [hosted Lock pages](/universal-login). You can configure funnels and reports inside of Facebook Analytics to get the most out of this integration. + +<%= include('../_includes/_install', { name: "Facebook Analytics" }) %> + +## Setup + +If you already have either the Facebook Tracking Pixel or the Facebook Javascript SDK referenced on your site, configure Auth0 Analytics with the `preload` option as shown below. If you don't have either script loaded you need to set your Facebook Analytics App ID using the Facebook Javascript SDK configuration below. + +We recommend [creating funnels](https://www.facebook.com/help/analytics/935921203105136) to measure the success of your acquisition and registration flows using these new events. + +### Configure Facebook Javascript SDK (Recommended) + +The simplest configuration is to let the Analytics script load the Facebook Javascript SDK. You can do this by providing your Facebook Analytics App ID to the analytics options as shown below. + +``` + +``` + +If you have already loaded the Facebook Javascript SDK on your site, configure Auth0 Analytics to not load it again as shown below. + +``` + +``` + +### Configure Facebook Pixel + +If you already have the Facebook Pixel installed on your site you can use that configuration mode. Note that with the Facebook Pixel, certain features of Facebook Analytics are not available. The configuration for using the pixel is shown below. + +``` + +``` + +<%= include('../_includes/_usage', { name: "Facebook Analytics" }) %> + +## Keep reading + +[Facebook Analytics documentation](https://www.facebook.com/help/analytics/1710582659188030) + diff --git a/articles/analytics/guides/google-analytics.md b/articles/analytics/guides/google-analytics.md new file mode 100644 index 0000000000..4367921202 --- /dev/null +++ b/articles/analytics/guides/google-analytics.md @@ -0,0 +1,46 @@ +--- +description: Learn how to install and configure the Google Analytics for Auth0 integration. +topics: + - google + - analytics +public: false +contentType: how-to +useCase: + - manage-analytics + - analyze-external-analytics +--- +# Integrate Google Analytics with Auth0 + +This article explains how to install and configure the **Google Analytics for Auth0** integration. You can use this integration on your own page that is using Lock. You can configure funnels and reports inside of Google Analytics to get the most out of this integration. + +## Setup + +1. Set analytics configuration options *before* you include the references to the Lock and Auth0 Analytics libraries. + + ```javascript + + ``` + +2. Include the script reference to the `auth0-analytics.js`. This needs to be included *after* the call to Lock. + + ```javascript + + + ``` + +::: note +The script version above uses a placeholder version `X.Y.Z`. For example, to reference release 1.3.1 use `https://cdn.auth0.com/js/analytics/1.3.1/analytics.min.js`. You can [find the latest release's version number](https://github.com/auth0/auth0-analytics.js/releases/) on GitHub. +::: + +<%= include('../_includes/_usage', { name: "Google Analytics" }) %> + +## Keep reading + +[Google Analytics documentation](https://support.google.com/analytics) diff --git a/articles/analytics/index.md b/articles/analytics/index.md new file mode 100755 index 0000000000..b40e0508b0 --- /dev/null +++ b/articles/analytics/index.md @@ -0,0 +1,38 @@ +--- +url: /analytics +section: articles +classes: topic-page +title: Analytics Integrations +topics: + - analytics +public: false +contentType: index +useCase: + - manage-analytics + - analyze-external-analytics +--- + +
+
+

Analytics Integrations

+

+ Setup and configure analytics integrations with Auth0. +

+
+ +Analytics tools help you track users on your site or application. Integrating third-party analytics tools with Auth0 enables you to capture and measure identity specific events. You can use this data to create funnels, measure user retention, and improve your sign up flow. + + diff --git a/articles/analytics/integrations/_install.md b/articles/analytics/integrations/_install.md deleted file mode 100644 index a89abef1c4..0000000000 --- a/articles/analytics/integrations/_install.md +++ /dev/null @@ -1,17 +0,0 @@ -## Install - -To add the <%- name %> integration to your app, include a reference to the `Auth0 Analytics.js` script on any pages with Auth0 Lock. Include the script reference after Lock and set the configuration options before the script reference. - -``` - - - -``` - -::: note -The script version above uses a placeholder version `X.Y.Z`. For example, to reference release 1.2.0 use `https://cdn.auth0.com/js/analytics/1.2.0/analytics.min.js`. To find the latest release, see the [releases on github](https://github.com/auth0/auth0-analytics.js/releases/). -::: \ No newline at end of file diff --git a/articles/analytics/integrations/_usage.md b/articles/analytics/integrations/_usage.md deleted file mode 100644 index 756e06685b..0000000000 --- a/articles/analytics/integrations/_usage.md +++ /dev/null @@ -1,19 +0,0 @@ -## Usage -After installation on your site there is nothing else you need to do to start collecting data. Auth0 Analytics will immedately begin sending events to <%- name %>. - -You will see the following events being logged: - -* Auth0 Lock show -* Auth0 Lock hide -* Auth0 Lock unrecoverable_error -* Auth0 Lock authenticated -* Auth0 Lock authorization_error -* Auth0 Lock forgot_password ready -* Auth0 Lock forgot_password submit -* Auth0 Lock signin submit -* Auth0 Lock signup submit -* Auth0 Lock federated login - -Note that some events that Lock emits like `hash_parsed` are not used for analytics purposes. Also, be aware that some events are only availible in newer versions of Lock. If you are using an older version of Lock you will only see some of these events. We suggest upgrading to the latest version of Lock to get the most of the Auth0 Analytics integration. - -For more information on the events that are sent see the [Lock API documentation](/libraries/lock/v10/api). diff --git a/articles/analytics/integrations/facebook-analytics/index.md b/articles/analytics/integrations/facebook-analytics/index.md deleted file mode 100644 index 6916c36db7..0000000000 --- a/articles/analytics/integrations/facebook-analytics/index.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -description: This article explains how to install and configure the Facebook Analytics for Auth0 integration. -topics: - - facebook - - analytics -contentType: how-to -useCase: - - manage-analytics - - analyze-external-analytics ---- -# Facebook Analytics for Auth0 - -This article explains how to install and configure the **Facebook Analytics for Auth0** integration. You can use this integration on your own page that is using [Lock](/libraries/lock) or you can use this on the [hosted Lock pages](/hosted-pages/login). Additionally, you will find instructions on how to configure funnels and reports inside of Facebook Analytics to get the most out of this integration. - -<%= include('../_install', { name: "Facebook Analytics" }) %> - -## Setup - -There are several ways you can use the Facebook Analytics integration. If you already have either the Facebook Tracking Pixel or the Facebook Javascript SDK referenced on your site, configure Auth0 Analytics with the `preload` option as shown below. If you don't have either script loaded you need to set your Facebook Analytics App ID using the Facebook Javascript SDK configuration below. - -### Using Facebook Javascript SDK (Recommended) - -The simplest configuration is to let the Analytics script load the Facebook Javascript SDK. You can do this by providing your Facebook Analytics App ID to the analytics options as shown below. - -``` - -``` - -If you have already loaded the Facebook Javascript SDK on your site, configure Auth0 Analytics to not load it again as shown below. - -``` - -``` - -### Using Facebook Pixel - -If you already have the Facebook Pixel installed on your site you can use that configuration mode. Note that with the Facebook Pixel, certain features of Facebook Analytics are not availible. The configuration for using the pixel is shown below. - -``` - -``` - -<%= include('../_usage', { name: "Facebook Analytics" }) %> - -## Reporting - -For the most up to date information on using Facebook Analytics, check out the [Facebook Analytics documentation](https://www.facebook.com/help/analytics/1710582659188030). - -We recommend [creating funnels](https://www.facebook.com/help/analytics/935921203105136) to measure the success of your aquistion and registration flows using these new events. diff --git a/articles/analytics/integrations/google-analytics/index.md b/articles/analytics/integrations/google-analytics/index.md deleted file mode 100644 index 5505583bcc..0000000000 --- a/articles/analytics/integrations/google-analytics/index.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -description: This article explains how to install and configure the Google Analytics for Auth0 integration. -topics: - - google - - analytics - contentType: how-to -useCase: - - manage-analytics - - analyze-external-analytics ---- -# Google Analytics for Auth0 - -This article explains how to install and configure the **Google Analytics for Auth0** integration. You can use this integration on your own page that is using Lock or you can use this on the hosted Lock pages. Additionally, you will find instructions on how to configure funnels and reports inside of Google Analytics to get the most out of this integration. - -<%= include('../_install', { name: "Google Analytics" }) %> - -## Setup - -There are several ways you can use the Google Analytics integration. If you already have the Google Analytics Script on your site, configure Auth0 Analytics with the `preload` option as shown below. If you don't have Google Analytics loaded you need to set your Google Analytics ID using the Google Analytics configuration below. - -### Google Analytics Script Already Loaded (Recommended) - -If you have already loaded the Google Analytics script loaded on your site, configure Auth0 Analytics to not load it again as shown below. - -``` - -``` - -### No Google Analytics Script - -If you are not using Google Analytics already you can have the Auth0 Analytics script load Google Analytics for you. To do this you need to set your Google Analytics ID in the options as shown below. - -``` - -``` - -<%= include('../_usage', { name: "Google Analytics" }) %> - -## Reporting - -For the most up to date information on using Google Analytics, check out the [Google Analytics documentation](https://support.google.com/analytics). diff --git a/articles/analytics/integrations/index.md b/articles/analytics/integrations/index.md deleted file mode 100644 index 626fe96bdd..0000000000 --- a/articles/analytics/integrations/index.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -url: /analytics/integrations -section: articles -classes: topic-page -title: Analytics Integrations -topics: - - analytics -contentType: index -useCase: - - manage-analytics - - analyze-external-analytics ---- - -
-
-

Analytics Integrations

-

- How to setup and configure analytics integrations with Auth0. -

-
- -Analytics tools help you track users on your site or application. The Auth0 Analytics integrations enable you to capture and measure identity specific events. You can use this data to create funnels, measure user retention, and improve your sign up flow. - - diff --git a/articles/anomaly-detection/breached-passwords.md b/articles/anomaly-detection/breached-passwords.md deleted file mode 100644 index bb2a776a5e..0000000000 --- a/articles/anomaly-detection/breached-passwords.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -description: Explains why a user received a breached password email and general web security tips. -topics: - - security - - passwords -contentType: concept -useCase: customize-anomaly-detection ---- - -# Breached Password Security - -## What happened that I received an email saying "Please change your password immediately"? - -Your account could have possibly been hacked, compromised or stolen by a third party application that experienced a security breach. This breach did not happen to this account, but based on available data, your credentials may have been released. Since many people reuse passwords, we wanted to make sure you stay protected. - -You may also want to change your password at any other sites that you suspect you used a shared password. -Here are links for password resets on commonly used sites: -* [Google](https://www.google.com/accounts/recovery/) -* [Facebook](https://www.facebook.com/settings) -* [Twitter](https://twitter.com/settings/password) - -## General Security Tips - -You can't prevent certain sites from security breaches, but there are some things you can do to help keep your accounts safe. - -* **Check your emails carefully** -Make sure to check where an email is coming from, and the links that they provide. Often phishing emails do not include your name but something generic such as "Dear Customer". Always do a password reset through the actual site itself. -* **Never enter personal or financial information in an email** -Emails in general are not very secure, so this is not a good way to communicate sensitive information. A trusted company/application would not ask for your information in this way. Also watch out to make sure you are not entering confidential information through false the links provided in emails. A secure website always starts with “https”. -* **Never download files from unreliable sources** -Most web browsers detect suspicious sites, when you try to access a malicious site, an alert message will appear. Never download files from suspicious emails or websites. -* **Do not reuse passwords** -When one site has a breach of user data, if you use the same credentials elsewhere, your information in other sites can also be accessed. There are many password tools out there to help you keep track of passwords. -* **Use strong passwords** -The longer a password is, the harder it becomes to guess. Try to make passwords long and use a mix of special characters, numbers and upper and lowercase letters. -* **Keep software current** -Applications release patches and updates when they find security vulnerabilities in their systems. Keeping your applications, web browsers and operating system up to date can help prevent security breaches. \ No newline at end of file diff --git a/articles/anomaly-detection/concepts/breached-passwords.md b/articles/anomaly-detection/concepts/breached-passwords.md new file mode 100644 index 0000000000..92f077dc01 --- /dev/null +++ b/articles/anomaly-detection/concepts/breached-passwords.md @@ -0,0 +1,64 @@ +--- +title: Breached Password Security +description: Understand why a user receives a breached password email and general web security tips. +topics: + - security + - passwords +contentType: concept +useCase: customize-anomaly-detection +v2: true +--- + +# Breached Password Security + +When a user receives an email requesting that they change their password immediately, it is because their account could be the victim of a security breach. This may be the result of a compromise by a third-party application that experienced a security breach. The breach may not have happened to this account, but based on available data, the user's credentials may have been released. Since many people reuse passwords, the request to change passwords is a precaution to make sure the user stays protected. + +Users may also want to change their password at any other sites where they suspect they used a shared password. + +## General security tips + +Users can't usually prevent certain sites from experiencing security breaches, but there are some things they can do to help keep their accounts safe. + +### Check emails carefully + +Check where an email is coming from and the links that they provide. Often phishing emails do not include a user's name but something generic such as "Dear Customer." + +### Reset passwords directly from sites + +Always do a password reset through the actual site itself not via potentially false links in emails. Also note that secure website URL always starts with `https`. + +Here are some links for password resets on commonly used sites: +* [Google](https://www.google.com/accounts/recovery/) +* [Facebook](https://www.facebook.com/settings) +* [Twitter](https://twitter.com/settings/password) + +### Never enter personal or financial information in email + +Emails in general are not very secure and are not a good way to communicate sensitive information. A trusted company/application would not ask for information in this way. Make sure not to enter confidential information through false links in emails. + +### Never download files from unreliable sources + +Most web browsers detect suspicious sites. An alert should appear when you try to access a malicious site. Never download files from suspicious emails or websites. + +### Do not reuse passwords + +When one site has a breach of user data, if a user uses the same credentials elsewhere, information in other sites can also be accessed. The only way to prevent this is by not reusing passwords for multiple sites. The problem is that remembering countless passwords is frustrating and often impossible. One solution to this problem is the use of a password manager. There are many password managers available which can help users to use separate and secure passwords for each account, but at the same time not be responsible for remembering all of them. + +### Use strong passwords + +The longer a password is, the harder it becomes to be guessed via brute force methods. Many sites allow the use of pass-phrases (a phrase or sentence instead of just a complicate word.) Try to make passwords long and use a mix of special characters, numbers, and upper- and lowercase letters. + +### Keep software current + +Applications release patches and updates when they find security vulnerabilities in their systems. Keeping applications, web browsers, and operating systems up to date can help prevent security breaches. + +### Check the security of your email inbox + +If you use Gmail, Google offers the [Security Checkup](https://myaccount.google.com/security-checkup) tool to let you know if there are any security issues related to your inbox. + +You can also use third-party tools, such as websites like [HaveIBeenPwned](https://haveibeenpwned.com/PwnedWebsites) to see if there might be security issues associated with your email address. + +## Keep reading + +* [Anomaly Detection](/anomaly-detection) +* [Customize Blocked Account Emails](/anomaly-detection/guides/customize-blocked-account-emails) diff --git a/articles/anomaly-detection/guides/customize-blocked-account-emails.md b/articles/anomaly-detection/guides/customize-blocked-account-emails.md new file mode 100644 index 0000000000..1347250973 --- /dev/null +++ b/articles/anomaly-detection/guides/customize-blocked-account-emails.md @@ -0,0 +1,30 @@ +--- +title: Customize Blocked Account Emails +description: Learn how to customize blocked account emails. +topics: + - security + - anomaly-detection + - brute-force-protection + - breached-password-detection +contentType: how-to +useCase: customize-anomaly-detection +v2: true +--- +# Customize Blocked Account Emails + +When Auth0 sends an email to a user to notify them of the [breached password block action](/anomaly-detection/references/breached-password-detection-triggers-actions), the message contains a link to re-enable the origin of the request. + +::: note +Auth0 never blocks the user itself, just the attempts from the suspicious origin. +::: + +The email sent to the user looks like this: + +![Email Example](/media/articles/brute-force-protection/bfp-2015-12-29_1832.png) + +You can customize the template used for this message on the [Dashboard](${manage_url}/#/emails) under __Emails > Templates > Blocked Account Email__. + +## Keep reading + +* Learn more about [email templates](/email/templates). +* Understand [why a user receives a breached password email](/anomaly-detection/concepts/breached-passwords) and general web security tips. diff --git a/articles/anomaly-detection/guides/enable-disable-brute-force-protection.md b/articles/anomaly-detection/guides/enable-disable-brute-force-protection.md new file mode 100644 index 0000000000..e40844c3be --- /dev/null +++ b/articles/anomaly-detection/guides/enable-disable-brute-force-protection.md @@ -0,0 +1,29 @@ +--- +title: Enable and Disable Brute-Force Protection +description: Learn how to disable and enable brute-force protection. +topics: + - security + - anomaly-detection + - brute-force-protection +contentType: how-to +useCase: customize-anomaly-detection +v2: true +--- +# Enable and Disable Brute-Force Protection + +Brute-force protection is enabled by default for all connections. + +![Brute-Force Protection Shield](/media/articles/anomaly-detection/anomaly-detection-overview.png) + +::: warning +Auth0 strongly recommends that you **do not** set the `brute_force_protection` flag to `false` (effectively disabling brute-force protection for the connection), however if you do, you can change it back in the [Dashboard](${manage_url}/#/anomaly). +::: + +Once enabled, you can [customize](/anomaly-detection/guides/set-anomaly-detection-preferences#brute-force-protection-preferences) your brute-force protection settings. + +![Brute-Force Protection Shield](/media/articles/anomaly-detection/brute-force-shield.png) + +## Keep reading + +* [Brute-Force Protection Triggers and Actions](/anomaly-detection/references/brute-force-protection-triggers-actions) +* [Set Anomaly Detection Preferences](/anomaly-detection/guides/set-anomaly-detection-preferences) \ No newline at end of file diff --git a/articles/anomaly-detection/guides/prevent-credential-stuffing-attacks.md b/articles/anomaly-detection/guides/prevent-credential-stuffing-attacks.md new file mode 100644 index 0000000000..c4d5d0b291 --- /dev/null +++ b/articles/anomaly-detection/guides/prevent-credential-stuffing-attacks.md @@ -0,0 +1,91 @@ +--- +title: Prevent Credential Stuffing Attacks +description: Learn how to prevent credential stuffing attacks on your system. +beta: true +topics: + - anomaly-detection + - credential-stuffing +contentType: how-to +useCase: + - prevent-credential-stuffing +--- +# Prevent Credential Stuffing Attacks + +Credential stuffing attacks (also known as *list validation attacks*) occur when bad actors automate the process of trying username and password combinations (usually stolen from another site) for many accounts in a short period of time. According to recent statistics, as many as 71% of accounts use the same password across multiple sites so a credential stuffing attack has the potential to successfully log into your system. + +Consider, for example, the number of errors caused by an incorrect email or username (identified in the logs as type `fu`) for a particular tenant, which suggests an attack occurred November 20, with some abuse patterns afterwards: + +![Credential Stuffing Attack Example](/media/articles/anomaly-detection/credential-stuffing-attack.png) + +Auth0 provides a number of tools to combat credential stuffing attacks: + +* [Brute Force Protection](/anomaly-detection/guides/enable-disable-brute-force-protection) blocks login attempts after a number of consecutive failed logins. + +* [Breached Password Protection](/anomaly-detection/concepts/breached-passwords) identifies credentials that are known to be stolen. + +* [Multi-factor Authentication](/mfa) can be effective in preventing unauthorized logins, but it adds friction to the user experience. + +If you do not want to turn on additional features such as MFA, you can add **Automated Credential Stuffing Attack Protection** to provide a standard level of protection against credential stuffing attacks that does not add any friction to legitimate users. + +## How it works + +Auth0 uses a large amount of data to identify patterns that signal that a credential stuffing attack is taking place. Auth0 uses sophisticated algorithms to determine when bursts of traffic are likely to be from a bot or script. Users attempting to sign in from IPs which are determined to have a high likelihood of being a credential stuffing attack will see a Captcha step. The algorithms are designed so that this only happens for bad traffic; the objective is to not show any friction to legitimate users. + +![Captcha Login Screen Example](/media/articles/anomaly-detection/captcha-login-screen.png) + +## Enable automated credential stuffing attack protection + +### Prerequisites + +* Please read Auth0’s [Beta Service Terms](https://cdn.auth0.com/website/legal/terms/beta-service-terms-11-18-19.pdf) and acknowledge you have read and agreed to the terms by emailing **Antonio Fuentes** at **antonio.fuentes@auth0.com**. + +* Determine which type of login experience you have configured: + + - Go to [Dashboard](${manage_url}/#). + - Navigate to **Universal Login**. + - Determine which login experience is selected (Classic or New). + +### If you are using New Universal Login + +No further configuration is required. If you are part of the Beta program, the Early Access features will work for your tenant immediately. + +### If you are using Classic Universal Login + +Determine if your page is customized. + +1. Select the **Login** tab. + +2. Verify the status of the toggle **Customize Login Page**. + +3. If it is on, you have a customized login page. + +### If you are using customized Classic Universal Login + +Upgrade your version of Lock. + +1. Navigate to the **Universal Login** section in the Dashboard. + +2. Select the **Login** tab. + +3. Update your version of Auth0’s Lock to version v11.20 by replacing the script tag with the tag for version v11.20. + +For example, replace this tag: +```html + +``` + +With the following: +```html + +``` + +## Performance impact + +This feature is intended to reduce the number of login attempts associated with automated or scripted credential stuffing attacks. It is not expected to cause a degradation in the latency or performance of the login flows. Auth0 monitors the impact on these metrics and will share them with you. + +In addition, you can look at the [tenant logs](/anomaly-detection/guides/use-tenant-data-for-anomaly-detection). Events that indicate a credential stuffing attack is happening. + +- `f`: failed login +- `fu`: failed login due to invalid email/username + +If you have questions, you can contact Auth0 through your TAM or contact **antonio.fuentes@auth0.com**. diff --git a/articles/anomaly-detection/guides/set-anomaly-detection-preferences.md b/articles/anomaly-detection/guides/set-anomaly-detection-preferences.md new file mode 100644 index 0000000000..7096901ab2 --- /dev/null +++ b/articles/anomaly-detection/guides/set-anomaly-detection-preferences.md @@ -0,0 +1,70 @@ +--- +title: Set Anomaly Detection Preferences +description: Learn how to set anomaly detection preferences in the Dashboard. +topics: + - security + - anomaly-detection + - brute-force-protection + - breached-password-detection +contentType: how-to +useCase: customize-anomaly-detection +v2: true +--- +# Set Anomaly Detection Preferences + +Customize the actions that occur after the triggers in the **Anomaly Detection** section on the [Dashboard](${manage_url}/#/anomaly). + +::: warning +Auth0 recommends that you **do not** make changes to your anomaly detection features with the Management API. +::: + +![Anomaly Detection Dashboard](/media/articles/anomaly-detection/anomaly-detection-overview.png) + +## Brute-force protection preferences + +Brute-force protection is enabled by default for all connections. For more information, see [Enable and Disable Brute-Force Protection](/anomaly-detection/guides/enable-disable-brute-force-protection). + +::: warning +Auth0 strongly recommends that you **do not** set the `brute_force_protection` flag to `false` (effectively disabling brute-force protection for the connection), however if you do, you can change it back in the [Dashboard](${manage_url}/#/anomaly). +::: + +Limit the amount of signups and failed logins from a suspicious IP address. For more information, see [Brute-Force Protection Triggers and Actions](/anomaly-detection/references/brute-force-protection-triggers-actions). + +1. Click on the **Brute-force Protection** shield. + +![Brute-Force Protection Shield](/media/articles/anomaly-detection/brute-force-shield.png) + +2. Use the toggles to enable or disable actions for single or multiple user accounts. + +3. Add any IP addresses to the **Whitelist** field to avoid erroneously triggering the protection action. + +4. Click **Save** when you are finished. + +## Breached password detection preferences + +Set preferences for breached password detection actions. For more information, see [Breached Password Detection Triggers and Actions](/anomaly-detection/references/breached-password-detection-triggers-actions). + +1. Click on the **Breached-password Detection** shield. + +![Breached Password Detection Shield](/media/articles/anomaly-detection/breached-password-shield.png) + +2. Use the toggles to enable or disable actions when login security breaches are detected. + +3. Determine how administrators are notified. + +4. Click **Save** when you are finished. + +## Restrictions and limitations + +Both brute-force protection and breached password detection depend on the IP address of the user. Because of this, the following use cases are *not* supported: + +* **Using the [Resource Owner](/api/authentication#resource-owner) from the backend of the application.** Using this call does not get the IP address of the user. See point 2 below as an alternative. + +* **Using [Resource Owner Password Grant](/api-auth/grant/password) from the backend of the application.** Using this call does not get the IP address of the user, however, you can [configure your application and send the IP address of the user as part of the request](/api-auth/tutorials/using-resource-owner-password-from-server-side) to make brute-force protection work correctly. + +* **Authenticating many users from the same IP address.** For example, users that are behind a proxy are more likely to reach these limits and trigger the associated protection. It is possible to configure a whitelist for the proxy's IP and CIDR range and avoid erroneously triggering the protection. + +## Keep reading + +* [Anomaly Detection](/anomaly-detection) +* [Breached Password Security](/anomaly-detection/concepts/breached-passwords) \ No newline at end of file diff --git a/articles/anomaly-detection/guides/use-tenant-data-for-anomaly-detection.md b/articles/anomaly-detection/guides/use-tenant-data-for-anomaly-detection.md new file mode 100644 index 0000000000..fd88341413 --- /dev/null +++ b/articles/anomaly-detection/guides/use-tenant-data-for-anomaly-detection.md @@ -0,0 +1,57 @@ +--- +description: Learn how to use tenant traffic log data to view anomaly detection events. +topics: + - security + - anomaly-detection +contentType: how-to +useCase: tenant-logs +--- + +# View Anomaly Detection Events + +The tenant logs contain useful data that you can use to build charts to look at the profile of the traffic going through your tenant. This is helpful when evaluating anomaly detection activity. + +## Authentication failure events + +You can use the log data `event` field to view the tenant traffic data. We recommend building a daily histogram of failure events of the following types: + +| Event Code | Event | +| -- | -- | +| `f` | Failed login | +| `fcoa` | Failed cross-origin authentication | +| `feccft` | Failed exchange | +| `fepft` | Failed exchange | +| `fsa` | Failed silent authentication | +| `fu` | Failed login (invalid email/username) | +| `sepft` | Success exchange | + +These failure events depend on the flow you have set up with Auth0. + +The following example shows a credential stuffing attack on 11/20, with a large surge of events of type `fu` which is a failed username (typical of a credential stuffing attack). + +![Traffic Failure Trends](/media/articles/anomaly-detection/traffic-failure-trends.png) + +## Authenticaton failure events from distinct IPs + +You can use the `ip` event to see the number of distinct IPs that your failure traffic is coming from, in this case, the number of distinct IPs that correspond to your `fu` event traffic. + +## Anomaly detection events + +You can perform the same type of analysis with the events corresponding to anomaly detection events to see how many times they are triggered. Use the following log events which correspond to brute force detection with many accounts, one account, and breached password detection: + +| Event Code | Event | +| -- | -- | +| `limit_mu` | Blocked IP address | +| `limit_wc` | Blocked account | +| `pwd_leak` | Breached password | + +Here's an example of what that data might look like. + +![Anomaly Detection Data](/media/articles/anomaly-detection/anomaly-detection-features.png) + +## Keep reading + +* [Log Event Data](/logs/references/log-events-data) +* [Log Search Query Syntax](/logs/references/query-syntax) +* [Export Log Data to External Services](/extensions#Monitor) +* [Retrieve Logs Using the Management API](/logs/guides/retrieve-logs-mgmt-api) diff --git a/articles/anomaly-detection/index.md b/articles/anomaly-detection/index.md index 555b5ef1bf..9dc98e5ece 100644 --- a/articles/anomaly-detection/index.md +++ b/articles/anomaly-detection/index.md @@ -1,166 +1,73 @@ --- -toc: true -description: Explains all the types of Anomaly Detection provided by Auth0 and how to enable them. -url: /anomaly-detection +title: Anomaly Detection +description: Understand how Auth0 detects anomalies to stop malicious attempts to access your application, alert you and your users of suspicious activity, and block further login attempts. +toc: true topics: - security - anomaly-detection -contentType: - - index - - reference - - how-to + - brute-force-protection + - breached-password-detection +contentType: concept useCase: customize-anomaly-detection +v2: true --- - # Anomaly Detection -Auth0 provides built-in tools to detect anomalies and stop malicious attempts to access your application. Anomaly detection can alert you and your users of suspicious activity, as well as block further login attempts. You can set your preferences on the notifications that get sent and you can decide whether to block a suspicious IP address or not. - -## What Anomaly Detection Provides - -Currently Auth0 has three types of **shields** you can enable to handle anomalies and attacks. A **shield** specifies the **action** you wish to take given a specific **trigger**. - -A **trigger** is a suspicious event that is detected when someone is trying to login to your system, or there may have been a breached password with another 3rd party service. - -## Shields - -### Brute-Force Protection +Auth0 can detect anomalies and stop malicious attempts to access your application. Anomaly detection can alert you and your users of suspicious activity, as well as block further login attempts. You can [set preferences](/anomaly-detection/guides/set-anomaly-detection-preferences) for notifications and decide whether to block a suspicious IP address or not. -There are two different triggers for the brute-force protection shield, for two slightly different attack scenarios. +Auth0 has two types of **shields** to handle anomalies and attacks. -**Trigger:** *10* failed login attempts into a single account from the same IP address. +* [Brute-force protection](#brute-force-protection) +* [Breached password detection](#breached-password-detection) -**Actions**: -* Send an email to the affected user (The email can be [customized](#customize-the-blocked-account-email)) -* Block the suspicious IP address +A **shield** specifies the **action** you wish to take given a specific **trigger**. A **trigger** is a suspicious event that is detected when someone is trying to login to your system, or there may have been a breached password with another third party service. -::: panel Note -The way this anomaly protection works is that if user with "user_id1" signs in from IP1 and fails to login consecutively for 10 attempts their login from this IP - IP1 will be blocked. Another user, say "user_id2" signing in from the same IP (IP1) will not be blocked. The mechanism to clear this block is described below. +Customize the actions in the **Anomaly Detection** section on the [Dashboard](${manage_url}/#/anomaly). -Currently the default trigger amount of 10 cannot be changed. +::: note +Auth0 recommends that you [create reports using tenant traffic data to see anomaly detection events](/anomaly-detection/guides/use-tenant-data-for-anomaly-detection). ::: -If this block is triggered, it can be cleared the following ways: - -* An administrator removes the block via the [Dashboard](${manage_url}) (by clicking **unblock for all IPs** under the **ACTIONS** button when viewing the user's details) or by using the [Management API](/api/management/v2#!/User_Blocks/delete_user_blocks) ; -* The User clicks on the "unblock" link provided in the email sent when the block went into effect; -* The User changes their password. - -**Trigger:** *100* failed login attempts from a single IP address using different usernames, all with incorrect passwords in 24 hours. Or *50* sign ups attempts per minute from the same IP address. - -**Actions:** -* Notify dashboard administrator(s) -* Block suspicious addresses - -If this block is triggered, additional access attempts are released one at a time over the course of 24 hours until 100 attempts are allocated. More specifically, you will gain 100 attempts / 24 hours * 60 minutes = 1 additional attempt every 25 minutes. - -Auth0 does email the dashboard administrator(s) when this block is triggered. Within this email there's a link the owner can click on to remove the block. - -#### Enable or Disable Brute Force Protection +## Brute-force protection -By default, brute force protection is enabled for all connections. +Brute-force protection is [enabled by default](/anomaly-detection/guides/enable-disable-brute-force-protection) for all connections. There are two different [triggers](/anomaly-detection/references/brute-force-protection-triggers-actions) for the brute-force protection shield, for two slightly different attack scenarios. -Each connection has a flag called `brute_force_protection` that you can use to disable brute force protection. If this flag is set to `true`, then brute force protection is enabled *even if general brute force protection is enabled*. +* 10 consecutive failed login attempts for the same user and from the same IP address +* 100 failed login attempts from the same IP address in 24 hours *or* 50 sign up attempts per minute from the same IP address -We do not recommend setting the `brute_force_protection` flag to `false` (effectively disabling brute force protection for the connection), but if you do, you will be able to change this in the Dashboard. There will be a **Improve brute force protection** toggle under Connection Settings that changes the flag from `false` to `true`. +For example, if a user with *user_id1* signs in from *IP1* and fails to login consecutively for 10 attempts, their log in attempt from this *IP1* will be blocked. Another user, *user_id2*, signing in from *IP1* will not be blocked. -#### Restrictions Regarding Brute-Force Protection +## Breached password detection -Both of these anomaly types depend on the IP address of the user. Because of this, the following use cases are *not* supported: +Every day, malicious hackers penetrate websites and applications, exposing thousands of email and passwords. Because it's common for users to use the same password to login to multiples sites, this poses a problem, not only for the hacked system, but to any application that shares those [breached passwords](/anomaly-detection/concepts/breached-passwords). -1. Using the [Resource Owner](/api/authentication#resource-owner) from the backend of the application. Using this call does not get the IP address of the user. See point 2 below as an alternative. -2. Using [Resource Owner Password Grant](/api-auth/grant/password) from the backend of the application. Using this call does not get the IP address of the user, however, you can [configure your application and send the IP address of the user as part of the request](/api-auth/tutorials/using-resource-owner-password-from-server-side) to make brute-force protection work correctly. -3. Authenticating many users from the same IP address. For example, users that are behind a proxy are more likely to reach these limits and trigger the associated protection. It is possible to configure a whitelist for the proxy's IP and CIDR range and avoid erroneously triggering the protection. +Auth0 tracks large security breaches that are happening on major third party sites to help keep your users and system secure. By [enabling breached password detection](/anomaly-detection/guides/set-anomaly-detection-preferences), when a [trigger](/anomaly-detection/references/breached-password-detection-triggers-actions) occurs, your users can be notified and/or blocked from logging in if we suspect their credentials were part of a published security breach. You can [customize blocked account emails](/anomaly-detection/guides/customize-blocked-account-emails). -### Breached Password Detection +## Frequently asked questions -Every day malicious hackers penetrate websites and applications, exposing thousands of email and passwords. Given that it's quite common for users to use the same password to login to multiples sites, this poses a problem, not only for the hacked system, but to any application that shares those credentials. - -Auth0 tracks large security breaches that are happening on major third party sites to help keep your users and system secure. By enabling Breached Password Detection, your users can be notified and/or blocked from logging in if we suspect their credentials were part of a published security breach. - -**Trigger:** Auth0 suspects that a specific user's credentials were included in a major public security breach. - -**Actions:** -* Send an email to the affected user -* Send an email to dashboard owners immediately, and/or have a daily/weekly/monthly summary -* Block login attempts for suspected user accounts using that username and password combination - -This block remains in place until the user changes their password. - -:::note -Watch our [Breached Password Detection 101 video tutorial](https://auth0.com/resources/videos/learn-about-breached-password-detection). -::: - -## Set your anomaly detection preferences - -To customize the **actions** that get taken from the **triggers**, go to the [Anomaly Detection](${manage_url}/#/anomaly) section on the dashboard. - -![](/media/articles/anomaly-detection/anomaly-detection-overview.png) - -You can use the toggle to disable all the actions of a certain shield. Or to enable/disable certain actions, click on the shield that has the action in it that you wish to change. - -Then you can use the toggle to enable/disable an action. - -::: warning -We do not recommend making changes to your anomaly detection features via the Management API. -::: - -### Brute-force Protection - -![](/media/articles/anomaly-detection/brute-force-shield.png) - -Here you can also add any IP addresses to the **Whitelist** field to avoid erroneously triggering the protection. - -Click **Save** when you have finished. - -### Breached-password Detection - -![](/media/articles/anomaly-detection/breached-password-shield.png) - -Click **Save** when you have finished. - -### Customize the Blocked Account Email - -When Auth0 sends an email to a user to notify them of the block, the message contains a link to re-enable the origin of the request. Notice that Auth0 never blocks the user itself, just the attempts from the suspicious origin. - -The email sent to the user looks like this: - -![Email Example](/media/articles/brute-force-protection/bfp-2015-12-29_1832.png) - -The template used for this message can be customized on the [Dashboard](${manage_url}/#/emails) under __Emails > Templates > Blocked Account Email__. - -[Learn more about Customizing your Emails](/email/templates) - -## FAQs - -1. **Is the user notified at every login?** - -We send one email every hour, regardless of the number of logins. For example, if a user tries to log in 200 times in 1 hour and 30 minutes, we will send two emails. - -2. **Is there a limit to the number of times a user will be notified?** +* **Is the user notified at every login?** +We send one email every hour, regardless of the number of logins. For example, if a user tries to log in 200 times in 1 hour and 30 minutes, we will send 2 emails. +* **Is there a limit to the number of times a user will be notified?** Users will only be notified once per hour. -3. **How long is the reset password link, included in the breached password email, valid for?** +* **How often does Auth0 email administrators when traffic is blocked using Brute Force Protection for multiple accounts?** +In the event of an ongoing attack, traffic can be blocked from thousands of IP addresses at a time. Auth0 will send a single email to each administrator every hour that traffic is blocked, regardless of the number of IPs involved in the attack. -Password reset links are valid for five days. - -4. **Is there a test dataset of breached passwords?** +* **For how long is the reset password link, included in the breached password email, valid?** +Password reset links are valid for 5 days. +* **Is there a test dataset of breached passwords?** You can test with **leak-test@example.com** as the email and **Paaf213XXYYZZ** as the password. -5. **Does the breached password detection work when logging in using the Resource Owner password grant?** - +* **Does the breached password detection work when logging in using the Resource Owner password grant?** Yes. -6. **Does the breached password detection feature work with a custom database?** - +* **Does the breached password detection feature work with a custom database?** Yes. -7. **What Redirect URL applies to the *Change password* link included in the breached password notification email?** - +* **What Redirect URL applies to the *Change password* link included in the breached password notification email?** The **RedirectTo** URL is the URL listed in the Dashboard in [Emails > Templates > Change Password Template](${manage_url}/#/emails). -8. **Is there a way to configure the Redirect URL and length of time the change password link is valid?** - -You can configure the **URL Lifetime** and **Redirect To** values in the Dashboard by going to [Emails > Templates > Change Password Template](${manage_url}/#/emails). +* **Is there a way to configure the Redirect URL and the length of time that the change password link is valid?** +You can configure the **URL Lifetime** and **Redirect To** values in the Dashboard by going to [Emails > Templates > Change Password Template](${manage_url}/#/emails). \ No newline at end of file diff --git a/articles/anomaly-detection/references/breached-password-detection-triggers-actions.md b/articles/anomaly-detection/references/breached-password-detection-triggers-actions.md new file mode 100644 index 0000000000..c7e0e93b8b --- /dev/null +++ b/articles/anomaly-detection/references/breached-password-detection-triggers-actions.md @@ -0,0 +1,35 @@ +--- +title: Breached Password Detection Triggers and Actions +description: Breached password detection triggers and actions taken upon anomaly detection and how blocks are cleared. +topics: + - security + - anomaly-detection + - breached-password-detection +contentType: reference +useCase: customize-anomaly-detection +v2: true +--- +# Breached Password Detection Triggers and Actions + +## Trigger + +A trigger occurs when Auth0 suspects that a specific user's credentials were included in a major public security breach. + +::: panel Video Tutorial +Watch our [Breached Password Detection 101 video tutorial](https://auth0.com/resources/videos/learn-about-breached-password-detection). +::: + +## Actions + +* Send an email to the affected user. +* Send an email to dashboard owners immediately, and/or have a daily/weekly/monthly summary. +* Block login attempts for suspected user accounts using that username and password combination. + +## Remove block + +This block remains in place until the user changes their password. + +## Keep reading + +* [Anomaly Detection](/anomaly-detection) +* [Breached Password Security](/anomaly-detection/concepts/breached-passwords) \ No newline at end of file diff --git a/articles/anomaly-detection/references/brute-force-protection-triggers-actions.md b/articles/anomaly-detection/references/brute-force-protection-triggers-actions.md new file mode 100644 index 0000000000..3342464d8f --- /dev/null +++ b/articles/anomaly-detection/references/brute-force-protection-triggers-actions.md @@ -0,0 +1,64 @@ +--- +title: Brute-Force Protection Triggers and Actions +description: Brute-force protection triggers and actions taken upon anomaly detection and how blocks are cleared. +topics: + - security + - anomaly-detection + - brute-force-protection +contentType: reference +useCase: customize-anomaly-detection +v2: true +--- +# Brute-Force Protection Triggers and Actions + +## 10 failed login attempts + +### Trigger + +This trigger occurs when there are 10 failed login attempts into a single account from the same IP address. + +::: note +The default trigger amount of 10 cannot be changed. +::: + +### Actions + +* Send an email to the affected user. (You can [customize the email](/anomaly-detection/guides/customize-blocked-account-emails).) +* Block the suspicious IP address for that user. + +### Remove block + +If this block is triggered, it can be cleared the following ways: + +* An administrator removes the block via the [Dashboard](${manage_url}) (by clicking **unblock for all IPs** under the **ACTIONS** button when viewing the user's details) or by using the [Management API](/api/management/v2#!/User_Blocks/delete_user_blocks). +* The user clicks on the **unblock** link provided in the email sent when the block went into effect. +* The user changes their password. + +## 100 failed login attempts *or* 50 sign up attempts + +### Triggers + +A trigger occurs when there are 100 failed login attempts from one IP address using different usernames with incorrect passwords in 24 hours. + +Another trigger occurs if there are 50 sign up attempts per minute from the same IP address. + +### Actions + +* Notify dashboard administrator(s). +* Block suspicious addresses for 15 minutes. + +If this block is triggered, additional access attempts are released one-at-a-time over the course of 24 hours until 100 attempts are allocated. This results in approximately 1 additional attempt every 15 minutes. + +### Remove block + +Auth0 emails the dashboard administrator(s) when this block is triggered. The email contains a link that the owner can click to navigate to tenant logs to examine which IPs have been blocked. Recent blocks can be found using this query: +``` +type:limit_mu +``` +Blocks can then be removed using the [Management API](/api/management/v2#!/Anomaly/delete_ips_by_id). + +## Keep reading + +* [Anomaly Detection](/anomaly-detection) +* [Set Anomaly Detection Preferences](/anomaly-detection/guides/set-anomaly-detection-preferences) +* [Enable and Disable Brute-Force Protection](/anomaly-detection/guides/enable-disable-brute-force-protection) diff --git a/articles/api-auth/_includes/_ropg-warning.md b/articles/api-auth/_includes/_ropg-warning.md new file mode 100644 index 0000000000..c19c5320ac --- /dev/null +++ b/articles/api-auth/_includes/_ropg-warning.md @@ -0,0 +1,9 @@ +::: warning +Since the Resource Owner Password Grant (ROPG) flow involves the client handling the user's password, it **must not be used by third-party clients**. In this flow, the user's username and password are exchanged directly for an Access Token. + +Only consider using it when there is a high degree of trust between the user and the application and when other authorization flows (such as redirect-based flows) are not available. + +Instead, Auth0 recommends: +* For confidential clients, like Regular Web Applications, use the [Authorization Code Flow](/flows/concepts/auth-code). +* For public clients, like Native/Mobile Apps and Single-Page Applications, use the [Authorization Code Flow with PKCE](/flows/concepts/auth-code-pkce). +::: diff --git a/articles/api-auth/apis.md b/articles/api-auth/apis.md index b262bdd12f..da33b407f4 100644 --- a/articles/api-auth/apis.md +++ b/articles/api-auth/apis.md @@ -15,21 +15,13 @@ useCase: --- # APIs -<%= include('../_includes/_pipeline2') %> - -## Overview - An API is an entity that represents an external resource, capable of accepting and responding to protected resource requests made by applications. At the [OAuth2 spec](https://tools.ietf.org/html/rfc6749) an API maps to the **Resource Server**. -When an application wants to access an API's protected resources it must provide an [Access Token](/tokens/access-token). The same Access Token can be used to access the API's resources without having to authenticate again, until it expires. - -Each API has a set of defined permissions. Applications can request a subset of those defined permissions when they execute the authorization flow, and include them in the Access Token as part of the **scope** request parameter. +When an application wants to access an API's protected resources it must provide an Access Token. The same Access Token can be used to access the API's resources without having to authenticate again, until it expires. -For example, an API that holds a user's appointments, may accept two different levels of authorization: read only (scope `read:appointments`) or write (scope `write:appointments`). When an application asks the API to list a user's appointments, then the Access Token should contain the `read:appointments` scope. In order to edit an existing appointment or create a new one, the Access Token should contain the `write:appointments` scope. +Each API has a set of defined permissions. Applications can request a subset of those defined permissions when they execute the authorization flow, and include them in the Access Token as part of the **scope** request parameter. -::: note -For more information on tokens please refer to: [Tokens used by Auth0](/tokens). -::: +For example, an API that holds a user's appointments, may accept two different levels of authorization: read only (scope `read:appointments`) or write (scope `write:appointments`). When an application asks the API to list a user's appointments, then the Access Token should contain the `read:appointments` scope. In order to edit an existing appointment or create a new one, the Access Token should contain the `write:appointments` scope. See [Tokens](/tokens) for more information. ## How to configure an API in Auth0 @@ -49,7 +41,7 @@ You need to provide the following information for your API: - **Identifier**: a unique identifier for the API. Auth0 recommends using a URL. Auth0 does differentiate between URLs that include the last forward slash. For example, https://example.com and https://example.com/ are two different identifiers. The URL does not have to be a publicly available URL. Auth0 will not call your API. This value **cannot** be modified afterwards. -- **Signing Algorithm**: the algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting `RS256` the token will be signed with the tenant's private key. For more details on the signing algorithms go to the [Signing Algorithms paragraph](#signing-algorithms). +- **Signing Algorithm**: the algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting `RS256` the token will be signed with the tenant's private key. To learn more about signing algorithms, see [Signing Algorithms paragraph](/tokens/concepts/signing-algorithms). Fill in the required information and click the **Create** button. @@ -60,11 +52,11 @@ Once you do so you will be navigated to the *Quick Start* of your API. Here you The other available views for your API are: -- **Settings**: lists the settings for your API. Some are editable. Here you can change the token expiration time and enable offline access (this way Auth0 will allow your applications to ask for Refresh Tokens for this API). For details refer to the [API Settings paragraph](#api-settings). +- **Settings**: lists the settings for your API. Some are editable. Here you can change the token expiration time and enable offline access (this way Auth0 will allow your applications to ask for Refresh Tokens for this API). For details refer to the [API Settings paragraph](#api-settings). - **Scopes**: here you can define the scopes for this API, by setting a name and a description. -- **Machine to Machine Applications**: lists all applications for which the **Client Credentials** grant is **enabled**. By default, this grant is **enabled* for [Regular Web Applications](/applications/webapps) and [Machine to Machine Applications](/applications/machine-to-machine). You can authorize any of these applications to request Access Tokens for your API. Optionally, you can select a subset of the defined scopes to limit your authorized application's access. +- **Machine to Machine Applications**: lists all applications for which the **Client Credentials** grant is **enabled**. By default, this grant is **enabled** for [Regular Web Applications and Machine to Machine Applications](/applications). You can authorize any of these applications to request Access Tokens for your API. Optionally, you can select a subset of the defined scopes to limit your authorized application's access. - **Test**: from this view, you can execute a sample Client Credentials flow with any of your authorized applications to check that everything is working as expected. @@ -80,50 +72,14 @@ Click on the *Settings* tab of your [API](${manage_url}/#/apis) to review the av - **Token Expiration (Seconds)**: The amount of time (in seconds) before the Auth0 Access Token expires. The default value is 86400 seconds (24 hours). The maximum value you can set is 2592000 seconds (30 days). -- **Allow Skipping User Consent**: When a first party application requests authorized access against an API with the *Allow Skipping User Consent* flag set, the User Consent dialog will not be shown to the final user. Note that if the hostname of your application's **callbackURL** is `localhost` or `127.0.0.1` the consent dialog will always be displayed. +- **Allow Skipping User Consent**: When a first party application requests authorized access against an API with the *Allow Skipping User Consent* flag set, the User Consent dialog will not be shown to the final user. Note that if the hostname of your application's **callback URL** is `localhost` or `127.0.0.1` the consent dialog will always be displayed. - **Allow Offline Access**: If this setting is enabled, Auth0 will allow applications to ask for Refresh Tokens for this API. -- **Signing Algorithm**: The algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting `RS256` (recommended) the token will be signed with the tenant's private key. This value is set upon API creation and cannot be modified afterwards. For more details on the signing algorithms see the [Signing Algorithms paragraph](#signing-algorithms) below. - -### Signing Algorithms - -When you create an API you have to select the algorithm your tokens will be signed with. The signature is used to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed along the way. - -::: note -The signature is part of a JWT. If you are not familiar with the JWT structure please refer to: [JSON Web Tokens (JWTs) in Auth0](/jwt#what-is-the-json-web-token-structure-). -::: - -To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. That algorithm, which is part of the JWT header, is the one you select for your API: `HS256` or `RS256`. - -- **RS256** is an [asymmetric algorithm](https://en.wikipedia.org/wiki/Public-key_cryptography) which means that there are two keys: one public and one private (secret). Auth0 has the secret key, which is used to generate the signature, and the consumer of the JWT has the public key, which is used to validate the signature. +- **Signing Algorithm**: The algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting `RS256` (recommended) the token will be signed with the tenant's private key. This value is set upon API creation and cannot be modified afterwards. To learn more about signing algorithms, see [Signing Algorithms](/tokens/concepts/signing-algorithms). -- **HS256** is a [symmetric algorithm](https://en.wikipedia.org/wiki/Symmetric-key_algorithm) which means that there is only one secret key, shared between the two parties. The same key is used both to generate the signature and to validate it. Special care should be taken in order for the key to remain confidential. +## Keep reading -The most secure practice, and our recommendation, is to use **RS256**. Some of the reasons are: - -- With RS256 you are sure that only the holder of the private key (Auth0) can sign tokens, while anyone can check if the token is valid using the public key. - -- Under HS256, if the secret key is compromised (e.g. by the application) you would have to re-deploy the API with the new secret. - -- With RS256 you can request a token that is valid for multiple audiences. - -- With RS256 you can implement key rotation without having to re-deploy the API with the new secret. - -::: panel Verify an RS256 signed token -Go to [Dashboard > Applications](${manage_url}/#/applications). Open the **Settings** of your applications, scroll down and open **Advanced Settings**. Open the **Certificates** tab and you will find the Public Key in the **Signing Certificate** field. - -If you want to use the Public Key to verify a JWT signature on [JWT.io](https://jwt.io/), you can copy the Public Key and paste it in the **Public Key or Certificate** field under the **Verify Signature** section on the [JWT.io](https://jwt.io/) website. - -If you want to verify the signature of a token from one of your applications, we recommend that you get the Public Key from your tenant's [JSON Web Key Set (JWKS)](/jwks). Your tenant's JWKS is `https://${account.namespace}/.well-known/jwks.json`. -::: - -For a more detailed overview of the JWT signing algorithms refer to: [JSON Web Token (JWT) Signing Algorithms Overview](https://auth0.com/blog/json-web-token-signing-algorithms-overview/). - -## Keep Reading - -::: next-steps - [API Authorization landing page](/api-auth) - [Identify the proper OAuth 2.0 flow for your use case](/api-auth/which-oauth-flow-to-use) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) -::: +- [Tokens](/tokens) diff --git a/articles/api-auth/blacklists-vs-grants.md b/articles/api-auth/blacklists-vs-grants.md index 84941c461e..8a8fbedf29 100644 --- a/articles/api-auth/blacklists-vs-grants.md +++ b/articles/api-auth/blacklists-vs-grants.md @@ -1,12 +1,12 @@ --- -description: This document covers blacklists vs. grants when it comes handling tokens. +description: Understand blacklists vs. grants when it comes handling tokens. topics: - api-authentication - oidc - security - blacklists - application-grants -contentType: how-to +contentType: concept useCase: - secure-api - call-api @@ -14,7 +14,7 @@ useCase: # Blacklists and Application Grants -Let's say that you're using a machine to machine [application](/application) to access your API. You have a partner that calls your API, and at the end of your existing contract, you and your partner decide not to renew your partnership. As such, you now want to remove your partner's access to your API. The issue, however, is that you've given your partner an [Access Token](/tokens/access-token) that lasts for a month. +Let's say that you're using a machine to machine [application](/application) to access your API. You have a partner that calls your API, and at the end of your existing contract, you and your partner decide not to renew your partnership. As such, you now want to remove your partner's access to your API. The issue, however, is that you've given your partner an Access Token that lasts for a month. * What can you do in this situation? * How might you configure your Auth0 environment to make such situations easier to handle in the future? @@ -30,14 +30,10 @@ We will then compare the two methods and provide our recommendations. Let's say that you grant access to your API to anyone in possession of the appropriate Access Token. One method of revoking access to a user is to blacklist their token so that it can no longer be used. -::: note -Please see the Auth0 blog for an in-depth treatment on [Blacklisting JSON Web Token API Keys](https://auth0.com/blog/blacklist-json-web-token-api-keys/). -::: - -Auth0-issued tokens are [JWTs](/jwt), so you can set the JWT ID, or `jti`, for the token by including it in the token payload's `jwtid` field. With the `jti` in hand, you can make the appropriate `POST` call to the Management API's [blacklist a token endpoint](/api/management/v2#!/Blacklists/post_tokens). You'll need to provide the JWT's `aud` and `jti` claims. +Auth0-issued tokens are [JWTs](/tokens/concepts/jwts), so you can set the JWT ID, or `jti`, for the token by including it in the token payload's `jwtid` field. With the `jti` in hand, you can make the appropriate `POST` call to the Management API's [blacklist a token endpoint](/api/management/v2#!/Blacklists/post_tokens). You'll need to provide the JWT's `aud` and `jti` claims. ::: panel Add a JWT ID -You can add `jti` via a [rule](/rule). Here's a simple example using UUID: +You can add `jti` via a [rule](/rules). Here's a simple example using UUID: ```js function (user, context, callback) { diff --git a/articles/api-auth/config/using-the-auth0-dashboard.md b/articles/api-auth/config/using-the-auth0-dashboard.md index 7eafe6253b..dde2b216f6 100644 --- a/articles/api-auth/config/using-the-auth0-dashboard.md +++ b/articles/api-auth/config/using-the-auth0-dashboard.md @@ -8,11 +8,11 @@ contentType: how-to useCase: secure-api --- -# Set up a Client Grant using the Dashboard +# Set Up Client Credentials Grants Using the Dashboard -Auth0 lets you authorize applications that have the **Client Credential** grant type enabled to call APIs using the OAuth Client Credentials Grant. +Auth0 lets you authorize applications that have the **Client Credentials** grant type enabled to call APIs using the [Client Credentials Flow](/flows/concepts/client-credentials). -By default, the **Client Credentials** grant is enabled for all Machine to Machine Applications and Regular Web Applications, but they are _not yet_ authorized to call any API. +By default, the **Client Credentials** grant is enabled for all Machine-to-Machine Applications and Regular Web Applications, but they are _not yet_ authorized to call any API. To authorize the applications to call an API: @@ -20,16 +20,14 @@ To authorize the applications to call an API: 2. Select the API you want to invoke using the **Client Credentials** Grant. -3. Under the **Authorized Application** tab, look for the application you want to authorize, click the Authorize button, and optionally select the list of scopes that will be granted in the Access Token. This will create a 'client grant' in Auth0, which will allow the application to call the API. +3. Under the **Authorized Application** tab, look for the application you want to authorize, click the Authorize button, and optionally, select the list of scopes that will be granted in the Access Token. This will create a 'client grant' in Auth0, which will allow the application to call the API. ![Authorize the Application](/media/articles/api-auth/apis-authorize-client-tab.png) -4. In the Test tab, you can select the application you granted access to, and see the Access Tokens that will be generated for it. +4. In the Test tab, you can select the application to which you granted access, and see the Access Tokens that will be generated for it. ## Keep reading -:::next-steps -* [How to implement the Client Credentials Grant](/api-auth/tutorials/client-credentials) -* [How to change the scopes and add custom claims to a token using Hooks](/api-auth/tutorials/client-credentials/customize-with-hooks) -* [How to add custom claims to a token using Rules](/scopes#custom-claims) -::: +* [Call API using the Client Credentials Flow](/flows/guides/client-credentials/call-api-client-credentials) +* [Use Hooks with Client Credentials Grant](/api-auth/tutorials/client-credentials/customize-with-hooks) +* [Add Custom Claims Tokens Using Rules](/scopes/current/sample-use-cases#add-custom-claims-to-a-token) diff --git a/articles/api-auth/config/using-the-management-api.md b/articles/api-auth/config/using-the-management-api.md index 78401eb673..fc9e75f35a 100644 --- a/articles/api-auth/config/using-the-management-api.md +++ b/articles/api-auth/config/using-the-management-api.md @@ -1,6 +1,5 @@ --- -title: Set up a Client Credentials Grant using the Management API -description: How to set up a Client Credentials Grant using the Management API. +description: Learn how to set up a Client Credentials Grant using the Management API. crews: crew-2 topics: - client-credentials @@ -9,17 +8,17 @@ contentType: how-to useCase: secure-api --- -# Set up a Client Grant using the Management API +# Set Up Client Credentials Grants Using the Management API -Auth0 lets you authorize applications that have the 'Client Credential' grant type enabled to call APIs using the OAuth Client Credentials Grant. +Auth0 lets you authorize applications that have the Client Credentials grant type enabled to call APIs using the [Client Credentials Flow](/flows/concepts/client-credentials). -By default, all Machine to Machine Applications and Regular Web Applications have it the 'Client Credentials' grant enabled, but they are not authorized to call any API. +By default, all Machine-to-Machine Applications and Regular Web Applications have the 'Client Credentials' grant enabled, but they are not authorized to call any API. -If you want to call an API from these applications, you first need to authorize the application to call the API and specify the scopes that will be granted. You can do that [using the Dashboard](/api-auth/config/using-the-dashboard), or follow the steps below to use the API. +If you want to call an API from these applications, you first need to authorize the application to call the API and specify the scopes that will be granted. You can do that [using the Dashboard](/api-auth/config/using-the-auth0-dashboard), or follow the steps below to use the API. You will need the following: -- A Management API access token with the `create:client_grants` scopes. For details on how to get one refer to [How to Get an Access Token for the Management API](/api/management/v2/tokens). +- A Management API Access Token with the `create:client_grants` scopes. For details on how to get one, refer to [Access Tokens for the Management API](/api/management/v2/tokens). - The application information (`Client_Id` and `Client_Secret`) for the application you want to authorize [Auth0 dashboard](${manage_url}/#/applications). @@ -27,7 +26,7 @@ You will need the following: ## Authorize the Application -To authorize your Application send a `POST` request to the [/client-grants endpoint of the Management APIv2](/api/management/v2#!/Client_Grants/post_client_grants) with the Management API Access Token. +To authorize your Application, send a `POST` request to the [/client-grants endpoint of the Management APIv2](/api/management/v2#!/Client_Grants/post_client_grants) with the Management API Access Token. The following example authorizes the application with Id `${account.clientId}`, to access the API with Identifier `https://my-api-urn`, while granting the scope `sample-scope`. @@ -59,12 +58,12 @@ Sample response: } ``` -That's it, you are done! Now that all the elements are in place, you can request Access Tokens for your API from Auth0 using the Client Credentials Grant. +That's it, you are done! Now that all the elements are in place, you can request Access Tokens for your API from Auth0 using the Client Credentials Flow. ## Keep reading :::next-steps -* [How to implement the Client Credentials Grant](/api-auth/tutorials/client-credentials) +* [Call API using the Client Credentials Flow](/flows/guides/client-credentials/call-api-client-credentials) * [How to change the scopes and add custom claims to a token using Hooks](/api-auth/tutorials/client-credentials/customize-with-hooks) -* [How to add custom claims to a token using Rules](/scopes#custom-claims) +* [How to add custom claims to a token using Rules](/scopes/current/sample-use-cases#add-custom-claims-to-a-token) ::: diff --git a/articles/api-auth/dynamic-client-registration.md b/articles/api-auth/dynamic-client-registration.md index e6683e31eb..6bac759f08 100644 --- a/articles/api-auth/dynamic-client-registration.md +++ b/articles/api-auth/dynamic-client-registration.md @@ -1,6 +1,5 @@ --- -title: Dynamic Client Registration -description: How to dynamically register applications with Auth0 using the Management API +description: Learn how to dynamically register applications with Auth0 using the Management API. crews: crew-2 toc: true topics: @@ -13,27 +12,17 @@ useCase: # Dynamic Client Registration -<%= include('../_includes/_pipeline2') %> - -Dynamic Client Registration enables you to register applications dynamically. These applications can be either [first-party or third-party applications](/applications/application-types#first-vs-third-party-applications). +Dynamic Client Registration enables you to register [third-party applications](/applications/guides/enable-third-party-apps) dynamically. This feature is based on the [OpenID Connect Dynamic Client Registration specification](https://openid.net/specs/openid-connect-registration-1_0.html) and in this article we will see how you can enable and use it. ## Enable dynamic registration -By default, the feature is disabled for all tenants. To change this, you have to: - -- update your tenant settings -- promote the connections you will use with your dynamic applications to **domain connections**, and -- update your application's login page (if you use [Lock](/libraries/lock/v11)) - ::: warning Auth0 supports **Open Dynamic Registration**, which means that if you enable this feature, **anyone** will be able to create applications in your tenant without a token. ::: -### Update tenant settings - -Set the `enable_dynamic_client_registration` flag to `true` in your tenant's settings. +By default, the feature is disabled for all tenants. To change this, you have to set the `enable_dynamic_client_registration` flag to `true` in your tenant's settings. This can be done by enabling the **OIDC Dynamic Application Registration** toggle on your tenant's [Advanced Settings page](${manage_url}/#/tenant/advanced). @@ -55,76 +44,7 @@ Alternatively, you can update this flag using the [Update tenant settings endpoi } ``` -You need to update the `API2_ACCESS_TOKEN` with a valid token with the scope `update:tenant_settings`. See [How to get a Management APIv2 Token](/api/management/v2/tokens#how-to-get-a-management-apiv2-token) for details on how to do so. - -### Promote connections - -Applications registered via the [Dynamic Application Registration Endpoint](#register-your-application) can only authenticate users using connections flagged as **Domain Connections**. These connections will be open for any dynamic application to allow users to authenticate. - -You can promote a connection to domain level using the [Update a Connection endpoint](/api/management/v2#!/Connections/patch_connections_by_id). - -```har -{ - "method": "PATCH", - "url": "https://${account.namespace}/api/v2/connections/CONNECTION_ID", - "headers": [ - { "name": "Content-Type", "value": "application/json" }, - { "name": "Authorization", "value": "Bearer API2_ACCESS_TOKEN" }, - { "name": "Cache-Control", "value": "no-cache" } - ], - "postData": { - "mimeType": "application/json", - "text" : "{ \"is_domain_connection\": true }" - } -} -``` - -Where: -- `API2_ACCESS_TOKEN`: [Α valid Auth0 API2 token](/api/management/v2/tokens#how-to-get-a-management-apiv2-token) with the scope `update:connections` -- `CONNECTION_ID`: Τhe Id of the connection to be promoted - - -### Update the login page - -To use the Auth0's [Universal Login](/hosted-pages/login) with the Dynamic Application feature, you need to use at least version `10.7.x` of Lock, and set `__useTenantInfo: config.isThirdPartyClient` when instantiating Lock. - -Sample script: - -```html - -... - -``` +You need to update the `API2_ACCESS_TOKEN` with a valid token with the scope `update:tenant_settings`. See [Access Tokens for the Management API](/api/management/v2/tokens) for details on how to do so. ## Use dynamic registration @@ -132,9 +52,9 @@ In this section we will see how you can dynamically register and configure an ap ### Register your application -In order to dynamically register an application with Auth0, you need to send an HTTP `POST` message to the Application Registration endpoint: `https://${account.namespace}/oidc/register`. Note that Auth0 supports **Open Dynamic Registration**, which means that the endpoint will accept a registration request without an [Access Token](/tokens/access-token). +To dynamically register an application with Auth0, you need to send an HTTP `POST` message to the Application Registration endpoint: `https://${account.namespace}/oidc/register`. Note that Auth0 supports **Open Dynamic Registration**, which means that the endpoint will accept a registration request without an Access Token. -To create an application with the name `My Dynamic application` and the callback URLs `https://application.example.com/callback` and `https://application.example.com/callback2`, use the following snippet. +To create an application with the name `My Dynamic application` and the callback URLs `https://application.example.com/callback` and `https://application.example.com/callback2`, use the following snippet. ```har { @@ -154,7 +74,7 @@ Where: - **client_name**: The name of the Dynamic Application to be created - **redirect_uris** (required): An array of URLs that Auth0 will deem valid to call at the end of an authentication flow -Optionally, you can set a value for `token_endpoint_auth_method`, which can be `none` or `client_secret_post` (default value). +Optionally, you can set a value for `token_endpoint_auth_method`, which can be `none` or `client_secret_post` (default value). Use `token_endpoint_auth_method: none` in the request payload if creating a SPA. The response includes the basic application information. @@ -175,7 +95,7 @@ Content-Type: application/json Where: - **client_id**: Unique client identifier. This is the ID you will use while configuring your apps to use Auth0. It is generated by the system and it cannot be modified. -- **client_secret**: Alphanumeric 64-bit client secret. This value is used by applications to authenticate to the [token endpoint](/api/authentication#get-token) and for signing and validating [ID Tokens](/tokens/id-token). +- **client_secret**: Alphanumeric 64-bit client secret. This value is used by applications to authenticate to the [token endpoint](/api/authentication#get-token) and for signing and validating [ID Tokens](/tokens/concepts/id-tokens). - **client_secret_expires_at**: Time at which the `client_secret` will expire. For Auth0 this value will always be zero (`0`) which means that the application never expires. Make a note of the Client ID and Secret, as these are the most important pieces for executing [authentication](/application-auth) and [authorization](/api-auth) flows. @@ -186,7 +106,7 @@ Also, keep in mind that third-party developers are not allowed to modify the app Now that you have a Client ID and Secret, you can configure your application to authenticate users with Auth0. -We will go through a simple example, that shows how to call an API from a client-side web app, using the [Implicit Grant](/api-auth/tutorials/implicit-grant). For a list of tutorials on how to authenticate and authorize users, based on your application type, see the [API Authorization](/api-auth) page. +We will go through a simple example, that shows how to call an API from a client-side web app, using the [Implicit Flow](/flows/guides/implicit/call-api-implicit). For a list of tutorials on how to authenticate and authorize users, based on your application type, see the [API Authorization](/api-auth) page. First, you need to configure your application to send the user to the authorization URL: @@ -197,12 +117,12 @@ https://${account.namespace}/authorize? response_type={RESPONSE_TYPE}& client_id=${account.clientId}& redirect_uri=${account.callback}& - nonce={CRYPTOGRAPHIC_NONCE} + nonce={NONCE} state={OPAQUE_VALUE} ``` Where: -- **audience** (optional): The target API for which the Application is requesting access on behalf of the user. Set this parameter if you need API access. +- **audience** (optional): The target API for which the Application is requesting access on behalf of the user. Set this parameter if you need API access. - **scope** (optional): The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must conform to a namespaced format (see panel below for more info), or any scopes supported by the target API (for example, `read:contacts`). Set this parameter if you need API access. ::: panel Custom claims namespaced format @@ -225,4 +145,4 @@ For example: This call will redirect the user to Auth0, and upon successful authentication, back to your application (specifically to the **redirect_uri**). -If you need API access, then following the authentication, you need to [extract the Access Token](/api-auth/tutorials/implicit-grant#2-extract-the-access-token) from the hash fragment of the URL, and use it to make calls to the API, by passing it as a `Bearer` token in the `Authorization` header of the HTTP request. +If you need API access, then following the authentication, you need to extract the Access Token from the hash fragment of the URL, and use it to make calls to the API, by passing it as a `Bearer` token in the `Authorization` header of the HTTP request. diff --git a/articles/api-auth/faq.md b/articles/api-auth/faq.md index 5c56bc63d3..d5fea1d7e6 100644 --- a/articles/api-auth/faq.md +++ b/articles/api-auth/faq.md @@ -16,13 +16,13 @@ useCase: ## I have an Application that needs to talk to different Resource Servers -If a single Application needs Access Tokens for different resource servers, then multiple calls to `/authorize` (that is, multiple executions of the same or different Authorization Flow) needs to be performed. Each authorization will use a different value for `audience`, which will result in a different Access Token at the end of the flow. +If a single Application needs Access Tokens for different resource servers, then multiple calls to `/authorize` (that is, multiple executions of the same or different Authorization Flow) needs to be performed. Each authorization will use a different value for `audience`, which will result in a different Access Token at the end of the flow. For more information, see the [OAuth 2.0: Audience Information Specification](https://tools.ietf.org/html/draft-tschofenig-oauth-audience-00#section-3). ## Can I try the endpoints before I implement my application? -**A** Sure! You have two options: +Sure! You have two options: - [Download our Postman collection](https://app.getpostman.com/run-collection/2a9bc47495ab00cda178). For more information on how to use our Postman collection refer to [Using the Auth0 API with our Postman Collections](/api/postman). - Use our [Authentication API Debugger Extension](/extensions/authentication-api-debugger). You can find detailed instructions per endpoint/grant at our [Authentication API Reference](/api/authentication). diff --git a/articles/api-auth/grant/authorization-code-pkce.md b/articles/api-auth/grant/authorization-code-pkce.md index c3b3f76c4d..fb575ab2c1 100644 --- a/articles/api-auth/grant/authorization-code-pkce.md +++ b/articles/api-auth/grant/authorization-code-pkce.md @@ -9,11 +9,9 @@ useCase: - secure-api - call-api --- -# Calling APIs from Mobile Apps +# Call APIs from Mobile Apps -<%= include('../../_includes/_pipeline2') %> - -In order to access an API from a [mobile app](/quickstart/native), you need to implement the **Authorization Code using Proof Key for Code Exchange (PKCE)** OAuth 2.0 grant. In this document we will see how this flow works. +To access an API from a [mobile app](/quickstart/native), you need to implement the **Authorization Code using Proof Key for Code Exchange (PKCE)** OAuth 2.0 grant. In this document, we will see how this flow works. ::: note If you need a refresher on the OAuth 2.0 protocol, you can go through our [OAuth 2.0](/protocols/oauth2) article. @@ -21,7 +19,7 @@ If you need a refresher on the OAuth 2.0 protocol, you can go through our [OAuth ## Overview of the flow -The [Authorization Code Grant](/api-auth/grant/authorization-code) has some security issues, when implemented on native applications. For instance, a malicious attacker can intercept the `authorization_code` returned by Auth0 and exchange it for an [Access Token](/tokens/access-token) (and possibly a [Refresh Token](/tokens/refresh-token)). +The [Authorization Code Grant](/api-auth/grant/authorization-code) has some security issues when implemented on native applications. For instance, a malicious attacker can intercept the `authorization_code` returned by Auth0 and exchange it for an Access Token (and possibly a Refresh Token). The **Proof Key for Code Exchange (PKCE)** (defined in [RFC 7636](https://tools.ietf.org/html/rfc7636)) is a technique used to mitigate this authorization code interception attack. @@ -29,18 +27,18 @@ With PKCE, the application creates, for every authorization request, a cryptogra ![Authorization Code Grant using PKCE](/media/articles/api-auth/authorization-code-grant-pkce.png) - 1. The native app initiates the flow and redirects the user to Auth0 (specifically to the [/authorize endpoint](/api/authentication#authorization-code-grant-pkce-)), sending the `code_challenge` and `code_challenge_method` parameters. + 1. The native application initiates the flow and redirects the user to Auth0 (specifically to the [/authorize endpoint](/api/authentication#authorization-code-grant-pkce-)), sending the `code_challenge` and `code_challenge_method` parameters. - 2. Auth0 redirects the user to the native app with an `authorization_code` in the querystring. + 2. Auth0 redirects the user to the native application with an `authorization_code` in the querystring. - 3. The native app sends the `authorization_code` and `code_verifier` together with the `redirect_uri` and the `client_id` to Auth0. This is done using the [/oauth/token endpoint](/api/authentication?http#authorization-code-pkce-). + 3. The native application sends the `authorization_code` and `code_verifier` together with the `redirect_uri` and the `client_id` to Auth0. This is done using the [/oauth/token endpoint](/api/authentication?http#authorization-code-pkce-). 4. Auth0 validates this information and returns an Access Token (and optionally a Refresh Token). - 5. The native app can use the Access Token to call the API on behalf of the user. + 5. The native application can use the Access Token to call the API on behalf of the user. ::: note -In OAuth 2.0 terms, the native app is the Client, the end user the Resource Owner, the API the Resource Server, the browser the User Agent, and Auth0 the Authorization Server. +In OAuth 2.0 terms, the native application is the Client, the end user the Resource Owner, the API the Resource Server, the browser the User Agent, and Auth0 the Authorization Server. ::: ## How to implement the flow @@ -58,7 +56,6 @@ For details on how to implement this, refer to [Execute an Authorization Code Gr ::: next-steps - [Execute an Authorization Code Grant Flow with PKCE](/api-auth/tutorials/authorization-code-grant-pkce) - [How to configure an API in Auth0](/apis) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) +- [Tokens](/tokens) - [Application Authentication for Mobile & Desktop Apps](/application-auth/mobile-desktop) -- [Tokens used by Auth0](/tokens) ::: diff --git a/articles/api-auth/grant/authorization-code.md b/articles/api-auth/grant/authorization-code.md index edc82248d9..45412c6e0b 100644 --- a/articles/api-auth/grant/authorization-code.md +++ b/articles/api-auth/grant/authorization-code.md @@ -8,9 +8,7 @@ useCase: - secure-api - call-api --- -# Calling APIs from Server-side Web Apps - -<%= include('../../_includes/_pipeline2') %> +# Call APIs from Server-side Web Apps In order to access an API from a [regular web app](/quickstart/webapp), you need to implement the **Authorization Code** OAuth 2.0 grant. In this document we will see how this flow works. @@ -20,7 +18,7 @@ If you need a refresher on the OAuth 2.0 protocol, you can go through our [OAuth ## Overview of the flow -The **Authorization Code Grant** (defined in [RFC 6749, section 4.1](https://tools.ietf.org/html/rfc6749#section-4.1)) is a flow where the browser receives an Authorization Code from Auth0 and sends this to the web app. The web app will then interact with Auth0 and exchange the Authorization Code for an [Access Token](/tokens/access-token), and optionally an [ID Token](/tokens/id-token) and a [Refresh Token](/tokens/refresh_token). The web app can now use this Access Token to call the API on behalf of the user. +The **Authorization Code Grant** (defined in [RFC 6749, section 4.1](https://tools.ietf.org/html/rfc6749#section-4.1)) is a flow where the browser receives an Authorization Code from Auth0 and sends this to the web app. The web app will then interact with Auth0 and exchange the Authorization Code for an [Access Token](/tokens/concepts/access-tokens), and optionally an [ID Token](/tokens/concepts/id-tokens) and a Refresh Token. The web app can now use this Access Token to call the API on behalf of the user. ![Authorization Code Grant](/media/articles/api-auth/authorization-code-grant.png) @@ -56,7 +54,6 @@ For details on how to implement this, refer to [Execute an Authorization Code Gr ::: next-steps - [How to implement an Authorization Code Grant flow](/api-auth/tutorials/authorization-code-grant) - [How to configure an API in Auth0](/apis) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) +- [Tokens](/tokens) - [Application Authentication for Server-side Web Apps](/application-auth/server-side-web) -- [Tokens used by Auth0](/tokens) ::: diff --git a/articles/api-auth/grant/client-credentials.md b/articles/api-auth/grant/client-credentials.md index fff1ad9981..8fa8cd26d3 100644 --- a/articles/api-auth/grant/client-credentials.md +++ b/articles/api-auth/grant/client-credentials.md @@ -12,7 +12,7 @@ useCase: The **Client Credentials Grant** (defined in [RFC 6749, section 4.4](https://tools.ietf.org/html/rfc6749#section-4.4)) allows an application to request an Access Token using its __Client Id__ and __Client Secret__. It is used for non interactive applications (a CLI, a daemon, or a Service running on your backend) where the token is issued to the application itself, instead of an end user. -In order to be able to perform the Client Credentials Grant, the Application needs to have the [Client Credentials grant type](/applications/application-grant-types) enabled. Machine to Machine Applications and Regular Web Applications have it enabled by default. +In order to be able to perform the Client Credentials Grant, the Application needs to have the [Client Credentials grant type](/applications/concepts/application-grant-types) enabled. Machine to Machine Applications and Regular Web Applications have it enabled by default. ## Client Credentials Grant Flow @@ -37,7 +37,6 @@ For details on how to implement this using Auth0, refer to [Execute a Client Cre ::: next-steps - [How to implement a Client Credentials flow](/api-auth/tutorials/client-credentials) - [How to configure an API in Auth0](/apis) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) +- [Tokens](/tokens) - [How to change the scopes and add custom claims to the tokens using Hooks](/api-auth/tutorials/client-credentials/customize-with-hooks) -- [Tokens used by Auth0](/tokens) ::: diff --git a/articles/api-auth/grant/hybrid.md b/articles/api-auth/grant/hybrid.md new file mode 100644 index 0000000000..496e658d8b --- /dev/null +++ b/articles/api-auth/grant/hybrid.md @@ -0,0 +1,66 @@ +--- +description: Describes how to call APIs from applications using the Hybrid Flow +public: false +topics: + - authorization-code + - api-authorization + - implicit +contentType: concept +useCase: + - secure-api + - call-api +--- +# Call APIs Using the Hybrid Flow + +The Hybrid Flow is an OpenID Connect (OIDC) flow that draws from the following: + +1. [Authorization Code Flow](/flows/concepts/auth-code) +2. [Implicit Flow](/flows/concepts/implicit) + +The Hybrid Flow enables use cases where your application can immediately use an ID token to access information about the user while obtaining an authorization code that can be exchanged for an Access Token (therefore gaining access to protected resources for an extended period of time). + +## Background + +With the [Authorization Code Flow](/flows/concepts/auth-code), Auth0 sends you an authorization code, which your app then sends in to retrieve tokens. Your application authenticates itself with a Client ID and Client Secret stored securely on your server. + +On the other hand, the [Implicit Flow](/flows/concepts/implicit) allows you to request Access Tokens without needing to authenticate your application. Auth0 verifies your app's identity based on the provided redirect URI. Because of this, you shouldn't utilize long-lived Access Tokens, and you cannot use Refresh Tokens. + +## The Hybrid Flow + +The Hybrid Flow allows you to take advantage of aspects of both the Authorization Code and Implicit Grants. For each interaction with Auth0, you will receive two (sometimes three) items in response: + +1. An authorization code and an Access Token +1. An authorization code and an ID Token +1. An authorization code, an Access Token, and an ID Token + +In this article, we will take a closer look at how this flow works. + +## Overview of the flow + +1. The web application initiates the authorization flow and redirects the browser to Auth0 (specifically, the [Authorization Endpoint](/api/authentication#authorization-code-grant)) so that the user can authenticate. + +1. Auth0 authenticates the user via the browser. If this is the first time the user does this, they will see a consent page listing the permissions that Auth0 will give to the application. + +1. Auth0 redirects the user to the app with an [Access Token](/tokens/access-token) and (optionally) an [ID Token](/tokens/concepts/id-tokens) in the hash fragment of the URI. The app can now extract the tokens from the hash fragment. + +1. The application parses out the Authorization Code, sends it to Auth0's [token endpoint](/api/authentication?http#authorization-code), and requests that Auth0 return (in exchange) the Access Token. The application identifies itself during this request using its assigned Client ID and Client Secret. + +1. If the request sent to the token endpoint is valid, Auth0 responds to the application's request with an ID Token, as well as an Access Token (and possibly a Refresh Token). + +1. The application can now validate the ID Token and retrieve the end user's information. The application can also use the Access Token to call desired APIs. + + If the application received an ID Token from the Authorization endpoint already, it should have validated the token's signature, `c_hash`, and any other claims as defined. You must validate such tokens [the way you would for an Implicit Flow](https://openid.net/specs/openid-connect-core-1_0.html#ImplicitIDTValidation). + +## How to implement the flow + +For details on how to implement this using Auth0, refer to [Execute the Hybrid Flow](/api-auth/tutorials/hybrid-flow). + +## Keep reading + +::: next-steps +- [Execute the Hybrid Flow](/api-auth/tutorials/hybrid-flow) +- [How to configure an API in Auth0](/apis) +- [Tokens](/tokens) +- [Application authentication for regular web apps](/flows/concepts/auth-code) +- [Application authentication for single-page apps](/flows/concepts/implicit) +::: \ No newline at end of file diff --git a/articles/api-auth/grant/implicit.md b/articles/api-auth/grant/implicit.md index 5846093f3a..bf1a08f84c 100644 --- a/articles/api-auth/grant/implicit.md +++ b/articles/api-auth/grant/implicit.md @@ -12,9 +12,7 @@ useCase: --- # Call APIs from Client-side Web Apps -<%= include('../../_includes/_pipeline2') %> - -In order to access an API from a [client-side app](/quickstart/spa) (typically a Single Page Application or a Mobile Application), you need to implement the OAuth 2.0 **Implicit Grant**. In this document we will see how this flow works. +In order to access an API from a [client-side app](/quickstart/spa) (typically a Single-Page Application or a Mobile Application), you need to implement the OAuth 2.0 **Implicit Grant**. In this document we will see how this flow works. ::: note If you need a refresher on the OAuth 2.0 protocol, you can go through our [OAuth 2.0](/protocols/oauth2) article. @@ -22,7 +20,7 @@ If you need a refresher on the OAuth 2.0 protocol, you can go through our [OAuth ## Overview -The **Implicit Grant** (defined in [RFC 6749, section 4.1](https://tools.ietf.org/html/rfc6749#section-4.2)) is similar to the [Authorization Code Grant](/api-auth/grant/authorization-code), but the main difference is that the application receives an [Access Token](/tokens/access-token) directly, without the need for an `authorization_code`. This happens because the application, which is typically a JavaScript app running within a browser, is less trusted than a web app running on the server, hence cannot be trusted with the `client_secret` (which is required in the [Authorization Code Grant](/api-auth/grant/authorization-code)). Also, in the Implicit Grant, no Refresh Tokens are returned for the same reason (for an alternative refer to [Silent authentication for SPAs](/api-auth/tutorials/silent-authentication)). +The **Implicit Grant** (defined in [RFC 6749, section 4.1](https://tools.ietf.org/html/rfc6749#section-4.2)) is similar to the [Authorization Code Grant](/api-auth/grant/authorization-code), but the main difference is that the application receives an [Access Token](/tokens/concepts/access-tokens) directly, without the need for an `authorization_code`. This happens because the application, which is typically a JavaScript app running within a browser, is less trusted than a web app running on the server, hence cannot be trusted with the `client_secret` (which is required in the [Authorization Code Grant](/api-auth/grant/authorization-code)). Also, in the Implicit Grant, no Refresh Tokens are returned for the same reason (for an alternative refer to [Silent authentication for SPAs](/api-auth/tutorials/silent-authentication)). Once the user authenticates, the application receives the Access Token in the hash fragment of the URI. The application can now use this Access Token to call the API on behalf of the user. @@ -32,7 +30,7 @@ Once the user authenticates, the application receives the Access Token in the ha 1. Auth0 authenticates the user. The first time the user goes through this flow a consent page will be shown where the permissions, that will be given to the Application, are listed (for example: post messages, list contacts, and so forth). - 1. Auth0 redirects the user to the app with an [Access Token](/tokens/access-token) (and optionally an [ID Token](/tokens/id-token)) in the hash fragment of the URI. The app can now extract the tokens from the hash fragment. In a Single Page Application (SPA) this would be done using Javascript and in a Mobile Application this is typically handled by interacting with a Web View. + 1. Auth0 redirects the user to the app with an [Access Token](/tokens/concepts/access-tokens) (and optionally an [ID Token](/tokens/concepts/id-tokens)) in the hash fragment of the URI. The app can now extract the tokens from the hash fragment. In a Single-Page Application (SPA) this would be done using Javascript and in a Mobile Application this is typically handled by interacting with a Web View. 1. The app can use the Access Token to call the API on behalf of the user. @@ -52,7 +50,7 @@ For details on how to implement this, refer to [How to implement the Implicit Gr ## Silent Authentication -If you need to authenticate your users without a login page (for example, when the user is already logged in via [SSO](/sso) scenario) or get a new Access Token (thus simulate refreshing an expired token), you can use Silent Authentication. +If you need to authenticate your users without a login page (for example, when the user is already logged in via [Single Sign-on (SSO)](/sso) scenario) or get a new Access Token (thus simulate refreshing an expired token), you can use Silent Authentication. For details on how to implement this, refer to [Silent Authentication](/api-auth/tutorials/silent-authentication). @@ -62,6 +60,6 @@ For details on how to implement this, refer to [Silent Authentication](/api-auth * [How to implement the Implicit Grant](/api-auth/tutorials/implicit-grant) * [How to protect your SPA against replay attacks](/api-auth/tutorials/nonce) * [How to configure an API in Auth0](/apis) -* [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) +* [Tokens](/tokens) * [Application Authentication for Client-side Web Apps](/application-auth/client-side-web) ::: diff --git a/articles/api-auth/grant/password.md b/articles/api-auth/grant/password.md index 48a7f2c31f..3da4c9a514 100644 --- a/articles/api-auth/grant/password.md +++ b/articles/api-auth/grant/password.md @@ -12,23 +12,11 @@ useCase: --- # Call APIs from Highly Trusted Applications -<%= include('../../_includes/_pipeline2') %> +<%= include('../_includes/_ropg-warning') %> -Highly trusted applications can use this flow to access APIs. In this flow the end-user is asked to fill in credentials (username/password), typically using an interactive form. This information is sent to the backend and from there to Auth0. +You can use the ROPG flow for your highly trusted applications to access APIs. In this flow the end-user is asked to fill in credentials (username/password), typically using an interactive form. This information is sent to the backend and from there to Auth0. -You should use this flow **only if** the following apply: -- The application is absolutely trusted with the user's credentials. For [client side](/api-auth/grant/implicit) applications and [mobile apps](/api-auth/grant/authorization-code-pkce) we recommend using web flows instead. -- Using a redirect-based flow is not possible. If this is not the case and redirects are possible in your application you should use the [Authorization Code Grant](/api-auth/grant/authorization-code) instead. - -::: note -If you need a refresher on the OAuth 2.0 protocol, you can go through our [OAuth 2.0](/protocols/oauth2) article. -::: - -## Overview - -The **Resource Owner Password Grant** (defined in [RFC 6749, section 4.3](https://tools.ietf.org/html/rfc6749#section-4.3)) can be used directly as an authorization grant to obtain an Access Token, and optionally a Refresh Token. This grant should only be used when there is a high degree of trust between the user and the application and when other authorization flows are not available. - -This grant type can eliminate the need for the application to store the user credentials for future use, by exchanging the credentials with a long-lived Access Token or Refresh Token. +ROPG (defined in [RFC 6749, section 4.3](https://tools.ietf.org/html/rfc6749#section-4.3)) can be used directly as an authorization grant to store the user credentials for future use, by exchanging the credentials for an Access Token, and optionally a Refresh Token. ![Resource Owner Password Grant](/media/articles/api-auth/password-grant.png) @@ -43,9 +31,9 @@ In OAuth 2.0 terms, the web app is the Client, the end user the Resource Owner, ## How to implement the flow -For details on how to implement this using Auth0, refer to [Execute the Resource Owner Password Grant](/api-auth/tutorials/password-grant). +For details on how to implement this using Auth0, see [Implement the Resource Owner Password Grant](/api-auth/tutorials/password-grant). -## Realm Support +## Realm support A extension grant that offers similar functionality with the **Resource Owner Password Grant**, including the ability to indicate a specific realm, is the `http://auth0.com/oauth/grant-type/password-realm`. @@ -55,7 +43,7 @@ For more information on how to implement this extension grant refer to [Executin ## Scopes -Due to the implied trust in these grants (a user providing his or her password to an application), the Access Token returned will include all of the available scopes defined for the audience API. An application can request a restricted set of scopes by using the `scope` parameter, or you can restrict the returned scopes by using a [rule](#customize-the-returned-token). +Due to the implied trust in these grants (a user providing his or her password to an application), the Access Token returned will include all of the available scopes defined for the audience API. An application can request a restricted set of scopes by using the `scope` parameter, or you can restrict the returned scopes by using a [rule](#customize-the-returned-token). ## Rules @@ -65,17 +53,15 @@ Due to the implied trust in these grants (a user providing his or her password t If you wish to execute special logic unique to the Password exchange, you can look at the `context.protocol` property in your rule. If the value is `oauth2-password`, then the rule is running during the password exchange. -For details on how to implement this, refer to [Execute the Resource Owner Password Grant: Customize the Tokens](/api-auth/tutorials/password-grant#optional-customize-the-tokens). +For details on how to implement this, see [Customize the Tokens](/api-auth/tutorials/password-grant#optional-customize-the-tokens). -## MFA Support +## MFA support and anomaly detection -For details on how to implement multi-factor authentication, refer to [Multi-factor Αuthentication and Resource Owner Password](/api-auth/tutorials/multifactor-resource-owner-password). +For details on how to implement multi-factor authentication (MFA), refer to [Multi-factor Authentication and Resource Owner Password](/mfa/guides/mfa-api/multifactor-resource-owner-password). + +When using this flow from server-side applications, some anomaly detection features might fail because of the particularities of this scenario. For details on how to implement this, while avoiding some common issues, refer to [Using Resource Owner Password from Server side](/api-auth/tutorials/using-resource-owner-password-from-server-side). ## Keep reading -::: next-steps -* [How to Execute a Resource Owner Password Grant](/api-auth/tutorials/password-grant) -* [How to use MFA with Resource Owner Password Grant](/api-auth/tutorials/multifactor-resource-owner-password) -* [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) -* [How to use Resource Owner Password Grant from the server side together with Anomaly Detection](/api-auth/tutorials/using-resource-owner-password-from-server-side) -::: +* [Implement the Resource Owner Password Grant](/api-auth/tutorials/password-grant) +* [Tokens](/tokens) diff --git a/articles/api-auth/index.md b/articles/api-auth/index.md index 43e9ab512a..2c2bdf84b6 100644 --- a/articles/api-auth/index.md +++ b/articles/api-auth/index.md @@ -20,13 +20,9 @@ useCase:

-::: note -**Heads up!** As part of our efforts to improve security and standards-based interoperability, we have implemented several new features in our authentication flows and made changes to existing ones. For an overview of these changes, and details on how you adopt them, refer to [Introducing OIDC Conformant Authentication](/api-auth/intro). -::: - At some point, your custom APIs will need to allow limited access to users, servers, or servers on behalf of users. With Auth0 you can manage the authorization requirements for server-to-server and application-to-server applications. -By using the OAuth 2.0 authorization framework, you can give your own applications or third-party applications limited access to your APIs on behalf of the application itself. With Auth0, you can easily support different flows in your own APIs without worrying about the OAuth 2.0/OpenID Connect specification, or the many other technical aspects of API authorization. +By using the OAuth 2.0 authorization framework, you can give your own applications or third-party applications limited access to your APIs on behalf of the application itself. With Auth0, you can easily support different flows in your own APIs without worrying about the OAuth 2.0/OpenID Connect (OIDC) specification, or the many other technical aspects of API authorization. In this page you can find a list of resources that can help you secure your APIs and access them in a secure manner. @@ -38,44 +34,44 @@ In this page you can find a list of resources that can help you secure your APIs

  • - Calling APIs from Server-side Web Apps + Call Your API from a Regular Web App

    If your application executes on a server and you want to configure it to use OAuth 2.0 to access an API, read these docs.

  • - Calling APIs from Mobile Apps + Call Your API from a Native/Mobile App

    If your application is a native app and you want to configure it to use OAuth 2.0 to access an API, read these docs.

  • - Calling APIs from Client-side Web Apps + Call Your API from a Single-Page App

    If your application is a JavaScript-centric app executing on the browser, and you want to configure it to use OAuth 2.0 to access an API, read these docs.

  • - Calling APIs from a Service + Call Your API from a Machine-to-Machine App

    If you want to implement server-to-server interaction, and you want to configure it to use OAuth 2.0, read these docs.

  • - Why you should always use Access Tokens to secure an API + Tokens

    - Learn about the differences between Αccess Τoken and ID Τoken and why the latter should never be used to secure an API. + Learn about the types of tokens related to identity and authentication and how they are used by Auth0.

  • @@ -147,15 +146,15 @@ In this page you can find a list of resources that can help you secure your APIs

  • - Verify Access Tokens + Validate Access Tokens

    Learn what an API has to do in order to verify a Bearer Access Token.

  • - Restrict User/Application Requests for API Scopes + Restrict Access to APIs

    - Learn how to restrict users/applications from requesting API scopes for which they don't have access. + Learn how to restrict users/applications from accessing APIs.

  • @@ -165,9 +164,9 @@ In this page you can find a list of resources that can help you secure your APIs

  • - How to Represent Multiple APIs Using a Single Auth0 API + Represent Multiple APIs Using a Single Logical API in Auth0

    - Learn how to represent multiple APIs using a single Auth0 API. + Learn how to represent multiple APIs using a single logical API.

  • diff --git a/articles/api-auth/intro.md b/articles/api-auth/intro.md index 719847eb60..77aa80441c 100644 --- a/articles/api-auth/intro.md +++ b/articles/api-auth/intro.md @@ -1,5 +1,4 @@ --- -title: Introducing OIDC Conformant Authentication description: An overview of the OIDC Conformant authentication flows, why these changes were made and how you can adopt them. toc: true topics: @@ -10,21 +9,21 @@ useCase: - secure-api - call-api --- -# Introducing OIDC Conformant Authentication +# OIDC-Conformant Authentication Overview **Released Date**: May 10, 2017 -As part of our efforts to improve security and standards-based interoperability, we have implemented several new features in our authentication flows and made changes to existing ones. This document presents an overview of these changes, explain why they were made and point you to other detailed tutorials to help you adopt these changes. +As part of our efforts to improve security and standards-based interoperability, we have implemented several new features in our authentication flows and made changes to existing ones. This document presents an overview of these changes, explains why they were made and points you to other detailed tutorials to help you adopt these changes. -We will start by reviewing the [new features](#what-s-new), continue with [what changed](#what-is-changing) and how you can [distinguish which authentication flow is used](#how-to-use-the-new-flows) (the latest or the legacy). Towards the end of this doc, you can find a [summarizing table](#legacy-vs-new) and [links for further reading](#keep-reading). +We will start by reviewing the [new features](#what-s-new), and then continue with [what changed](#what-is-changing) and how you can [distinguish which authentication flow is used](#how-to-use-the-new-flows) (the latest or the legacy). Towards the end of this doc, you can find a [summarizing table](#legacy-vs-new) and [links for further reading](#keep-reading). ## What should I read? If you are new to Auth0, go through the [What’s New](#what-s-new) section of this doc. There you can find all the cool new features we introduced, like the ability to create APIs, call them from services, or enable external parties or partners to access protected resources at your API in a secure way. Then head off to the [How to use the new flows](#how-to-use-the-new-flows) section and make sure that your new implementation follows our latest, and more secure, authentication pipeline. -If you are already using Auth0 in your app, you should read the complete doc. We have taken great care to make sure that we do not break our existing customers with this new OIDC conformant implementation, however you should be aware of all changes and new features, and how you can use them (or avoid doing so). It goes without saying that we strongly encourage you to adopt this authentication pipeline, to improve your app’s security. +If you are already using Auth0 in your app, you should read the complete doc. We have taken great care to make sure that we do not break our existing customers with this new OIDC conformant implementation. However, you should be aware of all changes and new features, and how you can use them (or avoid doing so). It goes without saying that we strongly encourage you to adopt this authentication pipeline, to improve your app’s security. -If you using Auth0 as a [SAML or WS-Federation identity provider](/protocols/saml/saml-idp-generic) to your application (that is, you're not using OIDC/OAuth), then you do not need to make any changes. +If you are using Auth0 as a [SAML or WS-Federation identity provider](/protocols/saml/saml-idp-generic) for your application (that is, you're not using OIDC/OAuth), then you do not need to make any changes. ## What's New @@ -57,14 +56,14 @@ For more information, refer to [User consent and third-party applications](/api- We implemented the OAuth 2.0 Client Credentials grant which allows applications to authenticate as themselves (that is, not on behalf of any user), in order to programmatically and securely obtain access to an API. ::: note -For more information on the Client Credentials grant, refer to [How to Implement the Client Credentials Grant](/api-auth/tutorials/client-credentials). +For more information on the Client Credentials grant, refer to [How to Implement the Client Credentials Grant](/flows/guides/client-credentials/call-api-client-credentials). ::: ## What is Changing ### Calling APIs with Access Tokens -Historically, protecting resources on your API has been accomplished using ID Tokens issued to your users after they authenticate in your applications. From now on, you should only use Access Tokens when calling APIs. ID Tokens should only be used by the application to verify that the user is authenticated and get basic user information. The main reason behind this change is security. For details on refer to [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis). +Historically, protecting resources on your API has been accomplished using ID Tokens issued to your users after they authenticate in your applications. From now on, you should only use Access Tokens when calling APIs. ID Tokens should only be used by the application to verify that the user is authenticated and get basic user information. The main reason behind this change is security. For details, refer to [Tokens](/tokens). ::: note For more information, refer to [Calling your APIs with Auth0 tokens](/api-auth/tutorials/adoption/api-tokens). @@ -72,24 +71,24 @@ For more information, refer to [Calling your APIs with Auth0 tokens](/api-auth/t ### User Profile Claims and Scope -Historically, you were able to define and request arbitrary application-specific claims. From now on, your application can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims), as [defined by the OIDC Specification](https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims), or any scopes supported by your [API](/apis). +Historically, you were able to define and request arbitrary application-specific claims. From now on, your application can request any of the [standard OpenID Connect (OIDC) scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims), as [defined by the OIDC Specification](https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims), or any scopes supported by your [API](/apis). -In order to add custom claims to ID Tokens or Access Tokens, they must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims) to avoid possible collisions with standard OIDC claims. +In order to add custom claims to ID Tokens or Access Tokens, they must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims) to avoid possible collisions with standard OIDC claims. -To customize the tokens, use Hooks for Client Credentials, and Rules for the rest of the grants: -- __Client Credentials__: [Customize Tokens using Hooks](/api-auth/tutorials/client-credentials/customize-with-hooks) -- __Resource Owner__: [Customize Tokens using Rules](/api-auth/grant/password#customizing-the-returned-tokens) -- __Implicit Grant__: [Customize Tokens using Rules](/api-auth/tutorials/implicit-grant#optional-customize-the-tokens) -- __Authorization Code__: [Customize Tokens using Rules](/api-auth/tutorials/authorization-code-grant#optional-customize-the-tokens) -- __Authorization Code (PKCE)__: [Customize Tokens using Rules](/api-auth/tutorials/authorization-code-grant-pkce#optional-customize-the-tokens) +To customize the tokens, use Hooks for the Client Credentials Flow, and Rules for the rest of the flows: +- __Client Credentials Flow__: [Customize Tokens using Hooks](/flows/guides/client-credentials/call-api-client-credentials#customize-tokens) +- __Trusted App Flow__: [Customize Tokens using Rules](/api-auth/grant/password#customizing-the-returned-tokens) +- __Single-Page Flow__: [Customize Tokens using Rules](/flows/guides/implicit/call-api-auth-code-pkce#customize-tokens) +- __Regular Web App Flow__: [Customize Tokens using Rules](/flows/guides/auth-code/call-api-auth-code#customize-tokens) +- __Native/Mobile Flow__: [Customize Tokens using Rules](/flows/guides/auth-code-pkce/call-api-auth-code-pkce#customize-tokens) ::: note For more information, refer to [User profile claims and scope](/api-auth/tutorials/adoption/scope-custom-claims). ::: -### Single Sign On (SSO) +### Single Sign-on (SSO) -Initiating an SSO session must now happen __only__ from an Auth0-hosted page and not from applications. This means that for SSO to work, you must be using [Universal Login](/hosted-pages/login). Users must be redirected to the login page and then redirected to your application once authentication is complete. +Initiating an Single Sign-on (SSO) session must now happen __only__ from an Auth0-hosted page and not from applications. This means that for SSO to work, you must be using Universal Login. Users must be redirected to the login page and then redirected to your application once authentication is complete. ::: note Support for SSO from applications is planned for a future release. @@ -106,15 +105,15 @@ Not all [OAuth 2.0 grants](/protocols/oauth2#authorization-grant-types) support - Authorization Code + Authorization Code Yes - Authorization Code (PKCE) + Authorization Code (PKCE) Yes - Implicit + Implicit Yes @@ -125,7 +124,7 @@ Not all [OAuth 2.0 grants](/protocols/oauth2#authorization-grant-types) support ::: note -For more information, refer to [OIDC Single sign-on](/api-auth/tutorials/adoption/single-sign-on). +For more information, refer to [OIDC Single Sign-on (SSO)](/api-auth/tutorials/adoption/single-sign-on). ::: ### Authorization Code Grant @@ -134,8 +133,8 @@ Some changes were introduced in the implementation of Authorization Code grant: - The `device` request parameter has been removed. - The `audience` request parameter has been introduced. This denotes the target API for which the token should be issued. -- The returned Access Token is a [JWT](/jwt), valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) and the API specified by the `audience` parameter. -- A Refresh Token will be returned only if the `offline_access` scope was granted. +- The returned Access Token is a [JWT](/tokens/concepts/jwts), valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) and the API specified by the `audience` parameter. +- A Refresh Token will be returned only if the `offline_access` scope was granted. ::: note For more information, refer to [Authorization Code grant](/api-auth/tutorials/adoption/authorization-code). @@ -149,8 +148,8 @@ Some changes were introduced in the implementation of Implicit grant: - The `audience` request parameter has been introduced. This denotes the target API for which the token should be issued. - The `response_type` request parameter indicates whether we want to receive both an Access Token and ID Token. If using `response_type=id_token`, we will return only an ID Token. - Refresh Tokens are not allowed. [Use `prompt=none` instead](/api-auth/tutorials/silent-authentication). -- The `nonce` request parameter must be a [cryptographically secure random string](/api-auth/tutorials/nonce). After validating the ID Token, the application must [validate the nonce to mitigate replay attacks](/api-auth/tutorials/nonce). Requests made without a `nonce` parameter will be rejected. -- The returned Access Token is a [JWT](/jwt), valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) and the API specified by the `audience` parameter. +- The `nonce` request parameter must be a [cryptographically-secure random string](/api-auth/tutorials/nonce). After validating the ID Token, the application must [validate the nonce to mitigate replay attacks](/api-auth/tutorials/nonce). Requests made without a `nonce` parameter will be rejected. +- The returned Access Token is a [JWT](/tokens/concepts/jwts), valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) and the API specified by the `audience` parameter. - ID Tokens will be signed asymmetrically using `RS256`. ::: note @@ -165,8 +164,8 @@ Some changes were introduced in the implementation of Resource Owner Password gr - The `audience` request parameter has been introduced. This denotes the target API for which the token should be issued. - The endpoint to execute token exchanges is [/oauth/token](/api/authentication#resource-owner-password). - [Auth0's own grant type](/api-auth/tutorials/password-grant#realm-support) is used to authenticate users from a specific connection (`realm`). The [standard OIDC password grant](/api-auth/tutorials/password-grant) is also supported, but it does not accept Auth0-specific parameters such as `realm`. -- The returned Access Token is a [JWT](/jwt), valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) and the API specified by the `audience` parameter. -- The ID Token will be forcibly signed using `RS256` if requested by a [public application](/applications/application-types#public-applications). +- The returned Access Token is a [JWT](/tokens/concepts/jwts), valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) and the API specified by the `audience` parameter. +- The ID Token will be forcibly signed using `RS256` if requested by a [public application](/applications/concepts/app-types-confidential-public#public-applications). - A Refresh Token will be returned only if the `offline_access` scope was granted. ::: note @@ -175,6 +174,8 @@ For more information, refer to [Resource Owner Password Credentials exchange](/a ### Delegation +<%= include('../_includes/_deprecate-delegation') %> + [Delegation](/api/authentication#delegation) is used for many operations: - Exchanging an ID Token issued to one application for a new one issued to a different application - Using a Refresh Token to obtain a fresh ID Token @@ -182,13 +183,11 @@ For more information, refer to [Resource Owner Password Credentials exchange](/a Given that [ID Tokens should no longer be used as API tokens](/api-auth/tutorials/adoption/api-tokens) and that [Refresh Tokens should be used only at the token endpoint](/api-auth/tutorials/adoption/refresh-tokens), this endpoint is now considered deprecated. -At the moment there is no OIDC-compliant mechanism to obtain third-party API tokens. In order to facilitate a gradual migration to the new authentication pipeline, delegation can still be used to obtain third-party API tokens. This will be deprecated in future releases. - ### Passwordless -Our new implementation only supports an [OIDC-conformant](/api-auth/tutorials/adoption) passwordless authentication mechanism when using web applications (with Lock.js or auth0.js). +Our new implementation only supports an [OIDC-conformant](/api-auth/tutorials/adoption) passwordless authentication mechanism when using web applications (with Lock.js or auth0.js). -Native applications need to use Universal Login (with an Auth0-hosted login page). Customers can use the Lock (Passwordless) template in the [Dashboard](${manage_url}/#/login) under **Hosted Pages -> Login -> Default Templates**, or customize it to fit specific requirements. +Native applications need to use Universal Login (with an Auth0-hosted login page). Customers can use the Lock (Passwordless) template in the [Dashboard](${manage_url}/#/login_settings) under **Universal Login -> Login -> Default Templates**, or customize it to fit specific requirements. ### Other Authentication API endpoints @@ -213,7 +212,7 @@ To mark your application as OIDC Conformant: go to [Dashboard](${manage_url}) > ![OIDC Conformant flag](/media/articles/api-auth/oidc-conformant-flag.png) -To use the `audience` param instead, configure your app to send it when initiating an authorization request. +To use the `audience` parameter instead, configure your app to send it when initiating an authorization request. ## Legacy vs New @@ -249,7 +248,7 @@ To use the `audience` param instead, configure your app to send it when initiati Add arbitrary claims in Tokens Supported - Supported. The namespaced format has to be used. + Supported. The namespaced format has to be used. SSO @@ -321,10 +320,8 @@ should be used instead with "grant_type": "refresh_token" -## Keep Reading +## Keep reading -::: next-steps * [API Authorization index](/api-auth) -* [Why you should use Access Tokens to secure APIs?](/api-auth/why-use-access-tokens-to-secure-apis) -* [Tokens used by Auth0](/tokens) -::: +* [Tokens](/tokens) + diff --git a/articles/api-auth/passwordless.md b/articles/api-auth/passwordless.md index 88515b07f7..cc007bfeb4 100644 --- a/articles/api-auth/passwordless.md +++ b/articles/api-auth/passwordless.md @@ -14,9 +14,7 @@ useCase: <%= include('./tutorials/adoption/_about.md') %> -## About Passwordless Authentication - -Passwordless connections allow users to login without the need to remember a password. +Passwordless connections allow users to login without the need to remember a password. This improves the user experience, especially on mobile applications, since users will only need to remember an email address or phone number to authenticate with your application. @@ -24,6 +22,6 @@ Without passwords, your application will not need to implement a password-reset ## OIDC Conformant Passwordless -Auth0 currently supports [OIDC-conformant](/api-auth/tutorials/adoption) passwordless authentication using [Universal Login](/hosted-pages/login) as well as in embedded web authentication scenarios using the newest [Lock](/libraries/lock) or [Auth0.js](/libraries/auth0js) libraries. +Auth0 currently supports [OIDC-conformant](/api-auth/tutorials/adoption) passwordless authentication using Universal Login as well as in embedded web authentication scenarios using the newest [Lock](/libraries/lock) or [Auth0.js](/libraries/auth0js) libraries. -Native applications need to use Universal Login (with Auth0-hosted login page). Customers can use the Lock (Passwordless) template in the [Dashboard](${manage_url}) under **Hosted Pages > Default Templates**, or customize it to fit specific requirements. +Native applications need to use Universal Login. Customers can use the Lock (Passwordless) template for the login page in the [Dashboard](${manage_url}) under **Universal Login > Login > Default Templates**, or customize the page to fit specific requirements. diff --git a/articles/api-auth/restrict-access-api.md b/articles/api-auth/restrict-access-api.md new file mode 100644 index 0000000000..ae857bd87b --- /dev/null +++ b/articles/api-auth/restrict-access-api.md @@ -0,0 +1,83 @@ +--- + title: Restrict Access to APIs + description: Learn how to write rules that will restrict user/application access to an API. + topics: + - api-authentication + - oidc + - scopes + - permissions +contentType: how-to +useCase: + - secure-api + - call-api +--- + +# Restrict Access to APIs + +Sometimes you may not want to allow an application or user to access an API. For example, you may want to restrict access to an API based on the calling application or a user's role or location. To do so, we use [rules](/rules). + +## Example: Deny access to anyone calling the API + +In this example, we want to deny access to all users who are calling the API. To do this, we create a [rule](/rules) to deny access depending on the `audience` parameter. In this case, the `audience` value for our API is `http:://todoapi2.api`, so this is the audience we will refuse. + +::: note +The value of an API's `audience` is displayed in the **API Audience** field in the [APIs section of the Auth0 Dashboard](${manage_url}/#/apis). +::: + +When a restricted user attempts to access the API, they will receive an `HTTP 401` response. + +```js +function (user, context, callback) { + + /* + * Denies access to user-based flows based on audience + */ + + var audience = ''; + + audience = audience + || (context.request && context.request.query && context.request.query.audience) + || (context.request && context.request.body && context.request.body.audience); + + if (audience === 'http://todoapi2.api' || !audience) { + return callback(new UnauthorizedError('end_users_not_allowed')); + } + + return callback(null, user, context); +} +``` + +## Example: Deny access to users from a specific calling application + +In this example, we want to deny access to all users who are accessing the API from a specific calling application. To do this, we create a [rule](/rules) to deny access depending on the `client_id` parameter. This is equivalent to disabling all connections for an application. + +::: note +The value of an application's `client_id` is displayed in the **Client ID** field in the [Applications section of the Auth0 Dashboard](${manage_url}/#/applications). +::: + +When a restricted user attempts to access the API, they will receive an `HTTP 401` response. + +```js +function (user, context, callback) { + + /* + * Denies access to user-based flows based on client ID + */ + + var client_id = ''; + client_id = context.clientID; + + if (client_id === 'CLIENT_ID') { + return callback(new UnauthorizedError('end_users_not_allowed')); + } + + return callback(null, user, context); +} +``` +## Example: Deny access to users based on a role + +By default, any user associated with an [Auth0 application](/applications) can request any [custom API scopes](/scopes/current/api-scopes) that have been created. Sometimes you may not want to allow a user to request certain scopes, though. + +To limit a user's scopes, you can assign them a role so that requests on their behalf are limited to just the scopes assigned to that role. To do this, you can use the [Authorization Extension](/extensions/authorization-extension) and a custom [Rule](/rules). + +We discuss this approach in more depth in our [SPA+API Architecture Scenario](/architecture-scenarios/spa-api). Specifically, you can review the [Configure the Authorization Extension](/architecture-scenarios/spa-api/part-2#configure-the-authorization-extension) section to learn how to configure the Authorization Extension and create a custom Rule that will ensure scopes are granted based on a user's role. diff --git a/articles/api-auth/restrict-requests-for-scopes.md b/articles/api-auth/restrict-requests-for-scopes.md deleted file mode 100644 index b3f6f1f701..0000000000 --- a/articles/api-auth/restrict-requests-for-scopes.md +++ /dev/null @@ -1,70 +0,0 @@ ---- - description: Writing rules to restrict user/client access to an API - topics: - - api-authentication - - oidc - - scopes -contentType: how-to -useCase: - - secure-api - - call-api ---- - -# Restrict Application or User Requests for API Scopes - -By default, any user associated with an [Auth0 application](/applications) can request an API's [scope(s)](/scopes#api-scopes). If you would like to restrict access to the API's scopes based on the user's role, application association, location, and so on, you can do so via [rules](/rules). Then, if a restricted user attempts to request scopes not permitted to them, they will receive an `HTTP 401` response. - -## Example: Deny access based on the API audience - -The following [rule](/rules), demonstrates how you would deny access on an API, depending on the `audience` parameter. In this example, we deny access to all users, if the API they are trying to access has the `audience` set to `http://todoapi2.api`. - -```js -function (user, context, callback) { - - /* - * Denies access to user-based flows based on audience - */ - - var audience = ''; - - audience = audience - || (context.request && context.request.query && context.request.query.audience) - || (context.request && context.request.body && context.request.body.audience); - - if (audience === 'http://todoapi2.api' || !audience) { - return callback(new UnauthorizedError('end_users_not_allowed')); - } - - return callback(null, user, context); -} -``` - -::: note -The value of an API's `audience` is displayed at the **API Audience** field, at [Dashboard > APIs](${manage_url}/#/apis). -::: - -## Example: Deny access based on the Client ID - -The following [rule](/rules), demonstrates how you would deny access on an API, depending on the application the user is associated with. In this example, we deny access to all users, if the application through which they login, has an ID equal to `CLIENT_ID` (this is equivalent to disabling **all** Connections for the application). - -```js -function (user, context, callback) { - - /* - * Denies access to user-based flows based on client ID - */ - - var client_id = ''; - client_id = context.clientID; - - if (client_id === 'CLIENT_ID') { - return callback(new UnauthorizedError('end_users_not_allowed')); - } - - return callback(null, user, context); -} -``` - -::: note -The value of a client's Id is displayed at the **Client ID** field, at [Dashboard > Applications](${manage_url}/#/applications). -::: diff --git a/articles/api-auth/token-renewal-in-safari.md b/articles/api-auth/token-renewal-in-safari.md index 3cef47c59e..88742f553a 100644 --- a/articles/api-auth/token-renewal-in-safari.md +++ b/articles/api-auth/token-renewal-in-safari.md @@ -12,24 +12,45 @@ useCase: --- # Renew Tokens When Using Safari -Renewing tokens with the **checkSession()** function does not work correctly with the latest version of the Safari browser. +Renewing tokens with the `checkSession()` function does not work correctly with the latest version of the Safari browser. -## Background +Recent versions of the Safari browser introduced a new featured called [Intelligent Tracking Prevention (ITP)](https://webkit.org/blog/category/privacy/). ITP is designed to prevent websites from tracking user activity across multiple websites. -Recent versions of the Safari browser introduced a new featured called [Intelligent Tracking Prevention (ITP)](https://webkit.org/blog/8142/intelligent-tracking-prevention-1-1/). ITP is designed to prevent websites from tracking user activity across multiple websites. - -By default, ITP is active. You can determine if the Safari version you're using has ITP by going to **Preferences > Privacy** tab and seeing if the **Prevent cross-site tracking** option is checked. +By default, ITP is active. You can determine if the Safari version you are using has ITP by going to **Preferences > Privacy** tab and seeing if the **Prevent cross-site tracking** option is checked. ![Safari privacy preferences pane](/media/articles/api-auth/safari-privacy-preferences.png) -## ITP and Browser Behavior +## ITP and browser behavior + +Enabling ITP causes the browser to behave as if you had disabled third-party cookies in the browser: **checkSession()** is unable to access the current user's session, which makes it impossible to obtain a new token without displaying anything to the user. + +This is akin to the way OpenID Connect (OIDC) uses iframes for handling [sessions](/sessions) in SPAs. + +## Workarounds + +Recent advancements in user privacy controls in browsers adversely impact the user experience by preventing access to third-party cookies. You can use [Refresh Token Rotation](/tokens/concepts/refresh-token-rotation) as an alternative that provides a secure method for using refresh tokens in SPAs while providing end-users with seamless access to resources without the disruption in UX caused by browser privacy technology like ITP. + +Alternatively, you can work around the issues posed by ITP by using Auth0's [custom domains](/custom-domains) functionality, particularly if the custom domain lives on a *subdomain* of the application's website domain. For example, if your application is hosted on **example.com**, the custom domain would need to be of the format **subdomain.example.com**. + +## ITP debug mode + +[Safari Technology Preview](https://developer.apple.com/safari/technology-preview/) offers an "Intelligent Tracking Prevention Debug Mode" that you can use to troubleshoot ITP issues. You can find instructions on how to debug ITP on [this blog post from WebKit](https://webkit.org/blog/8387/itp-debug-mode-in-safari-technology-preview-62/). -Enabling ITP causes the browser to behave as if you'd disabled third-party cookies in the browser: **checkSession()** is unable to access the current user's session, which makes it impossible to obtain a new token without displaying anything to the user. +**NOTE**: The instructions mention how to permanently classify a custom domain as having tracking abilities for testing purposes. In later versions of Safari Technology Preview, though, the domain to store the User Defaults for this setting changed from `com.apple.SafariTechnologyPreview` to `com.apple.WebKit.Networking`. If you are having trouble with the commands mentioned in the instructions, try these: -This is akin to the way OpenID Connect uses iFrames for handling sessions in single page applications (SPAs). Auth0 is working with [OpenID Connect AB/Connect Working Group](http://openid.net/wg/connect/) to determine if this issue can be addressed at the standards level. +* Classify a site as having tracking abilities: +``` +defaults write com.apple.WebKit.Networking ResourceLoadStatisticsManualPrevalentResource example.com +``` -## Solution +* Inspect the setting: +``` +defaults read com.apple.WebKit.Networking ResourceLoadStatisticsManualPrevalentResource +``` -There is currently no solution that will work with all use cases. +* Delete the setting: +``` +defaults delete com.apple.WebKit.Networking ResourceLoadStatisticsManualPrevalentResource +``` -You can work around the issues posed by ITP by using Auth0s [custom domains](/custom-domains) functionality, particularly if the custom domain lives on a *subdomain* of the application's website domain. For example, if your application is hosted on **example.com**, the custom domain would need to be of the format **subdomain.example.com**. \ No newline at end of file +You will need to restart Safari Technology Preview every time you make changes for the settings to take effect. diff --git a/articles/api-auth/tutorials/adoption/_index.md b/articles/api-auth/tutorials/adoption/_index.md index 63ca6e0e51..40760b5d79 100644 --- a/articles/api-auth/tutorials/adoption/_index.md +++ b/articles/api-auth/tutorials/adoption/_index.md @@ -1,14 +1,13 @@ -* [Calling your APIs with Auth0 tokens](/api-auth/tutorials/adoption/api-tokens) -* [User consent and third-party applications](/api-auth/user-consent) -* [Custom user profile claims and `scope`](/api-auth/tutorials/adoption/scope-custom-claims) -* [Single sign-on (SSO)](/api-auth/tutorials/adoption/single-sign-on) +* [Call APIs with Auth0 Tokens](/api-auth/tutorials/adoption/api-tokens) +* [User Consent and Third-Party Applications](/api-auth/user-consent) +* [User Profile Claims and the `scope` Parameter](/api-auth/tutorials/adoption/scope-custom-claims) +* [Single Sign-on (SSO)](/api-auth/tutorials/adoption/single-sign-on) * Initiating authentication flows: - - [Authorization Code grant](/api-auth/tutorials/adoption/authorization-code) - - [Implicit grant](/api-auth/tutorials/adoption/implicit) - * [Silent authentication](/api-auth/tutorials/silent-authentication) (replaces Refresh Tokens for single-page applications) - - [Resource Owner Password Credentials exchange](/api-auth/tutorials/adoption/password) - - [Client Credentials exchange](/api-auth/tutorials/adoption/client-credentials) (only available in new pipeline) + - [Authorization Code Grant](/api-auth/tutorials/adoption/authorization-code) + - [Implicit Grant](/api-auth/tutorials/adoption/implicit) + * [Silent Authentication](/api-auth/tutorials/silent-authentication) (replaces Refresh Tokens for single-page applications) + - [Resource Owner Password Credentials Exchange](/api-auth/tutorials/adoption/password) + - [Client Credentials Exchange](/api-auth/tutorials/adoption/client-credentials) (only available in new pipeline) * [Refresh Tokens](/api-auth/tutorials/adoption/refresh-tokens) -* [Delegation (deprecated)](/api-auth/tutorials/adoption/delegation) -* [Passwordless authentication](/api-auth/passwordless) -* [List of breaking changes for OIDC-conformant applications](/api-auth/tutorials/adoption/oidc-conformant) +* [Passwordless Authentication](/api-auth/passwordless) +* [OIDC-Conformant Applications](/api-auth/tutorials/adoption/oidc-conformant) diff --git a/articles/api-auth/tutorials/adoption/api-tokens.md b/articles/api-auth/tutorials/adoption/api-tokens.md index eaab0373f1..8c310789ec 100644 --- a/articles/api-auth/tutorials/adoption/api-tokens.md +++ b/articles/api-auth/tutorials/adoption/api-tokens.md @@ -1,5 +1,5 @@ --- -title: Calling your APIs with Auth0 tokens +title: Call APIs with Auth0 Tokens description: The OIDC-conformant pipeline and how this affects your use of Auth0 tokens with external APIs topics: - tokens @@ -13,23 +13,23 @@ useCase: - secure-api - call-api --- -# Call your APIs with Auth0 tokens +# Call APIs with Auth0 Tokens <%= include('./_about.md') %> -With the OIDC-conformant pipeline, [all APIs should be secured with Access Tokens, not ID Tokens](/api-auth/why-use-access-tokens-to-secure-apis). In this article, we discuss what this means and what you need to do if you're using Auth0 tokens with your APIs. +With the OIDC-conformant pipeline, all APIs should be secured with Access Tokens, not ID Tokens. In this article, we discuss what this means and what you need to do if you're using Auth0 tokens with your APIs. ## OIDC-conformant pipeline and tokens In the OIDC-conformant pipeline, **ID Tokens should never be used as API tokens**. -Instead, applications and APIs (resource services) should be defined as separate Auth0 entities. This allows you to obtain Access Tokens for your APIs. +Instead, applications and APIs (resource services) should be defined as separate Auth0 entities. This allows you to obtain Access Tokens for your APIs. -You get simpler API integration since your APIs are no longer tied to the applications that make calls to it. You're also enabling [machine to machine integration scenarios](/api-auth/grant/client-credentials), since applications +You get simpler API integration since your APIs are no longer tied to the applications that make calls to it. You're also enabling [machine-to-machine integration scenarios](/flows/concepts/client-credentials), since applications can authenticate as themselves (that is, they are not acting on behalf of any user) to programmatically and securely obtain an API token. For example, [the Auth0 Management API is already defined as a resource server on your -Auth0 domain](${manage_url}/#/apis/management/settings). You can then authorize applications seeking access to obtain API tokens with specific scopes in a secure way. +Auth0 domain](${manage_url}/#/apis/management/settings). You can then authorize applications seeking access to obtain API tokens with specific scopes in a secure way. ### Access vs. ID Tokens @@ -56,7 +56,7 @@ One way to understand how Access and ID Tokens differ in their behavior is to lo The sample above shows the contents of an ID Token. ID Tokens are meant only for **authenticating** the users to the **application**. -Note that the audience value (located in the **aud** claim) of the token is set to the application's identifier. This means that only this specific application should consume the token. +Note that the audience value (located in the **aud** claim) of the token is set to the application's identifier. This means that only this specific application should consume the token. You can think of the ID Token as a performance optimization that allows applications to obtain user profile information without making additional requests after the completion of the authentication process. ID Tokens should never be used to obtain direct access to resources or to make authorization decisions. @@ -83,7 +83,7 @@ The Access Token is meant to **authorize** the user to the **API (resource serve The token does not contain any information about the user except for the user ID (located in the **sub** claim). The token only contains authorization information about the actions that application is allowed to perform at the API (such permissions are referred to as **scopes**). -In many cases, you may find it useful to retrieve additional user information. You can do this by calling the [/userinfo API endpoint](/api/authentication#get-user-info) with the Access Token. Be sure that the API for which the Access Token is issued uses the **RS256** signing algorithm. +In many cases, you may find it useful to retrieve additional user information. You can do this by calling the [/userinfo API endpoint](/api/authentication#get-user-info) with the Access Token. Be sure that the API for which the Access Token is issued uses the **RS256** [signing algorithm](/tokens/concepts/signing-algorithms). ## Scopes @@ -96,7 +96,7 @@ The scope parameter in the OIDC-conformant pipeline determines: If you have multiple apps calling an API under a single client ID, you should represent each application with a single Auth0 application, each of which can interact with the resource server representing the API on which these apps depend. -Similarly, if you use [delegation to exchange tokens obtained by one application for tokens for a different application](/tokens/delegation), you should also be using a multi-application solution, each authenticating to the same resource server. +Similarly, if you use delegation to exchange tokens obtained by one application for tokens for a different application, you should also be using a multi-application solution, each authenticating to the same resource server. If your applications do not depend on external APIs and you just need to authenticate users, you do not need to define a resource server/API as long as the ID Tokens are: @@ -107,6 +107,6 @@ If your applications do not depend on external APIs and you just need to authent For more information on API authentication and authorization refer to API Authorization. ::: -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/authorization-code.md b/articles/api-auth/tutorials/adoption/authorization-code.md index 4872714c70..692a46e71f 100644 --- a/articles/api-auth/tutorials/adoption/authorization-code.md +++ b/articles/api-auth/tutorials/adoption/authorization-code.md @@ -10,11 +10,11 @@ useCase: - call-api --- -# Authorization Code grant +# Authorization Code Grant <%= include('./_about.md') %> -The [Authorization Code grant](/api-auth/grant/authorization-code) is used by server-side applications that are capable of securely storing secrets, or by [native applications through PKCE](/api-auth/grant/authorization-code-pkce). +The [Authorization Code Grant](/flows/concepts/auth-code) is used by server-side applications that are capable of securely storing secrets, or by [native applications through PKCE](/flows/concepts/auth-code-pkce). This document describes the differences of this flow between the legacy and OIDC-conformant authentication pipelines. ## Authentication request @@ -36,7 +36,7 @@ This document describes the differences of this flow between the legacy and OIDC &redirect_uri=https://app.example.com/callback &device=my-device-name
    @@ -50,7 +50,7 @@ This document describes the differences of this flow between the legacy and OIDC
    • favorite_color is no longer a valid scope value.
    • The device parameter is removed.
    • -
    • The audience parameter is optional.
    • +
    • The audience parameter is optional.
    @@ -72,15 +72,38 @@ Location: https://app.example.com/callback? An authorization code can be exchanged in the same way in both pipelines: -```text -POST /oauth/token HTTP/1.1 -Content-Type: application/json +```har { - "grant_type": "authorization_code", - "client_id": "123", - "client_secret": "...", - "code": "SplxlOBeZQQYbYS6WxSbIA", - "redirect_uri": "https://app.example.com/callback" + "method": "POST", + "url": "https://${account.namespace}/oauth/token", + "headers": [ + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } + ], + "postData" : { + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "${account.callback}" + } + ] + } } ``` @@ -107,8 +130,8 @@ Pragma: no-cache "id_token": "eyJ..." }
      -
    • The returned Access Token is only valid for calling the /userinfo endpoint.
    • -
    • A Refresh Token will be returned only if a device parameter was passed and the offline_access scope was requested.
    • +
    • The returned Access Token is only valid for calling the /userinfo endpoint.
    • +
    • A Refresh Token will be returned only if a device parameter was passed and the offline_access scope was requested.
    @@ -124,7 +147,7 @@ Pragma: no-cache "id_token": "eyJ..." }
      -
    • The returned Access Token is valid for optionally calling the API specified in the audience parameter and the /userinfo endpoint (provided that the API uses RS256 as the signing algorithm and openid is used as a scope parameter). If you are not implementing your own Resource Server (API), then you can use https://{$account.namespace}/userinfo as the audience parameter, which will return an opaque Access Token.
    • +
    • The returned Access Token is valid for optionally calling the API specified in the audience parameter and the /userinfo endpoint (provided that the API uses RS256 as the signing algorithm and openid is used as a scope parameter). If you are not implementing your own Resource Server (API), then you can use https://${account.namespace}/userinfo as the audience parameter, which will return an opaque Access Token.
    • A Refresh Token will be returned only if the offline_access scope was granted.
    @@ -165,7 +188,7 @@ Pragma: no-cache "https://app.example.com/favorite_color": "blue" }
      -
    • The favorite_color claim must be namespaced and added through a rule.
    • +
    • The favorite_color claim must be namespaced and added through a rule.
    @@ -201,12 +224,12 @@ Pragma: no-cache "scope": "openid email" }
      -
    • The returned Access Token is valid for optionally calling the API specified in the audience parameter and the /userinfo endpoint (provided that the API uses RS256 as the signing algorithm and openid is used as a scope parameter). If you are not implementing your own Resource Server (API), then you can use https://{$account.namespace}/userinfo as the audience parameter, which will return an opaque Access Token.
    • +
    • The returned Access Token is valid for optionally calling the API specified in the audience parameter and the /userinfo endpoint (provided that the API uses RS256 as the signing algorithm and openid is used as a scope parameter). If you are not implementing your own Resource Server (API), then you can use https://${account.namespace}/userinfo as the audience parameter, which will return an opaque Access Token.
    -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/client-credentials.md b/articles/api-auth/tutorials/adoption/client-credentials.md index b25c079960..bc6189bcf3 100644 --- a/articles/api-auth/tutorials/adoption/client-credentials.md +++ b/articles/api-auth/tutorials/adoption/client-credentials.md @@ -10,20 +10,20 @@ useCase: - call-api --- -# Client Credentials exchange +# Client Credentials Exchange <%= include('./_about.md') %> -The [Client Credentials exchange](/api-auth/grant/client-credentials) allows apps to authenticate as themselves (that is, not on behalf of any user) to programmatically and securely obtain access to an API. +The [Client Credentials exchange](/flows/concepts/client-credentials) allows apps to authenticate as themselves (that is, not on behalf of any user) to programmatically and securely obtain access to an API. This exchange does not exist in the legacy pipeline, but the [Resource Owner Password Credentials exchange](/api-auth/tutorials/adoption/password) can be used to simulate it by creating a "service user". We strongly discourage the latter approach in favor of using Client Credentials, since it allows defining fine-grained permissions for each API app. ::: note - For more information on how to execute a Client Credentials exchange refer to Call APIs from Client-side Web Apps. + For more information on how to execute a Client Credentials exchange, refer to Call API Using the Client Credentials Flow. ::: -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/delegation.md b/articles/api-auth/tutorials/adoption/delegation.md index 636b4a0d2c..8fea9b651a 100644 --- a/articles/api-auth/tutorials/adoption/delegation.md +++ b/articles/api-auth/tutorials/adoption/delegation.md @@ -10,14 +10,16 @@ useCase: - call-api --- -# Delegation and the OIDC-conformant pipeline +# Delegation and the OIDC-Conformant Pipeline + +<%= include('../../../_includes/_deprecate-delegation') %> <%= include('./_about.md') %> [Delegation](/api/authentication#delegation) is used for many operations, depending on your particular use case: * Exchanging an ID Token issued to one application for a new one issued to a different application -* Using a Refresh Token to obtain a fresh ID Token +* Using a Refresh Token to obtain a fresh ID Token * Exchanging an ID Token for a third-party API token, such as Firebase or AWS. Given that [ID Tokens should no longer be used as API tokens](/api-auth/tutorials/adoption/api-tokens) and that [Refresh Tokens should be used only at the token endpoint](/api-auth/tutorials/adoption/refresh-tokens), this endpoint is now considered deprecated. @@ -30,6 +32,6 @@ At the moment there is no OIDC-compliant mechanism to obtain third-party API tok In order to facilitate a gradual migration to the new authentication pipeline, delegation can still be used to obtain third-party API tokens. This will be deprecated in future releases. -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/implicit.md b/articles/api-auth/tutorials/adoption/implicit.md index b9c9d284fb..451729f8b3 100644 --- a/articles/api-auth/tutorials/adoption/implicit.md +++ b/articles/api-auth/tutorials/adoption/implicit.md @@ -1,5 +1,5 @@ --- -title: OIDC-conformant Implicit grant +description: Understand how the implicit grant is used by apps that are incapable of securely storing secrets such as SPA JS apps. topics: - api-authentication - oidc @@ -10,11 +10,11 @@ useCase: - call-api --- -# Implicit grant +# Implicit Grant <%= include('./_about.md') %> -The [Implicit grant](/api-auth/grant/implicit) is used by applications that are incapable of securely storing secrets, such as single-page JavaScript applications. +The [Implicit grant](/flows/concepts/implicit) is used by applications that are incapable of securely storing secrets, such as single-page JavaScript applications. This document describes the differences of this flow between the legacy and OIDC-conformant authentication pipelines. ## Authentication request @@ -36,7 +36,7 @@ This document describes the differences of this flow between the legacy and OIDC &redirect_uri=https://app.example.com &device=my-device-name
    @@ -49,11 +49,11 @@ This document describes the differences of this flow between the legacy and OIDC &redirect_uri=https://app.example.com &audience=https://api.example.com
      -
    • This response_type parameter indicates that we want to receive both an Access Token and ID Token.
    • -
    • Refresh Tokens are not allowed in the implicit grant. Use prompt=none instead.
    • +
    • This response_type parameter indicates that we want to receive both an Access Token and ID Token.
    • +
    • Refresh Tokens are not allowed in the implicit grant. Use prompt=none instead.
    • favorite_color is no longer a valid scope.
    • -
    • The audience parameter is optional.
    • -
    • The nonce parameter must be a cryptographically secure random string.
    • +
    • The audience parameter is optional.
    • +
    • The nonce parameter must be a cryptographically-secure random string.
    @@ -92,7 +92,7 @@ Location: https://app.example.com/# &id_token=eyJ... &token_type=Bearer
      -
    • The returned Access Token is valid for calling the /userinfo endpoint (provided that the API specified by the audience param uses RS256 as signing algorithm) and optionally the resource server specified by the audience parameter.
    • +
    • The returned Access Token is valid for calling the /userinfo endpoint (provided that the API specified by the audience param uses RS256 as signing algorithm) and optionally the resource server specified by the audience parameter.
    • If using response_type=id_token, Auth0 will only return an ID Token.
    • Refresh Tokens are not allowed in the implicit grant. Use prompt=none instead.
    @@ -136,7 +136,7 @@ Location: https://app.example.com/# "nonce": "jxdlsjfi0fa" } @@ -173,13 +173,13 @@ Location: https://app.example.com/# "scope": "openid email" }
      -
    • The returned Access Token is a JWT valid for calling the /userinfo endpoint(provided that the API specified by the audience param uses RS256 as signing algorithm) as well as the resource server specified by the audience parameter.
    • +
    • The returned Access Token is a JWT valid for calling the /userinfo endpoint(provided that the API specified by the audience param uses RS256 as signing algorithm) as well as the resource server specified by the audience parameter.
    • Note that an opaque Access Token could still be returned if /userinfo is the only specified audience.
    -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/index.md b/articles/api-auth/tutorials/adoption/index.md index 14ec8e5f35..eb7827dc97 100644 --- a/articles/api-auth/tutorials/adoption/index.md +++ b/articles/api-auth/tutorials/adoption/index.md @@ -22,7 +22,7 @@ This guide details all the upcoming changes, **some of which will be breaking**, This guide is meant for developers and IT admins who manage Auth0 integrations in their applications. If you are not familiar with how OAuth works at a basic level, [we suggest reading our protocol overview](/protocols/oauth2). -If you are integrating Auth0 as a [SAML or WS-Federation **identity provider**](/saml-idp-generic) to your application (that is, not through OIDC/OAuth), then you do not need to make any changes. +If you are integrating Auth0 as a [SAML or WS-Federation **identity provider**](/saml-idp-generic) for your application (that is, not through OIDC/OAuth), then you do not need to make any changes. To make this guide accessible to everyone, any authentication flows will be described only through HTTP requests instead of in the context of any particular language or library's implementation. This is the similar to the descriptions and examples provided by the [official OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html). @@ -30,7 +30,7 @@ To make this guide accessible to everyone, any authentication flows will be desc All of the changes described in this guide apply to the **OIDC Conformant Authentication Pipeline**. This pipeline will be used if **any** of the following are true: -- An [authentication request](/api/authentication#social) was initiated with an `audience` parameter. +- An [authentication request](/api/authentication#social) was initiated with an `audience` parameter. - The application being used is flagged as **OIDC Conformant** (available at _Dashboard > Applications > Settings > Show advanced settings > OAuth > OIDC Conformant flag_). @@ -52,6 +52,6 @@ We understand that making changes to the core authentication logic of your appli All Auth0 documentation, SDKs, libraries and samples will eventually apply only to the OIDC-conformant pipeline. Because of this, we strongly recommend adoption even if you do not need to leverage any new features or functionality in the near future. -## Compare differences between the two pipelines +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/oidc-conformant.md b/articles/api-auth/tutorials/adoption/oidc-conformant.md index 6bc2720719..a8a601f4ad 100644 --- a/articles/api-auth/tutorials/adoption/oidc-conformant.md +++ b/articles/api-auth/tutorials/adoption/oidc-conformant.md @@ -1,5 +1,4 @@ --- -title: OIDC-conformant applications description: List of breaking changes for OIDC-conformant applications topics: - api-authentication @@ -10,7 +9,7 @@ useCase: - call-api --- -# OIDC-conformant applications +# OIDC-Conformant Applications <%= include('./_about.md') %> @@ -21,30 +20,31 @@ In order to make the transition to the [OIDC-conformant authentication pipeline] The objective of this flag is to disable as many legacy features as possible, so you can run into the OIDC-conformant pipeline's breaking changes at configuration time rather than run time. Enabling this flag on an application will have the following effects: -* The following features are deprecated in favor of [silent authentication](/api-auth/tutorials/adoption/implicit): - - Refresh Tokens on authentication with the [implicit grant](/api-auth/tutorials/adoption/implicit) +* The following features are deprecated: + - Refresh Tokens on authentication with the [implicit grant](/api-auth/tutorials/adoption/implicit) - /ssodata endpoint and `getSSOData()` method from Lock/auth0.js -* [Single sign-on (SSO)](/api-auth/tutorials/adoption/single-sign-on) can only be performed from Auth0 login pages. -* Using `response_type=token` will only return an Access Token, not an ID Token. Use `response_type=id_token` or `response_type=token id_token` instead. +* [Single Sign-on (SSO)](/api-auth/tutorials/adoption/single-sign-on) can only be performed from Auth0 login pages. +* Using `response_type=token` will only return an Access Token, not an ID Token. Use `response_type=id_token` or `response_type=token id_token` instead. * ID Tokens obtained with the implicit grant will be signed asymmetrically using RS256. * The /tokeninfo endpoint is disabled. * Responses from /userinfo will [conform to the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#UserInfoResponse), similar to the [contents of ID Tokens](/api-auth/tutorials/adoption/scope-custom-claims) -* Implicit grant authentication requests made without a [`nonce` parameter](/api-auth/tutorials/nonce) will be rejected. +* Implicit grant authentication requests made without a [`nonce` parameter](/api-auth/tutorials/nonce) will be rejected. * [Refresh Tokens must be used at the token endpoint]() instead of /delegation. * The `device` parameter, originally used to obtain Refresh Tokens, is now considered invalid. * The legacy [resource owner endpoint](/api/authentication#database-ad-ldap-active-) is disabled. - - Passwordless authentication for embedded login is implemented at this endpoint, so it will be disabled as well. + - Passwordless authentication for embedded login is implemented at this endpoint, so it will be disabled as well. * The [/oauth/access_token endpoint](/api/authentication#post-oauth-access_token), used for social authentication from native mobile applications, is disabled. An OIDC-conformant alternative will be added in future releases. * The [`scope` parameter of authentication requests](/api-auth/tutorials/adoption/scope-custom-claims) will comply to the OIDC specification: - - Custom claims must be namespaced and added to ID Tokens or Access Tokens via rules. - - Custom scope values can be defined by a [resource server (API)](/api-auth/tutorials/adoption/api-tokens). + - Custom claims must be [namespaced](/tokens/guides/create-namespaced-custom-claims) and added to ID Tokens or Access Tokens via rules. + - The namespace identifiers for custom claims must be **HTTP** or **HTTPS** URIs. + - Custom scope values can be defined by a [resource server (API)](/api-auth/tutorials/adoption/api-tokens). * OIDC-conformant applications cannot be the source or target application of a [delegation request](/api-auth/tutorials/adoption/delegation). ## I don't want to make all these changes at once! The "OIDC Conformant" flag will force all of these changes at the same time for a given application, but it's not the only option to gradually transition to the OIDC-conformant authentication pipeline. -Any authentication requests made with an `audience` parameter will use the new pipeline, and all other requests will continue to work as usual. +Any authentication requests made with an `audience` parameter will use the new pipeline, and all other requests will continue to work as usual. If your application doesn't need a resource server but you want opt-in to the new pipeline on a per-request basis, you can use the following `audience` parameter: @@ -52,6 +52,6 @@ If your application doesn't need a resource server but you want opt-in to the ne https://${account.namespace}/userinfo ``` -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/password.md b/articles/api-auth/tutorials/adoption/password.md index 472efdfc2e..15834e8bba 100644 --- a/articles/api-auth/tutorials/adoption/password.md +++ b/articles/api-auth/tutorials/adoption/password.md @@ -1,5 +1,5 @@ --- -title: OIDC-conformant Resource Owner Password Credentials exchange +description: Understand how the Resource Owner Password Grant (ROPG) is used by highly-trusted apps to provide active authentication. topics: - api-authentication - oidc @@ -9,7 +9,9 @@ useCase: - secure-api - call-api --- -# Resource Owner Password Credentials exchange +# Resource Owner Password Credentials Exchange + +<%= include('../../_includes/_ropg-warning.md') %> <%= include('./_about.md') %> @@ -40,21 +42,15 @@ Content-Type: application/json "device": "my-device-name" }
    POST /oauth/token HTTP 1.1
    -Content-Type: application/json
    -{
    -  "grant_type": "http://auth0.com/oauth/grant-type/password-realm",
    -  "client_id": "123",
    -  "username": "alice",
    -  "password": "A3ddj3w",
    -  "realm": "my-database-connection",
    -  "scope": "openid email offline_access",
    -  "audience": "https://api.example.com"
    -}
    +Content-Type: application/x-www-form-urlencoded + +grant_type=http%3A%2F%2Fauth0.com%2Foauth%2Fgrant-type%2Fpassword-realm&client_id=123&username=alice&password=A3ddj3w&realm=my-database-connection&scope=openid+email+offline_access&audience=https%3A%2F%2Fapi.example.com +
    • The endpoint to execute token exchanges is /oauth/token.
    • Auth0's own grant type is used to authenticate users from a specific connection (realm). The standard OIDC password grant is also supported, but it does not accept Auth0-specific parameters such as realm.
    • @@ -106,8 +102,8 @@ Pragma: no-cache "id_token": "eyJ..." }
        -
      • The returned Access Token is valid for calling the /userinfo endpoint (provided that the API specified by the audience param uses RS256 as signing algorithm) and optionally the resource server specified by the audience parameter.
      • -
      • The ID Token will be forcibly signed using RS256 if requested by a public application.
      • +
      • The returned Access Token is valid for calling the /userinfo endpoint (provided that the API specified by the audience param uses RS256 as signing algorithm) and optionally the resource server specified by the audience parameter.
      • +
      • The ID Token will be forcibly signed using RS256 if requested by a public application.
      • A Refresh Token will be returned only if the offline_access scope was granted.
    @@ -150,7 +146,7 @@ Pragma: no-cache }
    • The ID Token will be forcibly signed using RS256 if requested by a public application.
    • -
    • The favorite_color claim must be namespaced and added through a rule.
    • +
    • The favorite_color claim must be namespaced and added through a rule.
    @@ -186,7 +182,7 @@ Pragma: no-cache "scope": "openid email" }
      -
    • The returned Access Token is a JWT valid for calling the /userinfo endpoint (provided that the API specified by the audience param uses RS256 as signing algorithm) as well as the resource server specified by the audience parameter.
    • +
    • The returned Access Token is a JWT valid for calling the /userinfo endpoint (provided that the API specified by the audience param uses RS256 as signing algorithm) as well as the resource server specified by the audience parameter.
    • Note that an opaque Access Token could still be returned if /userinfo is the only specified audience.
    @@ -197,6 +193,6 @@ Pragma: no-cache The Auth0 password realm grant is not defined by standard OIDC, but it is suggested as an alternative to the legacy resource owner endpoint because it supports the Auth0-specific `realm` parameter. The [standard OIDC grant is also supported](/api-auth/tutorials/password-grant) when using OIDC authentication. -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/refresh-tokens.md b/articles/api-auth/tutorials/adoption/refresh-tokens.md index 7ba17eb8ba..fa8d7447b6 100644 --- a/articles/api-auth/tutorials/adoption/refresh-tokens.md +++ b/articles/api-auth/tutorials/adoption/refresh-tokens.md @@ -1,5 +1,5 @@ --- -title: OIDC-conformant Refresh Token use +description: Understand how refresh tokens are used in an OIDC-conformant authentication pipeline. topics: - api-authentication - oidc @@ -11,26 +11,25 @@ useCase: - call-api --- -# OIDC-conformant Refresh Tokens +# OIDC-Conformant Refresh Tokens <%= include('./_about.md') %> -There are some changes to how Refresh Tokens are used in the OIDC-conformant authentication pipeline: +There are some changes to how Refresh Tokens are used in the OIDC-conformant authentication pipeline: * Using the [implicit grant](/api-auth/tutorials/adoption/implicit) for authentication will no longer return Refresh Tokens. - Use [silent authentication](/api-auth/tutorials/silent-authentication) (such as `prompt=none`) instead. -* Refresh Tokens should only be used by [confidential applications](/applications/application-types#confidential-applications). However, they can also be used by Native (public) applications to obtain Refresh Tokens for mobile apps. -* The `/delegation` endpoint is considered deprecated. To obtain new tokens from a Refresh Token, the `/oauth/token` endpoint should be used instead: +* Refresh Tokens should only be used by [confidential applications](/applications/concepts/app-types-confidential-public#confidential-applications). However, they can also be used by Native (public) applications to obtain Refresh Tokens for mobile apps. +* The `/delegation` endpoint is deprecated. To obtain new tokens from a Refresh Token, the `/oauth/token` endpoint should be used instead:
    -
    +
    POST /delegation
     Content-Type: 'application/json'
     {
    @@ -41,17 +40,11 @@ Content-Type: 'application/json'
     }
     
    -
    +
    POST /oauth/token
    -Content-Type: application/json
    -{
    -  "grant_type": "refresh_token",
    -  "refresh_token": "...",
    -  "client_id": "...",
    -  "client_secret": "...",
    -  "scope": "openid profile",
    -  "audience": "https://api.example.com"
    -}
    +Content-Type: application/x-www-form-urlencoded
    +
    +grant_type=refresh_token&refresh_token=123&client_id=123&client_secret=123&scope=openid+profile&audience=https%3A%2F%2Fapi.example.com
     
    • The audience and client_secret parameters are optional. The client_secret is not needed when requesting a refresh_token for a mobile app.
    @@ -60,6 +53,6 @@ Content-Type: application/json Please note that Refresh Tokens must be kept confidential in transit and storage, and they should be shared only among the authorization server and the client to whom the Refresh Tokens were issued. -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/scope-custom-claims.md b/articles/api-auth/tutorials/adoption/scope-custom-claims.md index 560f64727f..10b72653ed 100644 --- a/articles/api-auth/tutorials/adoption/scope-custom-claims.md +++ b/articles/api-auth/tutorials/adoption/scope-custom-claims.md @@ -1,5 +1,5 @@ --- -title: User profile claims and scope +description: Apps can request any standard OIDC scopes such as profile and email as well as any scopes supported by the API they want to access. topics: - api-authentication - oidc @@ -12,13 +12,13 @@ useCase: - call-api --- -# User profile claims and scope +# User Profile Claims and the `scope` Parameter <%= include('./_about.md') %> -The behavior of the `scope` parameter has been changed to conform to the [OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims). +The behavior of the `scope` parameter has been changed to conform to the [OpenID Connect (OIDC) specification](https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims). -Instead of requesting arbitrary application-specific claims, applications can request any of the standard OIDC scopes such as `profile` and `email`, as well as any [scopes supported by the API they want to access](/api-auth/tutorials/adoption/api-tokens). +Instead of requesting arbitrary application-specific claims, applications can request any of the standard OIDC scopes such as `profile` and `email`, as well as any [scopes supported by the API they want to access](/api-auth/tutorials/adoption/api-tokens). ## Standard claims @@ -26,7 +26,7 @@ The OIDC specification defines a [set of standard claims](https://openid.net/spe ## Custom claims -To improve compatibility for applications, Auth0 now returns profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). You can still add custom claims, but they must conform to a namespaced format to avoid possible collisions with standard OIDC claims. Otherwise, it is no longer possible to add arbitrary claims to ID Tokens or Access Tokens. +To improve compatibility for applications, Auth0 now returns profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). You can still add custom claims, but they must conform to a namespaced format to avoid possible collisions with standard OIDC claims. Otherwise, it is no longer possible to add arbitrary claims to ID Tokens or Access Tokens. For example, suppose an identity provider returns a `favorite_color` claim as part of the user’s profile, and that we’ve used the Auth0 management API to set application-specific information for this user. @@ -44,7 +44,7 @@ This would be the profile stored by Auth0: } ``` -This is a [*normalized user profile*](/user-profile/normalized), which is a protocol-agnostic representation of this user as defined by Auth0. When performing an OIDC conformant login, Auth0 would return the following ID Token claims to the application: +This is a [*normalized user profile*](/users/normalized), which is a protocol-agnostic representation of this user as defined by Auth0. When performing an OIDC conformant login, Auth0 would return the following ID Token claims to the application: ```json { @@ -58,7 +58,7 @@ This is a [*normalized user profile*](/user-profile/normalized), which is a prot } ``` -Note that the `user_id` property is sent as `sub` in the ID Token, and that `favorite_color` and `user_metadata` are not present in the OIDC response from Auth0. This is because OIDC does not define standard claims to represent all the information in this user’s profile. We can, however, define a non-standard claim by namespacing it through a rule: +Note that the `user_id` property is sent as `sub` in the ID Token, and that `favorite_color` and `user_metadata` are not present in the OIDC response from Auth0. This is because OIDC does not define standard claims to represent all the information in this user’s profile. We can, however, define a non-standard claim by namespacing it through a [rule](/rules): ```js function (user, context, callback) { @@ -69,18 +69,33 @@ function (user, context, callback) { } ``` +::: note +If you need to add custom claims to the Access Token, you can use the code sample above with the following change: use `context.accessToken` in place of `context.idToken`. + +Please note that adding custom claims to tokens through this method will also let you obtain them when calling the `/userinfo` endpoint. However, rules run when the user is authenticating, not when `/userinfo` is called. +::: + Any non-Auth0 HTTP or HTTPS URL can be used as a namespace identifier, and any number of namespaces can be used. The namespace URL does not have to point to an actual resource, it’s only used as an identifier and will not be called by Auth0. ::: warning `auth0.com`, `webtask.io` and `webtask.run` are Auth0 domains and therefore cannot be used as a namespace identifier. ::: -This follows a [recommendation from the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#AdditionalClaims) stating that custom claim identifiers should be collision-resistant. While this is not mandatory according to the specification, Auth0 will always enforce namespacing when performing OIDC-conformant login flows, meaning that any non-namespaced claims will be silently excluded from tokens. +This follows a [recommendation from the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#AdditionalClaims) stating that custom claim identifiers should be collision-resistant. While this is not mandatory according to the specification, Auth0 will always enforce namespacing when performing OIDC-conformant login flows, meaning that any custom claims without HTTP/HTTPS namespaces will be silently excluded from tokens. + +::: note +Auth0 will allow non-OIDC claims without a namespace (the "legacy" user profile, from which we strongly recommend moving away) if: + +* You are using the non-OIDC conformant pipeline (i.e., you are not using the `audience` parameter in the `/authorize` or token request and the application does not have the [**OIDC-Conformant** toggle](https://auth0.com/docs/api-auth/tutorials/adoption/oidc-conformant) enabled). +* You have the **Legacy User Profile** toggle turned on in the [tenant Advanced Settings](https://manage.auth0.com/#/tenant/advanced), under the **Migrations** section. This setting is only enabled for old tenants, but newly created tenants can't see or enable the **Legacy User Profile**. + +We strongly recommend moving away from the Legacy User Profile. +::: -If you need to add custom claims to the Access Token, the same applies but using `context.accessToken` instead. +## Token refresh flow and custom claims -Please note that adding custom claims to ID Tokens through this method will also let you obtain them when calling the `/userinfo` endpoint. However, rules run when the user is authenticating, not when `/userinfo` is called. +When an application requests new tokens using a Refresh Token, the new tokens will not automatically inherit any custom claims previously added. But since rules run on a token refresh flow as well, the same claim customization code will be executed in these cases. This gives the flexibility of adding or changing claims in newly issued tokens without forcing applications to obtain a new refresh token. -## Further reading +## Keep reading <%= include('./_index.md') %> diff --git a/articles/api-auth/tutorials/adoption/single-sign-on.md b/articles/api-auth/tutorials/adoption/single-sign-on.md index 016b9c11ab..f421306e27 100644 --- a/articles/api-auth/tutorials/adoption/single-sign-on.md +++ b/articles/api-auth/tutorials/adoption/single-sign-on.md @@ -1,5 +1,5 @@ --- -title: OIDC Single sign-on +description: Understand how OIDC Single Sign-On occurs when a user logs into one app and is then signed into other apps automatically. topics: - api-authentication - oidc @@ -10,23 +10,21 @@ useCase: - call-api --- -# Single sign-on +# OIDC Single Sign-On <%= include('./_about.md') %> -Single sign-on (SSO) occurs when a user logs in to one application and is then signed in to other applications automatically. +Single Sign-on (SSO) occurs when a user logs into one application and is then signed into other applications automatically. In the context of the OIDC-conformant authentication pipeline, SSO must happen at the authorization server (i.e. Auth0) and not applications. -This means that for SSO to happen, you must employ [Universal Login](/hosted-pages/login) and redirect users to the login page. +This means that for SSO to happen, you must employ Universal Login and redirect users to the login page. -We are planning on providing support for SSO from applications in future releases. - -## How SSO works +## How it works At a general level, this is what happens when performing SSO: -1. If the user is not logged in locally, redirect them to Auth0 for authentication. This is done using the [authorization code](/api-auth/grant/authorization-code) or [implicit](/api-auth/grant/implicit) grants, depending on the type of application. +1. If the user is not logged in locally, redirect them to Auth0 for authentication. This is done using the [Authorization Code Flow](/flows/concepts/auth-code) or [Implicit Flow](/flows/concepts/implicit), depending on the type of application. 2. If the user was logged in through SSO, Auth0 will immediately authenticate them without needing to re-enter credentials. An application that does not use SSO might decide to use embedded login to authenticate users instead of redirecting to Auth0 for authentication. @@ -40,13 +38,13 @@ OIDC-conformant applications must use [silent authentication](/api-auth/tutorial ## Authentication flows without SSO -SSO sessions are managed by Auth0 setting a cookie on your Auth0 domain. +SSO [sessions](/sessions) are managed by Auth0 setting a cookie on your Auth0 domain. Since cross-origin requests cannot set cookies, this means that SSO sessions must be established by redirecting users to your Auth0 login page (`/authorize`). The following flows are redirect-based and are capable of SSO: -* [Authorization code grant](/api-auth/grant/authorization-code) -* [Implicit grant](/api-auth/grant/implicit) +* [Authorization Code Flow](/flows/concepts/auth-code) +* [Implicit Flow](/flows/concepts/implicit) The following flows are request-based and are currently not capable of SSO: @@ -58,4 +56,7 @@ When using Universal Login, the login page is by default hosted at an Auth0 doma This is only an aesthetic limitation and does not impact the security or functionality of SSO logins in any way. -You can read further about [customizing your domain](/custom-domains) if you require it, to help maintain a uniform experience for your users. +## Keep reading + +* [Custom Domains](/custom-domains) +* [OIDC Handbook](https://auth0.com/resources/ebooks/the-openid-connect-handbook) diff --git a/articles/api-auth/tutorials/authorization-code-grant-pkce.md b/articles/api-auth/tutorials/authorization-code-grant-pkce.md index 6910f17d1b..e93cd3913b 100644 --- a/articles/api-auth/tutorials/authorization-code-grant-pkce.md +++ b/articles/api-auth/tutorials/authorization-code-grant-pkce.md @@ -13,17 +13,15 @@ useCase: --- # Execute an Authorization Code Grant Flow with PKCE -<%= include('../../_includes/_pipeline2') %> - ::: note -This tutorial will help you implement the Authorization Code (PKCE) grant. If you are looking for some theory on the flow refer to [Calling APIs from Mobile App](/api-auth/grant/authorization-code-pkce). +This tutorial will help you implement the Authorization Code (PKCE) grant. If you are looking for some theory on the flow refer to [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce). ::: The __Authorization Code with PKCE__ is the OAuth 2.0 grant that [native apps](/quickstart/native) use in order to access an API. In this document we will work through the steps needed in order to implement this: create a code verifier and a code challenge, get the user's authorization, get a token and access the API using the token. Before beginning this tutorial, please: -* Check that your Application's [Grant Type property](/applications/application-grant-types) is set appropriately +* Check that your Application's [Grant Type property](/applications/concepts/application-grant-types) is set appropriately * [Register the API](/apis#how-to-configure-an-api-in-auth0) with Auth0 ## 1. Create a Code Verifier @@ -162,7 +160,7 @@ Where: * `audience`: The unique identifier of the API the native app wants to access. Use the **Identifier** value on the [Settings](${manage_url}/#/apis) tab for the API you created as part of the prerequisites for this tutorial. -* `scope`: The [scopes](/scopes) that you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must conform to a namespaced format, or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token (make sure that the __Allow Offline Access__ field is enabled in the [API Settings](${manage_url}/#/apis)). The custom scopes must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims). For more information on this, refer to the [Namespacing Custom Claims](#optional-customize-the-tokens) panel. +* `scope`: The scopes that you want to request authorization for. These must be separated by a space. You can request any of the [standard OpenID Connect (OIDC) scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token (make sure that the __Allow Offline Access__ field is enabled in the [API Settings](${manage_url}/#/apis)). * `response_type`: Denotes the kind of credential that Auth0 will return (code vs token). For this flow, the value must be `code`. @@ -188,18 +186,39 @@ For example: ## 4. Exchange the Authorization Code for an Access Token -Now that you have an Authorization Code, you must exchange it for an Access Token that can be used to call your API. Using the Authorization Code (`code`) from the previous step, you will need to `POST` to the [Token URL](/api/authentication#authorization-code-pkce-) sending also the `code_verifier`: +Now that you have an Authorization Code, you must exchange it for an Access Token that can be used to call your API. Using the Authorization Code (`code`) from the previous step, you will need to `POST` to the [Token URL](/api/authentication#authorization-code-pkce-) sending also the `code_verifier`: ```har { "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"code_verifier\": \"YOUR_GENERATED_CODE_VERIFIER\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"com.myclientapp://myclientapp.com/callback\", }" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "code_verifier", + "value": "YOUR_GENERATED_CODE_VERIFIER" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "${account.callback}" + } + ] } } ``` @@ -223,10 +242,10 @@ The response contains `access_token`, `refresh_token`, `id_token`, and `token_ty } ``` -Note that `refresh_token` will only be present in the response if you included the `offline_access` scope AND enabled __Allow Offline Access__ for your API in the Dashboard. For more information about Refresh Tokens and how to use them, see [our documentation](/tokens/refresh-token). +Note that `refresh_token` will only be present in the response if you included the `offline_access` scope AND enabled __Allow Offline Access__ for your API in the Dashboard. See [Refresh Tokens](/tokens/concepts/refresh-tokens) for more information. ::: warning -The Authorization Code flow with PKCE can only be used for Applications whose type is `Native` in the Dashboard. +The Authorization Code flow with PKCE can only be used for Applications whose type is `Native` or `Single Page Application` in the Dashboard. ::: ## 5. Call the API @@ -248,7 +267,7 @@ Once you have the Access Token, you can use it to make calls to the API, by pass Once your API receives a request with a Bearer Access Token, the first thing to do is to validate the token. This consists of a series of steps, and if any of these fails then the request _must_ be rejected. -For details on the validations that should be performed refer to [Verify Access Tokens](/api-auth/tutorials/verify-access-token). +For details on the validations that should be performed, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). ## Optional: Customize the Tokens @@ -264,10 +283,7 @@ This is a series of tutorials that describe a scenario for a fictitious company. ## Keep reading -::: next-steps -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) +- [Tokens](/tokens) - [Application Authentication for Mobile & Desktop Apps](/Application-auth/mobile-desktop) - [The OAuth 2.0 protocol](/protocols/oauth2) - [The OpenID Connect protocol](/protocols/oidc) -- [Tokens used by Auth0](/tokens) -::: diff --git a/articles/api-auth/tutorials/authorization-code-grant.md b/articles/api-auth/tutorials/authorization-code-grant.md index 252524ed03..5ecd2127c1 100644 --- a/articles/api-auth/tutorials/authorization-code-grant.md +++ b/articles/api-auth/tutorials/authorization-code-grant.md @@ -12,8 +12,6 @@ useCase: --- # Execute an Authorization Code Grant Flow -<%= include('../../_includes/_pipeline2') %> - ::: note This tutorial will help you implement the Authorization Code grant. If you are looking for some theory on the flow refer to [Calling APIs from Server-side Web Apps](/api-auth/grant/authorization-code). ::: @@ -22,7 +20,7 @@ The __Authorization Code__ is an OAuth 2.0 grant that [regular web apps](/quicks Before beginning this tutorial, please: -* Check that your Application's [Grant Type property](/applications/application-grant-types) is set appropriately +* Check that your Application's [Grant Type property](/applications/concepts/application-grant-types) is set appropriately * [Register the API](/apis#how-to-configure-an-api-in-auth0) with Auth0 ## 1. Get the User's Authorization @@ -43,13 +41,13 @@ Where: * `audience`: The unique identifier of the API the web app wants to access. Use the **Identifier** value on the [Settings](${manage_url}/#/apis) tab for the API you created as part of the prerequisites for this tutorial. -* `scope`: The [scopes](/scopes) which you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must conform to a namespaced format, or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token (make sure that the __Allow Offline Access__ field is enabled in the [API Settings](${manage_url}/#/apis)). The custom scopes must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims). For more information on this, refer to the [Namespacing Custom Claims](#optional-customize-the-tokens) panel. +* `scope`: The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OpenID Connect (OIDC) scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token (make sure that the __Allow Offline Access__ field is enabled in the [API Settings](${manage_url}/#/apis)). * `response_type`: Denotes the kind of credential that Auth0 will return (code vs token). For this flow, the value must be `code`. * `client_id`: Your application's Client ID. You can find this value at your [Application's Settings](${manage_url}/#/applications/${account.clientId}/settings). -* `state`: An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value must be used by the application to prevent CSRF attacks, [click here to learn more](/protocols/oauth-state). +* `state`: An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value must be used by the application to prevent CSRF attacks. For more information, see [State Parameter](/protocols/oauth-state). * `redirect_uri`: The URL to which Auth0 will redirect the browser after authorization has been granted by the user. The Authorization Code will be available in the `code` URL parameter. This URL must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications/${account.clientId}/settings). @@ -67,18 +65,39 @@ Note that if you alter the value in `scope`, Auth0 will require consent to be gi ## 2. Exchange the Authorization Code for an Access Token -Now that you have an Authorization Code, you must exchange it for an Access Token that can be used to call your API. Using the Authorization Code (`code`) from the previous step, you will need to `POST` to the [Token URL](/api/authentication?http#authorization-code): +Now that you have an Authorization Code, you must exchange it for an Access Token that can be used to call your API. Using the Authorization Code (`code`) from the previous step, you will need to `POST` to the [Token URL](/api/authentication?http#authorization-code): ```har { "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"client_secret\": \"YOUR_CLIENT_SECRET\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"${account.callback}\"}" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "${account.callback}" + } + ] } } ``` @@ -102,10 +121,10 @@ The response contains the `access_token`, `refresh_token`, `id_token`, and `toke } ``` -Note that `refresh_token` will only be present in the response if you included the `offline_access` scope AND enabled __Allow Offline Access__ for your API in the Dashboard. For more information about Refresh Tokens and how to use them, see [our documentation](/tokens/refresh-token). +Note that `refresh_token` will only be present in the response if you included the `offline_access` scope AND enabled __Allow Offline Access__ for your API in the Dashboard. See [Refresh Tokens](/tokens/concepts/refresh-tokens) for more information. ::: panel-warning Security Warning -It is important to understand that the Authorization Code flow should only be used in cases such as a Regular Web Application where the Client Secret can be safely stored. In cases such as a Single Page Application, the Client Secret is available to the application (in the web browser), so the integrity of the Client Secret cannot be maintained. That is why the [Implicit Grant flow](/api-auth/grant/implicit) is more appropriate in that case. +It is important to understand that the Authorization Code flow should only be used in cases such as a Regular Web Application where the Client Secret can be safely stored. In cases such as a Single-Page Application, the Client Secret is available to the application (in the web browser), so the integrity of the Client Secret cannot be maintained. That is why the [Authorization Code Flow with PKCE ](/flows/concepts/auth-code-pkce) is more appropriate in that case. ::: ## 3. Call the API @@ -127,7 +146,7 @@ Once the Access Token has been obtained it can be used to make calls to the API Once your API receives a request with a Bearer Access Token, the first thing to do is to validate the token. This consists of a series of steps, and if any of these fails then the request _must_ be rejected. -For details on the validations that should be performed refer to [Verify Access Tokens](/api-auth/tutorials/verify-access-token). +For details on the validations that should be performed, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). ## Optional: Customize the Tokens @@ -137,10 +156,7 @@ If you wish to execute special logic unique to the Authorization Code grant, you ## Keep Reading -::: next-steps -- [How to refresh a token](/tokens/refresh-token) +- [Refresh Tokens](/tokens/concepts/refresh-token) - [How to configure an API in Auth0](/apis) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) - [Application Authentication for Server-side Web Apps](/application-auth/server-side-web) -- [Tokens used by Auth0](/tokens) -::: +- [Tokens](/tokens) diff --git a/articles/api-auth/tutorials/client-credentials.md b/articles/api-auth/tutorials/client-credentials.md index a34b70d5d9..567e903447 100644 --- a/articles/api-auth/tutorials/client-credentials.md +++ b/articles/api-auth/tutorials/client-credentials.md @@ -1,6 +1,5 @@ --- -title: How to implement the Client Credentials Grant -description: How to call an API from a server process using OAuth 2.0 and the Client Credentials grant +description: Learn how to call an API from a server process using OAuth 2.0 and the Client Credentials grant. toc: true topics: - api-authentication @@ -11,15 +10,15 @@ useCase: - secure-api - call-api --- -# How to Implement the Client Credentials Grant +# Implement the Client Credentials Grant The **Client Credentials Grant** (defined in [RFC 6749, section 4.4](https://tools.ietf.org/html/rfc6749#section-4.4)) allows an application to request an Access Token using its __Client Id__ and __Client Secret__. It is used for non interactive applications (a CLI, a daemon, or a Service running on your backend) where the token is issued to the application itself, instead of an end user. Before beginning this tutorial, please: -* Make sure you that your application has the `Client Credentials` [grant type enabled](/applications/application-grant-types#how-to-edit-the-application-s-grant_types-property). Regular web applications and machine to machine applications have it enabled by default. +* Make sure you that your application has the `Client Credentials` [grant type enabled](/dashboard/guides/applications/update-grant-types). Regular web applications and machine to machine applications have it enabled by default. -* [Register the API](/apis#how-to-configure-an-api-in-auth0) with Auth0 with the required scopes. +* [Register the API](/apis#how-to-configure-an-api-in-auth0) with Auth0 with the required scopes. * Authorize the application to call the API by creating a Client Grant either [using the Dashboard](/api-auth/config/using-the-auth0-dashboard) or [using the Management API](/api-auth/config/using-the-management-api). @@ -32,11 +31,28 @@ To ask Auth0 for tokens for any of your authorized applications, perform a `POST "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"client_credentials\",\"client_id\": \"${account.clientId}\",\"client_secret\": \"YOUR_CLIENT_SECRET\",\"audience\": \"YOUR_API_IDENTIFIER\"}" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "client_credentials" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "audience", + "value": "YOUR_API_IDENTIFIER" + } + ] } } ``` @@ -48,7 +64,7 @@ Where: * `client_secret`: Your application's Client Secret. You can find this value at the [application's settings tab](${manage_url}/#/applications). * `audience`: The **Identifier** value on the [Settings](${manage_url}/#/apis) tab for the API you created as part of the prerequisites for this tutorial. -The response contains a [signed JSON Web Token](/jwt), the token's type (which is `Bearer`), and in how much time it expires in [Unix time](https://en.wikipedia.org/wiki/Unix_time) (86400 seconds, which means 24 hours). +The response contains a signed JSON Web Token (JWT), the token's type (which is `Bearer`), and in how much time it expires in [Unix time](https://en.wikipedia.org/wiki/Unix_time) (86400 seconds, which means 24 hours). ```json { @@ -73,9 +89,9 @@ If you [decode the `access_token`](https://jwt.io/#debugger-io) you will see tha ## Modify scopes and claims -You can change the scopes and add custom claims to the Access Token you got, using [Hooks](/hooks). +You can change the scopes and add custom claims to the Access Token you got, using [Hooks](/hooks). -Hooks allow you to customize the behavior of Auth0 using Node.js code. They are actually Webtasks, associated with specific extensibility points of the Auth0 platform (like the Client Credentials grant). Auth0 invokes the Hooks at runtime to execute your custom logic. +Hooks allow you to customize the behavior of Auth0 using Node.js code. They are secure, self-contained functions associated with specific extensibility points of the Auth0 platform (like the Client Credentials grant). Auth0 invokes the Hooks at runtime to execute your custom logic. For more information and details on how to do that refer to [Using Hooks with Client Credentials Grant](/api-auth/tutorials/client-credentials/customize-with-hooks). @@ -83,7 +99,7 @@ For more information and details on how to do that refer to [Using Hooks with Cl Once your API receives a request with a Bearer Access Token, the first thing to do is to validate the token. This consists of a series of steps, and if any of these fails then the request _must_ be rejected. -For details on the validations that should be performed by the API, refer to [Verify Access Tokens](/api-auth/tutorials/verify-access-token). You can find examples on how to do it in different platforms in the [Quickstarts for backend applications](/quickstart/backend). +For details on the validations that should be performed by the API, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). You can find examples on how to do it in different platforms in the [Quickstarts for backend applications](/quickstart/backend). ## Sample application @@ -93,9 +109,5 @@ This is a series of tutorials that describe a scenario for a fictitious company ## Keep reading -::: next-steps -- [Machine to Machine applications](/applications/machine-to-machine) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) -- [How to change the scopes and add custom claims to the tokens using Hooks](/api-auth/tutorials/client-credentials/customize-with-hooks) -- [Tokens used by Auth0](/tokens) -::: +- [Use Hooks with Client Credentials Grant](/api-auth/tutorials/client-credentials/customize-with-hooks) +- [Tokens](/tokens) diff --git a/articles/api-auth/tutorials/client-credentials/customize-with-hooks.md b/articles/api-auth/tutorials/client-credentials/customize-with-hooks.md index 2f2fed90a9..e8c5f642f2 100644 --- a/articles/api-auth/tutorials/client-credentials/customize-with-hooks.md +++ b/articles/api-auth/tutorials/client-credentials/customize-with-hooks.md @@ -14,32 +14,26 @@ useCase: - extensibility-hooks --- -# Using Hooks with Client Credentials Grant +# Use Hooks with Client Credentials Grant -<%= include('../../../_includes/_pipeline2') %> +You can now add [Hooks](/hooks) into your [client credentials](/api-auth/grant/client-credentials) flow. This way you can change the scopes and add custom claims to the tokens issued by Auth0. -You can now add [Hooks](/hooks) into your [client credentials](/api-auth/grant/client-credentials) flow. This way you can change the scopes and add custom claims to the tokens issued by Auth0. +Hooks allow you to customize the behavior of Auth0 using Node.js code. They are secure, self-contained functions associated with specific extensibility points of the Auth0 platform (like the Client Credentials grant). Auth0 invokes the Hooks at runtime to execute your custom logic. -## Overview - -Hooks allow you to customize the behavior of Auth0 using Node.js code. - -They are actually [Webtasks](https://webtask.io/), associated with specific extensibility points of the Auth0 platform (like the Client Credentials grant). Auth0 invokes the Hooks at runtime to execute your custom logic. - -You can manage Hooks using the [Auth0 Dashboard](/hooks/dashboard) or the [Auth0 Command Line Interface (CLI)](/hooks/cli). In this article we will see how you can do either. +You can manage Hooks using the Auth0 Dashboard or the Management API. ## Before you start -Please ensure that: +Create the following: -- You have created an [API defined with the appropriate scopes](${manage_url}/#/apis) -- You have created a [machine to machine application](/applications/machine-to-machine) that is authorized to use the API created in the previous step +- [API defined with the appropriate scopes](${manage_url}/#/apis) +- [Machine-to-machine application](/applications) authorized to use the API -If you haven't done these yet, refer to these docs for details: -- How to set up a Client Grant: +For details on how to set up the API and the machine-to-machine app, see: +- Set up a Client Grant: - [Using the Dashboard](/api-auth/config/using-the-auth0-dashboard) - [Using the Management API](/api-auth/config/using-the-management-api) -- [How to execute a Client Credentials Grant](/api-auth/config/asking-for-access-tokens) +- [Execute a Client Credentials Grant](/api-auth/config/asking-for-access-tokens) ## Use the Dashboard @@ -57,11 +51,11 @@ If you haven't done these yet, refer to these docs for details: You can create more than one hooks per extensibility point but __only one__ can be enabled. The enabled hook will then be executed for __all__ applications and APIs. ::: -3. Click the __Pencil and Paper__ icon to the right of the Hook to open the Webtask Editor. +3. Click the __Pencil and Paper__ icon to the right of the Hook to open the Hook Editor. ![Edit Client Credentials Hook](/media/articles/api-auth/hooks/edit-cc-hook.png) -4. Using the Webtask Editor, write your Node.js code. As an example, we will add an extra scope. The claim's name will be `https://foo.com/claim` and its value `bar`. Copy the sample code below and paste it in the Editor. +4. Using the Hook Editor, write your Node.js code. As an example, we will add an extra scope. The claim's name will be `https://foo.com/claim` and its value `bar`. Copy the sample code below and paste it in the Editor. ```js module.exports = function(client, scope, audience, context, cb) { @@ -78,61 +72,15 @@ You can create more than one hooks per extensibility point but __only one__ can - add an `extra` scope to the default scopes configured on your [API](${manage_url}/#/apis). ::: panel Custom claims namespaced format - In order to improve compatibility for applications, Auth0 now returns profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID Tokens or Access Tokens, they must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims) to avoid possible collisions with standard OIDC claims. For example, if you choose the namespace `https://foo.com/` and you want to add a custom claim named `claim`, you would name the claim `https://foo.com/claim`, instead of just `claim`. + In order to improve compatibility for applications, Auth0 now returns profile information in a [structured claim format as defined by the OpenID Connect (OIDC) specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID Tokens or Access Tokens, they must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims) to avoid possible collisions with standard OIDC claims. ::: - ![Webtask Editor](/media/articles/api-auth/hooks/cc-webtask-editor.png) + ![Hook Editor](/media/articles/api-auth/hooks/cc-webtask-editor.png) Click __Save__ (or hit Ctrl+S/Cmd+S) and close the Editor. 5. That's it! Now you only need to test your hook. You can find detailed instructions at the [Test your Hook](#test-your-hook) paragraph. -## Use the Auth0 CLI - -::: warning -Tenants created after **July 16, 2018** will not have access to the underlying Webtask Sandbox via the Webtask CLI. Please contact [Auth0](https://auth0.com/?contact=true) to request access. -::: - -1. Make sure you have installed the Webtask CLI. You can find detailed instructions in the [Dashboard's Webtask page](${manage_url}/#/account/webtasks). - -2. Create a file with your Node.js code. For our example, we will name the file `myrule.js` and copy the following code: - - ```js - module.exports = function(client, scope, audience, context, cb) { - var access_token = {}; - access_token['https://foo.com/claim'] = 'bar'; - access_token.scope = scope; - access_token.scope.push('extra'); - cb(null, access_token); - }; - ``` - -3. Create the Webtask. The command is the following: - - ```text - auth0 create -t credentials-exchange -n client-credentials-exchange-hook -p ${account.namespace}-default file.js - ``` - - Let's break this down: - - `auth0`: The binary to use. - - `create`: The sub-command for creating or updating a Hook. Run in your terminal `auth0 -h` to see the rest. - - `-t credentials-exchange`: The hook type. For this use case, set to `credentials-exchange`. - - `-n client-credentials-exchange-hook`: The webtask's name. Set this to your preference, we chose `client-credentials-exchange-hook`. - - `-p ${account.namespace}-default`: Your account's profile name. Get this value from _Step 2_ of the instructions on the [Dashboard's Webtask page](${manage_url}/#/account/webtasks). - - `file.js`: The name of the file you created in the previous step. - - Run the command. - -4. You will see a message that your hook was created, but in disabled state. To enable the hook, run the command: - - ```text - auth0 enable --profile ${account.namespace}-default client-credentials-exchange-hook - ``` - - Where `client-credentials-exchange-hook` is the name of the webtask, and `${account.namespace}-default` the name of your profile (the same as the one used in the previous step). - -5. That's it! Now you only need to test your hook. You can find detailed instructions at the [Test your Hook](#test-your-hook) paragraph. - ## Test your Hook To test the hook you just created you need to run a Client Credentials exchange, get the Access Token, decode it and review its contents. @@ -144,11 +92,28 @@ To get a token, make a `POST` request at the `https://${account.namespace}/oauth "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"client_credentials\",\"client_id\": \"${account.clientId}\",\"client_secret\": \"YOUR_CLIENT_SECRET\",\"audience\": \"YOUR_API_IDENTIFIER\"}" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "client_credentials" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "audience", + "value": "YOUR_API_IDENTIFIER" + } + ] } } ``` @@ -188,7 +153,7 @@ Look into the last two items of the __Payload__. Both have been set by our hook: ## Manage your Hooks -You can disable, enable, delete or edit hooks using either the Auth0 CLI or the [dashboard]((${manage_url}/#/hooks)). You can also review your logs using the Auth0 CLI. For details, refer to the articles below. +You can disable, enable, delete or edit hooks using either the Auth0 CLI or the [dashboard](${manage_url}/#/hooks). You can also review your logs using the Auth0 CLI. For details, refer to the articles below. Use the Dashboard to: - [Delete Hooks](/auth0-hooks/dashboard/create-delete) @@ -201,9 +166,9 @@ Use the Auth0 CLI to: - [Enable or disable Hooks](/auth0-hooks/cli/enable-disable) - [Review Logs](/auth0-hooks/cli/logs) -## Webtask Input Parameters +## Input Parameters -As you saw in our example, the webtask takes five input parameters. You can use these values for your custom logic. +The hook takes five input parameters. You can use these values for your custom logic. Let's see what each one contains. @@ -236,14 +201,12 @@ Let's see what each one contains. } ``` -- __cb__: The callback. In our example we returned the token (`cb(null, access_token)`). If you decide, however, not to issue a token, you can return `Error (cb(new Error('access denied')))`. +- __cb__: The callback. In our example we returned the token (`cb(null, access_token)`). If you decide, however, not to issue a token, you can return `Error (cb(new Error('access denied')))`. ## Keep reading -:::next-steps * [What are Hooks and how you can work with them](/hooks) * [Overview of the Client Credentials Grant](/api-auth/grant/client-credentials) * [How to set up a Client Grant using the Dashboard](/api-auth/config/using-the-auth0-dashboard) * [How to set up a Client Grant using the Management API](/api-auth/config/using-the-management-api) * [How to execute a Client Credentials Grant](/api-auth/config/asking-for-access-tokens) -::: diff --git a/articles/api-auth/tutorials/hybrid-flow.md b/articles/api-auth/tutorials/hybrid-flow.md new file mode 100644 index 0000000000..c00ef7443e --- /dev/null +++ b/articles/api-auth/tutorials/hybrid-flow.md @@ -0,0 +1,208 @@ +--- +description: Learn how to execute the Hybrid Flow so your app can use an ID token to access information about the user while obtaining an authorization code that can be exchanged for an Access Token. +toc: true +public: false +topics: + - api-authentication + - oidc + - hybrid +contentType: tutorial +useCase: + - secure-api + - call-api +--- +# Implement the Hybrid Flow + +The [Hybrid Flow](/api-auth/grant/hybrid) is an OpenID Connect (OIDC) grant that enables use cases where your application can immediately use an ID token to access information about the user while obtaining an authorization code that can be exchanged for an Access Token (therefore gaining access to protected resources for an extended period of time). + +In this article, we will show you how you can use the Hybrid Flow in Auth0. + +## Prerequisites + +Before you begin this tutorial, please: + +* Check that your Application's [Grant Type property](/applications/concepts/application-grant-types) is set appropriately +* [Register your API](/apis#how-to-configure-an-api-in-auth0) with Auth0 + +## 1. Get the User's Authorization + +The first step is to get the user's consent for authentication (and possibly authorization). You can initiate the flow by sending the user to the [authorization URL](/api/authentication#authorization-code-grant) + +```text +https://${account.namespace}/authorize? + audience=YOUR_API_AUDIENCE& + scope=YOUR_SCOPE& + response_type=YOUR_RESPONSE_TYPE& + client_id=${account.clientId}& + redirect_uri=${account.callback}& + state=YOUR_OPAQUE_VALUE + nonce=NONCE +``` + +Where: + +* `audience`: The unique identifier of the API the web app wants to access. Use the **Identifier** value on the [Settings](${manage_url}/#/apis) tab for the API you created as part of the prerequisites for this tutorial. + +* `scope`: The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token (make sure that the __Allow Offline Access__ field is enabled in the [API Settings](${manage_url}/#/apis)). + +* `response_type`: Denotes the kind of credential that Auth0 will return (code vs token). For this flow, the value must be `code id_token`, `code token`, or `code id_token token`. More specifically, `token` returns an Access Token, `id_token` returns an ID Token, and `code` returns the Authorization Code. + +* `client_id`: Your application's Client ID. You can find this value at your [Application's Settings](${manage_url}/#/applications/${account.clientId}/settings). + +* `state`: An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value must be used by the application to prevent CSRF attacks. For more information, see [State Parameter](/protocols/oauth-state). + +* `redirect_uri`: The URL to which Auth0 will redirect the browser after authorization has been granted by the user. The Authorization Code will be available in the `code` URL parameter. This URL must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications/${account.clientId}/settings). + + ::: warning + Per the [OAuth 2.0 Specification](https://tools.ietf.org/html/rfc6749#section-3.1.2), Auth0 removes everything after the hash and does *not* honor any fragments. + ::: + +* `nonce`: A string value which will be included in the response from Auth0, [used to prevent token replay attacks](/api-auth/tutorials/nonce). It is required for `response_type=id_token token`. + +For example: + +```html + + Sign In + +``` + +The purpose of this call is to obtain consent from the user to invoke the API (specified in `audience`) to do certain things (specified in `scope`) on behalf of the user. Auth0 will authenticate the user and obtain consent, unless consent has been previously given. + +Note that if you alter the value in `scope`, Auth0 will require consent to be given again. + +## 2. Parsing the Response + +If your call to the `/authorize` endpoint is successful, Auth0 redirects you to a URL similar to the following: + +```text +https://YOUR_REDIRECT_URI + /#access_token=ey...MhPw + &expires_in=7200 + &token_type=Bearer + &code=AUTHORIZATION_CODE + &id_token=ey...qk +``` + +The URL contains the following components: + +* The redirect URI you provided for this application +* The Authorization Code provided by Auth0 +* The ID Token +* The Access Token + +If you've returned an Access Token, you'll also receive `expires_in` and `token_type` values. + +More specifically, here's what you will get back (depending on the value provided in `response_type`): + +| Response Type | Components | +| - | - | +| code id_token | Authorization Code, ID Token | +| code token | Authorization Code, Access Token | +| code id_token token | Authorization Code, ID Token, Access Token | + +### Access Tokens + +There are two ways to get Access Tokens in the Hybrid Flow. + +First, all calls include the `code` value in the `response_type` parameter (e.g., `code id_token`, `code token`, or `code id_token token`). As such, you'll receive an Authorization Code from Auth0 that you can then exchange for an Access Token. + +Second, you can explicitly request an Access Token directly by setting the `response_type` parameter to `code token` or `code id_token token`. + +You can therefore receive two Access Tokens for a given transaction. However, it is important to keep the two separate -- we do not recommend that an Access Token obtained when `response_type=code token` or `code token` or `code id_token token` be used to call APIs. + +## 3. Exchange the Authorization Code for an Access Token + +You can exchange the Authorization Code for an Access Token that will allow you to call the API specified in your initial authorization call. + +Using the Authorization Code (`code`) from the first step, you will need to `POST` to the [Token URL](/api/authentication?http#authorization-code): + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/oauth/token", + "headers": [ + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } + ], + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "${account.callback}" + } + ] + } +} +``` + +Where: + +* `grant_type`: This must be `authorization_code`. +* `client_id`: Your application's Client ID. +* `client_secret`: Your application's Client Secret. +* `code`: The Authorization Code received from the initial `authorize` call. +* `redirect_uri`: The URL must match exactly the `redirect_uri` passed to `/authorize`. + +The response contains the `access_token`, `refresh_token`, `id_token`, and `token_type` values, for example: + +```js +{ + "access_token": "eyJz93a...k4laUWw", + "refresh_token": "GEbRxBN...edjnXbL", + "id_token": "eyJ0XAi...4faeEoQ", + "token_type": "Bearer" +} +``` + +Note that `refresh_token` will only be present in the response if you included the `offline_access` scope AND enabled __Allow Offline Access__ for your API in the Dashboard. See [Refresh Tokens](/tokens/concepts/refresh-tokens) for more information. + +::: panel-warning Security Warning +It is important to understand that the Authorization Code flow should only be used in cases such as a Regular Web Application where the Client Secret can be safely stored. In cases such as a Single-Page Application, the Client Secret is available to the application (in the web browser), so the integrity of the Client Secret cannot be maintained. That is why the [Implicit Flow](/flows/concepts/implicit) is more appropriate in that case. +::: + +## 4. Call the API + +Once the Access Token has been obtained it can be used to make calls to the API by passing it as a Bearer Token in the `Authorization` header of the HTTP request: + +```har +{ + "method": "GET", + "url": "https://someapi.com/api", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer ACCESS_TOKEN" } + ] +} +``` + +## 5. Verify the Token + +Once your API receives a request with a Bearer Access Token, the first thing to do is to validate the token. This consists of a series of steps, and if any of these fails then the request _must_ be rejected. + +For details on the validations that should be performed, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). + +## Keep reading + +- [Tokens](/tokens) +- [Refresh Tokens](/tokens/concepts/refresh-token) +- [Configure an API in Auth0](/apis) +- [Authorization Code Flow](/flows/concepts/auth-code) +- [Implicit Flow](/flows/concepts/implicit) + diff --git a/articles/api-auth/tutorials/implicit-grant.md b/articles/api-auth/tutorials/implicit-grant.md index 0352d5b02e..07c8ccc2c5 100644 --- a/articles/api-auth/tutorials/implicit-grant.md +++ b/articles/api-auth/tutorials/implicit-grant.md @@ -1,6 +1,5 @@ --- -title: How to implement the Implicit Grant -description: How to execute an Implicit Grant flow from a SPA Client application. +description: Learn how to execute an Implicit Grant flow from a SPA Client application. toc: true topics: - api-authentication @@ -11,9 +10,7 @@ useCase: - secure-api - call-api --- -# How to implement the Implicit Grant - -<%= include('../../_includes/_pipeline2') %> +# Implement the Implicit Grant ::: note This tutorial will help you implement the Implicit Grant. If you are looking for some theory on the flow refer to [Call APIs from Client-side Web Apps](/api-auth/grant/implicit). @@ -23,7 +20,7 @@ The __Implicit Grant__ is an OAuth 2.0 flow that [client-side apps](/quickstart/ Before you begin this tutorial, do the following: -* Check that your Application's [Grant Type property](/applications/application-grant-types) is set appropriately +* Check that your Application's [Grant Type property](/applications/concepts/application-grant-types) is set appropriately * [Register your API](/apis#how-to-configure-an-api-in-auth0) with Auth0 ## 1. Get the User's Authorization @@ -47,7 +44,7 @@ Where: * `audience`: The unique identifier of the API the app wants to access. Use the **Identifier** value on the [Settings](${manage_url}/#/apis) tab for the API you created as part of the prerequisites for this tutorial. -* `scope`: The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must conform to a namespaced format (see panel below for more info), or any scopes supported by the target API (for example, `read:contacts`). Note that user's consent will be requested, every time the `scope` value changes. The custom scopes must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims). For more information on this, refer to the [Namespacing Custom Claims](#optional-customize-the-tokens) panel. +* `scope`: The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OpenID Connect (OIDC) scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Note that user's consent will be requested, every time the `scope` value changes. * `response_type`: Indicates the type of credentials returned in the response. For this flow you can either use `token` to get only an Access Token, `id_token` to get only an ID Token (if you don't plan on accessing an API), or `id_token token` to get both an ID Token and an Access Token. @@ -59,7 +56,7 @@ Where: Per the [OAuth 2.0 Specification](https://tools.ietf.org/html/rfc6749#section-3.1.2), Auth0 removes everything after the hash and does *not* honor any fragments. ::: -* `state`: An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value must be used by the application to [prevent CSRF attacks](/protocols/oauth-state). +* `state`: An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value must be used by the application to prevent CSRF attacks. For more information, see [State Parameter](/protocols/oauth-state). * `nonce`: A string value which will be included in the response from Auth0, [used to prevent token replay attacks](/api-auth/tutorials/nonce). It is required for `response_type=id_token token`. @@ -74,10 +71,10 @@ For example: ## 2. Extract the Access Token After Auth0 has redirected back to the app, the hash fragment of the URL contains the following parameters: -- `id_token`: contains an [ID Token](/tokens/id-token) and is present if the request parameter `response_type` included the value `id_token`, or the `scope` request parameter the value `openid` -- `access_token`: contains an [Access Token](/tokens/access-token) and is present if the request parameter `response_type` included the value `token` -- `token_type`: denotes the type of the [Access Token](/tokens/access-token) -- `expires_in`: the lifetime in seconds of the Access Token. For example, the value `3600` denotes that the [Access Token](/tokens/access-token) will expire in one hour from the time the response was generated +- `id_token`: contains an [ID Token](/tokens/concepts/id-tokens) and is present if the request parameter `response_type` included the value `id_token`, or the `scope` request parameter the value `openid` +- `access_token`: contains an [Access Token](/tokens/concepts/access-tokens) and is present if the request parameter `response_type` included the value `token` +- `token_type`: denotes the type of the [Access Token](/tokens/concepts/access-tokens) +- `expires_in`: the lifetime in seconds of the Access Token. For example, the value `3600` denotes that the [Access Token](/tokens/concepts/access-tokens) will expire in one hour from the time the response was generated - `state`: present in the response if the `state` parameter was present in the request. Holds the exact value received from the client in the request. You can extract the `access_token`, and other parameters, from the hash fragment of the URL: @@ -129,7 +126,7 @@ $('#get-appointments').click(function(e) { Once your API receives a request with a Bearer `access_token`, the first thing to do is to validate the token. This consists of a series of steps, and if any of these fails then the request _must_ be rejected. -For details on the validations that should be performed by the API, refer to [Verify Access Tokens](/api-auth/tutorials/verify-access-token). +For details on the validations that should be performed by the API, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). ## Optional: Customize the Tokens @@ -139,7 +136,7 @@ If you wish to execute special logic unique to the Implicit grant, you can look ## Optional: Silent Authentication -If you need to authenticate your users without a login page (for example, when the user is already logged in via [SSO](/sso) scenario) or get a new `access_token` (thus simulate refreshing an expired token), you can use Silent Authentication. +If you need to authenticate your users without a login page (for example, when the user is already logged in via [Single Sign-on (SSO)](/sso) scenario) or get a new `access_token` (thus simulate refreshing an expired token), you can use Silent Authentication. For details on how to implement this, refer to [Silent Authentication](/api-auth/tutorials/silent-authentication). @@ -147,14 +144,11 @@ For details on how to implement this, refer to [Silent Authentication](/api-auth For an example implementation see the [SPA + API](/architecture-scenarios/application/spa-api) architecture scenario. -This is a series of tutorials that describe a scenario for a fictitious company. The company wants to implement a single page web app that the employees can use to send their timesheets to the company's Timesheets API using OAuth 2.0. The tutorials are accompanied by a sample that you can access in [GitHub](https://github.com/auth0-samples/auth0-pnp-exampleco-timesheets). +This is a series of tutorials that describe a scenario for a fictitious company. The company wants to implement a single-page web app that the employees can use to send their timesheets to the company's Timesheets API using OAuth 2.0. The tutorials are accompanied by a sample that you can access in [GitHub](https://github.com/auth0-samples/auth0-pnp-exampleco-timesheets). ## Keep reading -::: next-steps - [How to protect your SPA against replay attacks](/api-auth/tutorials/nonce) - [How to configure an API in Auth0](/apis) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) - [Application Authentication for Client-side Web Apps](/application-auth/client-side-web) -- [Tokens used by Auth0](/tokens) -::: +- [Tokens](/tokens) diff --git a/articles/api-auth/tutorials/multifactor-resource-owner-password.md b/articles/api-auth/tutorials/multifactor-resource-owner-password.md deleted file mode 100644 index b8f39095cd..0000000000 --- a/articles/api-auth/tutorials/multifactor-resource-owner-password.md +++ /dev/null @@ -1,350 +0,0 @@ ---- -title: Multi-factor Authentication and Resource Owner Password -description: How to use Multi-factor Authentication with Resource Owner Password Grant. -toc: true -topics: - - api-authentication - - oidc - - mfa - - resource-owner-password -contentType: tutorial -useCase: - - secure-api - - call-api ---- -# Multi-factor Authentication and the Resource Owner Password Grant - -<%= include('../../_includes/_pipeline2') %> - -Highly-trusted applications can use the [Resource Owner Password Grant](/api-auth/grant/password) to access an API. The flow typically involves prompting the user for username and password as credentials to be submitted to Auth0. In some scenarios, however, stronger authentication may be required. This document outlines using [multi-factor authentication](/multifactor-authentication) with the [Resource Owner Password Grant](/api-auth/grant/password). - -## Prerequisites - -Before you continue, make sure that you've met the following prerequisites: - -1. MFA is enabled on the [Auth0 dashboard](${manage_url}). Currently, the supported providers for this flow are [Google Authenticator](/multifactor-authentication/google-auth/admin-guide#enabling-google-authenticator-for-mfa) and [Guardian](/multifactor-authentication/administrator#guardian-basics). [Duo Security](/multifactor-authentication/duo) is __not__ supported. - -1. An Application is configured to execute the Resource Owner Password Grant (either [password](/api-auth/tutorials/password-grant) or [password-realm](/api-auth/tutorials/password-grant#realm-support) grant types). For details on how to implement this, refer to [Execute the Resource Owner Password Grant](/api-auth/tutorials/password-grant). - -1. End users are enrolled in MFA. - -## Initiate Multi-factor Authentication - -The flow starts by collecting end-user credentials and sending them to Auth0, as described in [Resource Owner Password Grant](/api-auth/grant/password). Both [password](/api-auth/tutorials/password-grant) and [password-realm](/api-auth/tutorials/password-grant#realm-support) flows are available. - -1. The user enters their credentials into the Application. - -2. The Application forwards the credentials to Auth0. - -3. Auth0 validates the credentials and executes any applicable [rules](/rules). - -4. If any rule triggers MFA for the current user, an error code of `mfa_required` is returned. The error will additionally contain an `mfa_token` property. - - ```json - HTTP/1.1 403 Forbidden - Content-Type: application/json - { - "error": "mfa_required", - "error_description": "Multi-factor authentication required", - "mfa_token": "eyJ0eXAiOiJKV1QiLCJhbGci....D3QCiQ" - } - ``` - -5. The Application will then make a request to the [MFA challenge](/api/authentication#resource-owner-password-and-mfa) endpoint, specifying the challenge types it supports. Valid challenge types are: [OTP](#challenge-type-otp), [OOB with binding method `prompt`](#challenge-type-oob-and-binding-method-prompt), and [OOB with no binding method](#challenge-type-oob-with-no-binding-method). If you already know that `otp` is supported by the end-user and you don't want to request a different factor, you can skip this and the next steps an go directly to [Challenge Type `OTP`](#challenge-type-otp) below. - -6. Auth0 sends a response containing the `challenge_type` derived from the types supported by the Application and the specific user. Additionally, extra information, such as `binding_method` may be included to assist in resolving the challenge and displaying the correct UI to the user. - -The supported challenge types are: - -- `otp`: A one-time password generated by an app setup with a seed or by token generation hardware. This mechanism does not require an extra channel to prove possession; you can get it directly from the app / hardware device. - -- `oob`: The proof of possession is done 'out of band' via a side channel. There are several different channels, including push notification-based authenticators and SMS-based authenticators. Depending on the channel and the authenticator chosen at enrollment, you may need to provide a `binding_code` used to bind the side channel and the channel used for authentication. - -To execute MFA, follow the next steps according to the challenge type you will use: - -- [OTP](#challenge-type-otp): for this challenge type, your application must prompt the end-user for an OTP code and continue the flow using the __mfa-otp__ grant type. - -- [OOB and binding method `prompt`](#challenge-type-oob-and-binding-method-prompt): the challenge will be sent through a side channel (such as SMS), and your application will need to prompt the user for the `binding_code` that was included as part of the challenge sent, as well as the `oob_code` received as response to this request to prove possession. - -- [OOB with no binding method](#challenge-type-oob-with-no-binding-method): in this case, the proof of possession will be driven entirely in a side channel (such as a push notification-based authenticator). The response will include an `oob_code` that the Application will use to periodically check for the resolution of the transaction. Continue the flow using the __mfa-oob__ grant type. - -## Execute Multi-factor Authentication - -The following sections cover how to execute MFA based on the challenge type used. - -### Challenge Type: `OTP` - -![Resource Owner MFA OTP](/media/articles/api-auth/challenge-type-otp.png) - -For this type of challenge, the Application must get an one-time password (`otp`) code from a OTP Generator app, such as Google Authenticator or Microsoft Authenticator. - -::: note -If you already know that the user supports OTP, then steps 5 and 6 above of the [Initiate Multi-factor Authentication](#initiate-multifactor-authentication) section are optional. -::: - -7. The Application prompts the end user to enter an OTP code. - -8. The end user enters their OTP into the Application. - -9. The Application forwards the OTP code to Auth0 using [grant_type=http://auth0.com/oauth/grant-type/mfa-otp](/api/authentication#resource-owner-password) and includes the `mfa_token` obtained in step 4 above. - -10. Auth0 validates the provided OTP and returns the Access Token and the Refresh Token. - -11. The Application can use the Access Token to call the API on behalf of the end user. - -### Challenge Type: `OOB` with Binding Method `prompt` - -![Resource Owner MFA OOB Prompt](/media/articles/api-auth/challenge-type-oob-with-binding-method.png) - -This challenge type, together with `prompt` binding method, indicates that the challenge will be delivered to the user using a side channel (such as SMS) and that a `binding_code` is needed to bind the side channel to the one being authenticated. The binding code is sent as part of the challenge message and it is usually an OTP-like code composed of 6 numeric digits. - -7. The Application prompts the user for the `binding_code` and stores the `oob_code` from step 6 for future use. - -8. The end user receives the challenge on the side channel and enters the `binding_code` into the Application. - -9. The Application forwards the `binding_code` to Auth0 using [grant_type=http://auth0.com/oauth/grant-type/mfa-oob](/api/authentication#resource-owner-password) and includes the `mfa_token` (from step 4) and `oob_code` (from step 6). - -10. Auth0 validates the `binding_code` and `oob_code` and returns the Access Token and the Refresh Token. - -11. The Application can use the Access Token to call the API on behalf of the end user. - -### Challenge Type: `OOB` with No Binding Method - -![Resource Owner MFA OOB](/media/articles/api-auth/challenge-type-oob-no-binding-method.png) - -In this scenario, the challenge will be sent using a side channel, however, there is no need for a `binding_code`. Currently, the only mechanism supported for this scenario is Push Notification with the Guardian Provider. - -7. The Application asks the user to accept the delivered challenge and keeps the `oob_code` from step 6 for future use. - -8. The Application polls Auth0 using [grant_type=http://auth0.com/oauth/grant-type/mfa-oob](/docs/api/authentication#resource-owner-password) and includes the `mfa_token` (from step 4) and `oob_code` (from step 6). - -9. Auth0 validates the provided `oob_code`, the `mfa_token` and returns: - - `authorization_pending` error: if the challenge has not been accepted nor rejected. - - `slow_down` error: if the polling is too frequent. - - an `access_token` and a `refresh_token`: if the challenge has been accepted; polling should be stopped at this point. - - `invalid_grant` error: if the challenge has been rejected; polling should be stopped at this point. - -10. The Application can use the Access Token to call the API on behalf of the end user. - -## Using Recovery Codes - -::: note -This flow is currently only available for the Guardian Provider. -::: - -![Resource Owner MFA Recovery](/media/articles/api-auth/recovery-code.png) - -Some providers support using a recovery code to login in case the enrolled device is not available, or if lack of connectivity prevents receiving an OTP code or push notification. - -Using a recovery code is similar to using an OTP code to login. The main difference is that a new recovery code will be generated, and that the application must display this new recovery code to the user for secure storage. - -Steps 1-4 are the same as above. - -5. End user chooses to use the recovery code. - -6. The Application prompts the end user to enter recovery code. - -7. The end user enters their recovery code into the Application. - -8. The Application forwards the recovery code to Auth0 using [grant_type=http://auth0.com/oauth/grant-type/mfa-otp](/api/authentication#resource-owner-password) and includes the `mfa_token` from step 4. - -9. Auth0 validates the recovery code and returns the Access Token and the Refresh Token. - -10. The Application can use the Access Token to call the API on behalf of the end user. - -## Samples - -The following are sample implementations involving MFA. - -### Resource Owner Password Grant Request - -```javascript -var request = require("request"); - -var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { grant_type: 'password', - username: 'USERNAME', - password: 'PASSWORD', - audience: 'API_IDENTIFIER', - scope: 'SCOPE', - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - if (body.error === 'mfa_required') { - // Show mfa flow and give user option to go to the recovery flow (if supported) - - if (/* MFA Recovery is requested*/) { - const recovery_code = // Prompt for recovery code - mfaRecovery(body.mfa_token, recovery_code) // See MFA Recovery grant - } else { - mfaChallenge(body.mfa_token) - } - } -}); -``` - -### Challenge Request - -```javascript -function mfaChallenge(mfa_token) { - var options = { method: 'POST', - url: 'https://${account.namespace}/mfa/challenge', - headers: { 'content-type': 'application/json' }, - body: - { mfa_token: mfa_token, - challenge_type: 'oob otp', // Supported challenge types, space separated - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; - - request(options, function (error, response, body) { - if (error) throw new Error(error); - - if (body.challenge_type === 'otp') { - const otp = // Prompt for otp code (see MFA OTP grant request) - mfaOTP(mfa_token, otp) - } else if (body.challenge_type === 'oob') { - if (body.binding_method === 'prompt') { - const binding_code = // Prompt for binding code (see MFA OOB with binding code grant request) - mfaOOB(mfa_token, body.oob_code, binding_code) - } else if (!body.binding_method) { - // Ask the user to accept the challenge and start polling (see MFA OOB without binding code grant request) - mfaOOB(mfa_token, body.oob_code) - } else { - console.error('Unsupported binding_method'); - } - } else { - console.error('Something went wrong'); - } - }); -} -``` - -### MFA OTP Grant Request - -```javascript -function mfaOTP(mfa_token, otp) { - var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { mfa_token: mfa_token, - otp: otp, - grant_type: 'http://auth0.com/oauth/grant-type/mfa-otp', - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; - - request(options, function (error, response, body) { - if (error) throw new Error(error); - - if (response.statusCode === 200) { - // The tokens returned depend on the scopes requested on the password grant request - console.log(body.access_token, body.id_token, body.refresh_token); - } else if (body.error === 'invalid_grant') { - // Invalid otp code - console.error('Invalid otp'); - } else { - console.error('Something went wrong'); - } - }); -} -``` - -### MFA OOB Grant Request - -```javascript -function mfaOOB(mfa_token, oob_code, /* optional */ binding_code) { - makeOOBGrantRequest(mfa_token, oob_code, binding_code, function(error, result) { - if (error) { throw error; } - - if (result.state === 'authorization_pending') { - // Poll every 10 seconds - setTimeout(() => makeOOBGrantRequest(mfa_token, oob_code, binding_code), 10000); - } else if (result.state === 'authorized') { - console.log(result.body.access_token, result.body.id_token, result.body.refresh_token); - } else { - console.error('You are not authorized') - } - }); -} - -function makeOOBGrantRequest(mfa_token, oob_code, /* optional */ binding_code, cb) { - var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { mfa_token: mfa_token, - oob_code: oob_code, - binding_code: binding_code, // Only when binding_method = prompt - grant_type: 'http://auth0.com/oauth/grant-type/mfa-oob', - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; - - request(options, function (error, response, body) { - if (error) { return cb(error); } - - if (response.statusCode === 200) { - // The tokens returned depend on the scopes requested on the password grant request - cb(null, { state: 'authorized', body }); - } else if (body.error === 'invalid_grant') { - // Invalid otp code - cb(null, { state: 'not_authorized' }); - } else if (body.error === 'authorization_pending') { - cb(null, { state: 'authorization_pending' }); - } else if (body.error === 'slow_down') { - // You are polling too fast, slow down the polling rate, - // You may want to check rate-limiting headers to manage your polling rate - setTimeout(() => cb({ state: 'authorization_pending' }), 20000); - } else { - cb(new Error('Something went wrong')) - } - }); -} -``` - -### MFA Recovery Grant Request - -```javascript -function mfaRecovery(mfa_token, recovery_code) { - var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { mfa_token: mfa_token, - recovery_code: recovery_code, - otp: otp, - grant_type: 'http://auth0.com/oauth/grant-type/mfa-recovery-code', - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; - - request(options, function (error, response, body) { - if (error) throw new Error(error); - - if (response.statusCode === 200) { - console.log('Please store this new recovery code safely -- the previous code will no longer work.', body.recovery_code) - - // The tokens returned depend on the scopes requested on the password grant request - console.log(body.access_token, body.id_token, body.refresh_token); - } else if (body.error === 'invalid_grant') { - // Invalid otp code - console.error('Invalid recovery_code'); - } else { - console.error('Something went wrong'); - } - }); -} -``` - -## MFA API - -Please see the [MFA API section](/multifactor-authentication/api) for detailed information on Auth0's MFA API endpoints. diff --git a/articles/api-auth/tutorials/nonce.md b/articles/api-auth/tutorials/nonce.md index fbb8e4fd00..c83e542ae8 100644 --- a/articles/api-auth/tutorials/nonce.md +++ b/articles/api-auth/tutorials/nonce.md @@ -1,5 +1,5 @@ --- -description: How to securely generate and validate a cryptographic nonce for use with the Implicit Grant +description: How to securely generate and validate a cryptographic nonce for use with the Implicit Grant. topics: - api-authentication - oidc @@ -11,30 +11,42 @@ useCase: - call-api --- -# Mitigate replay attacks when using the Implicit Grant +# Mitigate Replay Attacks When Using the Implicit Flow -<%= include('../../_includes/_pipeline2') %> - -To mitigate replay attacks when using the [Implicit Grant](/api-auth/grant/implicit), a [cryptographic nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce) must be sent on authentication requests [as required by the OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthRequest). +To mitigate replay attacks when using the [Implicit Flow](/flows/concepts/implicit), a nonce must be sent on authentication requests [as required by the OpenID Connect (OIDC) specification](https://openid.net/specs/openid-connect-core-1_0.html#ImplicitAuthRequest). The nonce is generated by the application, sent as a `nonce` query string parameter in the authentication request, and included in the ID Token response from Auth0. This allows applications to correlate the ID Token response from Auth0 with the initial authentication request. -For more information on where to include the nonce, see [How to Implement the Implicit Grant](/api-auth/tutorials/implicit-grant). +For more information on where to include the nonce, see [Call API Using the Implicit Flow](/flows/guides/implicit/call-api-implicit). + +::: note +[Auth0.js](/libraries/auth0js) manages `state` and `nonce` parameters for you when using cross-origin authentication. +::: ## Generate a cryptographically random nonce -[Modern browsers](http://caniuse.com/#feat=cryptography) can use the [Web Crypto API](https://www.w3.org/TR/WebCryptoAPI/) to generate cryptographically secure random strings for use as nonces. +One way to generate a cryptographically random nonce is to use a tool like [Nano ID](https://github.com/ai/nanoid) or similar. This does require you to bundle the tool with your JavaScript code, however. If that's not possible, you can take advantage of the fact that [modern browsers](http://caniuse.com/#feat=cryptography) can use the [Web Crypto API](https://www.w3.org/TR/WebCryptoAPI/) to generate cryptographically secure random strings for use as nonces. ```js function randomString(length) { - var bytes = new Uint8Array(length); - var random = window.crypto.getRandomValues(bytes); - var result = []; - var charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~' - random.forEach(function (c) { - result.push(charset[c % charset.length]); - }); - return result.join(''); + var charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._' + result = '' + + while (length > 0) { + var bytes = new Uint8Array(16); + var random = window.crypto.getRandomValues(bytes); + + random.forEach(function(c) { + if (length == 0) { + return; + } + if (c < charset.length) { + result += charset[c]; + length--; + } + }); + } + return result; } ``` diff --git a/articles/api-auth/tutorials/password-grant.md b/articles/api-auth/tutorials/password-grant.md index a9b8e495a3..f8ef39ba44 100644 --- a/articles/api-auth/tutorials/password-grant.md +++ b/articles/api-auth/tutorials/password-grant.md @@ -1,6 +1,5 @@ --- -title: How to implement the Resource Owner Password Grant -description: Step-by-step guide on how to implement the OAuth 2.0 Resource Owner Password Grant +description: Learn how to implement the OAuth 2.0 Resource Owner Password Grant toc: true topics: - api-authentication @@ -11,21 +10,22 @@ useCase: - secure-api - call-api --- -# How to implement the Resource Owner Password Grant +# Implement the Resource Owner Password Grant -<%= include('../../_includes/_pipeline2') %> +<%= include('../_includes/_ropg-warning') %> -In this tutorial we will go through the steps required to implement the Resource Owner Password Grant. - -You should use this flow **only if** the following apply: -- The application is absolutely trusted with the user's credentials. For [client side](/api-auth/grant/implicit) applications and [mobile apps](/api-auth/grant/authorization-code-pkce) we recommend using web flows instead. -- Using a redirect-based flow is not possible. If this is not the case and redirects are possible in your application you should use the [Authorization Code Grant](/api-auth/grant/authorization-code) instead. +In this tutorial, we will go through the steps required to implement the Resource Owner Password Grant flow. ## Before you start -* Check that your application's [grant type property](/applications/application-grant-types) is set appropriately -* [Register the API](/apis#how-to-configure-an-api-in-auth0) with Auth0 -* Check that the [Default Audience and/or Default Directory](/dashboard/dashboard-tenant-settings#api-authorization-settings) has been set appropriately +* Check that your application's grant type is set to "Password". To set an application's grant type: + 1. Go to the [Dashboard](${manage_url}) and select **Applications** + 2. Choose your application from the list + 3. On the **Settings** page scroll down to **Advanced Settings** + 4. Select the **Grant Types** tab + 5. Enable the "Password" grant +* [Register the API](/apis#how-to-configure-an-api-in-auth0) with Auth0. +* Update or disable any [rules](/rules) so they only impact specific connections. If you get an `'access_denied'` error when testing the Password Grant, this could be due to an access control rule. ## Configure your tenant @@ -46,11 +46,40 @@ In order to execute the flow the application needs to acquire the Resource Owner "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"password\",\"username\": \"user@example.com\",\"password\": \"pwd\",\"audience\": \"https://someapi.com/api\", \"scope\": \"read:sample\", \"client_id\": \"${account.clientId}\", \"client_secret\": \"YOUR_CLIENT_SECRET\"}" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "password" + }, + { + "name": "username", + "value": "user@example.com" + }, + { + "name": "password", + "value": "pwd" + }, + { + "name": "audience", + "value": "YOUR_API_IDENTIFIER" + }, + { + "name": "scope", + "value": "read:sample" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + } + ] } } ``` @@ -63,9 +92,9 @@ Where: * `audience`: The **Identifier** value on the [Settings](${manage_url}/#/apis) tab for the API you created as part of the prerequisites for this tutorial. * `client_id`: Your application's Client ID. You can find this value at the [Settings tab of the Machine to Machine Application](${manage_url}/#/applications). * `client_secret`: Your application's Client Secret. You can find this value at the [Settings tab of the Machine to Machine Application](${manage_url}/#/applications). This is required when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications/${account.clientId}/settings) is `Post` or `Basic`. Do not set this parameter if your application is not highly trusted (for example, SPA). -* `scope`: String value of the different [scopes](/scopes) the application is asking for. Multiple scopes are separated with whitespace. +* `scope`: String value of the different scopes the application is asking for. Multiple scopes are separated with whitespace. -The response contains a [signed JSON Web Token](/jwt), the token's type (which is `Bearer`), and in how much time it expires in [Unix time](https://en.wikipedia.org/wiki/Unix_time) (86400 seconds, which means 24 hours). +The response contains a signed JSON Web Token (JWT), the token's type (which is `Bearer`), and in how much time it expires in [Unix time](https://en.wikipedia.org/wiki/Unix_time). ```js { @@ -84,12 +113,12 @@ In these cases, the `scope` parameter will be included in the response, listing ::: ::: panel How to get the user's claims -If you need the user's claims you can include the scope `openid` to your request. If the API uses `RS256` as the signing algorithm, the Access Token will now also include `/userinfo` as a valid audience. You can use this Access Token to invoke the [/userinfo endpoint](/api/authentication#get-user-info) and retrieve the user's claims. +If you need the user's claims you can include the scope `openid` to your request. If the API uses `RS256` as the [signing algorithm](/tokens/concepts/signing-algorithms), the Access Token will now also include `/userinfo` as a valid audience. You can use this Access Token to invoke the [/userinfo endpoint](/api/authentication#get-user-info) and retrieve the user's claims. ::: -### Realm Support +### Realm support -A extension grant that offers similar functionality with the **Resource Owner Password Grant**, including the ability to indicate a specific realm, is the `http://auth0.com/oauth/grant-type/password-realm`. +An extension grant that offers similar functionality to ROPG, including the ability to indicate a specific realm, is the `http://auth0.com/oauth/grant-type/password-realm`. Realms allow you to keep separate user directories and specify which one to use to the token endpoint. @@ -102,17 +131,50 @@ To use this variation you will have to change the following request parameters: "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"http://auth0.com/oauth/grant-type/password-realm\",\"username\": \"user@example.com\",\"password\": \"pwd\",\"audience\": \"https://someapi.com/api\", \"scope\": \"read:sample\", \"client_id\": \"${account.clientId}\", \"client_secret\": \"YOUR_CLIENT_SECRET\", \"realm\": \"employees\"}" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "http://auth0.com/oauth/grant-type/password-realm" + }, + { + "name": "username", + "value": "user@example.com" + }, + { + "name": "password", + "value": "pwd" + }, + { + "name": "audience", + "value": "YOUR_API_IDENTIFIER" + }, + { + "name": "scope", + "value": "read:sample" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "realm", + "value": "employees" + } + ] } } ``` ::: panel Auth0 Connections as Realms -You can configure Auth0 Connections as realms, as long as they support active authentication. This includes [Database](/connections/database), [Passwordless](/connections/passwordless), [Active Directory/LDAP](/connections/enterprise/active-directory), [Windows Azure AD](/connections/enterprise/azure-active-directory) and [ADFS](/connections/enterprise/adfs) connections. +You can configure Auth0 Connections as realms, as long as they support active authentication. This includes [Database](/connections/database), [Passwordless](/connections/passwordless), [Active Directory/LDAP](/connections/enterprise/active-directory-ldap), [Windows Azure AD](/connections/enterprise/azure-active-directory) and [ADFS](/connections/enterprise/adfs) connections. ::: ## Use the token @@ -134,7 +196,7 @@ Once the Access Token has been obtained it can be used to make calls to the Reso Once your API receives a request with a Bearer Access Token, the first thing to do is to validate the token. This consists of a series of steps, and if any of these fails then the request _must_ be rejected. -For details on the validations that should be performed by the API, refer to [Verify Access Tokens](/api-auth/tutorials/verify-access-token). +For details on the validations that should be performed by the API, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). ## Optional: Customize the Tokens @@ -144,7 +206,7 @@ If you wish to execute special logic unique to the Password exchange, you can lo ## Optional: Configure MFA -In case you need stronger authentication, than username and password, you can configure Multi- Factor Authentication (MFA) using the Resource Owner Password Grant. For details on how to implement this refer to [Multi-factor Authentication and Resource Owner Password](/api-auth/tutorials/multifactor-resource-owner-password). +In case you need stronger authentication, than username and password, you can configure multi-factor authentication (MFA) using the Resource Owner Password Grant. For details on how to implement this refer to [Multi-factor Authentication and Resource Owner Password](/mfa/guides/mfa-api/multifactor-resource-owner-password). ## Optional: Configure Anomaly Detection @@ -152,9 +214,6 @@ When using this flow from server-side applications, some anomaly detection featu ## Keep reading -::: next-steps * [Call APIs from Highly Trusted Applications](/api-auth/grant/password) * [How to configure an API in Auth0](/apis) -* [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) -* [Tokens used by Auth0](/tokens) -::: +* [Tokens](/tokens) diff --git a/articles/api-auth/tutorials/represent-multiple-apis.md b/articles/api-auth/tutorials/represent-multiple-apis.md index 456d51c81e..5eaf10b709 100644 --- a/articles/api-auth/tutorials/represent-multiple-apis.md +++ b/articles/api-auth/tutorials/represent-multiple-apis.md @@ -1,114 +1,126 @@ --- -description: How to use multiple APIs and represent them as a single API in Auth0. + +description: Learn how to use a single logical API in Auth0 to represent and control access to multiple APIs. topics: - api-authentication - oidc - apis -contentType: tutorial + - scopes + - permissions +contentType: how-to useCase: - secure-api - call-api --- -# How to Represent Multiple APIs Using a Single Auth0 API +# Represent Multiple APIs Using a Single Logical API -To simplify your authentication process, you can create a single [API](/apis) using the Auth0 Dashboard to represent all of your existing APIs. Doing this allows you to implement just one authentication flow. You can then control access to the individual APIs by assigning the appropriate scopes. +If you have multiple distinct API implementations that are all logically a part of the same API, you can simplify your authorization process by representing them with a single logical [API](/apis) in the Auth0 Dashboard. Doing this allows you to implement just one authorization flow, while still controlling access to the individual APIs by assigning the appropriate scopes. -This article shows you how to use and represent multiple APIs as a single Resource Server in Auth0 using a [sample application you can download](https://github.com/auth0-samples/auth0-api-auth-implicit-sample) if you would like to follow along as you read. Before you set up the sample on your local environment, please make sure you [set up your application in Auth0](#the-auth0-application). +This tutorial explains how to use and represent multiple APIs as a single Resource Server in Auth0. As a learning tool, we provide a sample application that you can follow along with as you read. ## The Sample Application -The sample application contains: +The sample application uses a microservices architecture and contains: + +* 1 Single-Page Application (SPA) +* 2 APIs (services), called `contacts` and `calendar` -* 1 Single Page Application (SPA); -* 2 APIs (called `contacts` and `calendar`). +We will represent the two APIs using just one Auth0 API called `Organizer Service`. We will then create two scopes to demonstrate how you can use the [Implicit Flow](/flows/concepts/implicit) to access the `calendar` and `contacts` APIs from the SPA. -We will represent the two APIs using just one Auth0 API called `Organizer Service`. We will then create two namespaced scopes to demonstrate how you can use the [Implicit Grant](/api-auth/grant/implicit) to access the `calendar` and `contacts` APIs from the SPA. The SPA also uses [Lock](/libraries/lock) to implement the signin screen. +## Prerequisites -Please see the `README` for additional information on setting up the sample on your local environment. +Before beginning this tutorial: -## The Auth0 Application +* [Register your Application with Auth0](/dashboard/guides/applications/register-app-spa) + * Select an **Application Type** of **Single-Page App**. + * Add **Allowed Callback URLs** of `http://localhost:3000` and `http://localhost:3000/callback.html`. +* [Download the sample application](https://github.com/auth0-samples/auth0-api-auth-implicit-sample), so you can follow along as you read. Please see the `README` for additional information on setting up the sample on your local environment. -If you don't already have an Auth0 Application (of type **Single Page Web Applications**) with the **OIDC Conformant** flag enabled, you'll need to create one. This represents your application. +## Steps -1. In the [Auth0 Dashboard](${manage_url}), click on [Applications](${manage_url}/#/applications) in the left-hand navigation bar. Click **Create Application**. -2. The **Create Application** window will open, allowing you to enter the name of your new Application. Choose **Single Page Web Applications** as the **Application Type**. When done, click on **Create** to proceed. -3. Navigate to the [Auth0 Application Settings](${manage_url}/#/applications/${account.clientId}/settings) page. Add `http://localhost:3000` and `http://localhost:3000/callback.html` to the Allowed Callback URLs field of your [Auth0 Application Settings](${manage_url}/#/applications/${account.clientId}/settings). -4. Scroll to the bottom of the [Settings](${manage_url}/#/applications/${account.clientId}/settings) page, where you'll find the *Advanced Settings* section. Under the *OAuth* tab, enable the **OIDC Conformant** Flag under the *OAuth* area of *Advanced Settings*. +1. [Enable a Connection for your Application](#enable-a-connection-for-your-application): Configure a source of users for your new application. +2. [Create a test user](#create-a-test-user): Associate a test user with your new connection. +3. [Register a logical API in Auth0](#register-a-logical-api-in-auth0): Register a single logical API to represent your multiple APIs. +4. [Configure scopes for the logical API](#configure-scopes-for-the-logical-API): Create the scopes that will allow the logical API to represent your multiple APIs. +5. [Grant access to the logical API](#grant-access-to-the-logical-api): Configure the login link in your sample application, initiate the authorization flow, and extract the Access Token to be used to call your multiple APIs. +Optional: [Implement Single Logout (SLO) or Single Sign-on (SSO)](#implement-single-log-out-slo-or-single-sign-on-sso) -### Enable a Connection for Your Application +## Enable a connection for your Application -[Connections](/identityproviders) are sources of users to your application, and if you don't have a sample Connection you can use with your newly-created Application, you will need to configure one. For the purposes of this sample, we'll create a simple [Database Connection](/connections/database) that asks only for the user's email address and a password. +You will need a source of users for your newly-registered application, so you will need to configure a [Connection](/identityproviders). For the purpose of this sample, we'll create a simple [Database Connection](/connections/database) that asks only for the user's email address and a password. -1. In the [Auth0 Dashboard](${manage_url}), click on [Connections > Database](${manage_url}/#/connections/database) in the left-hand navigation bar. Click **Create DB Connection**. +1. Navigate to the [Auth0 Dashboard](${manage_url}), and click on [Connections > Database](${manage_url}/#/connections/database) in the left-hand nav. Click **Create DB Connection**. 2. The **Create DB Connection** window will open. Provide a **Name** for your Connection, and click **Create** to proceed. -3. Once your Connection is ready, click over to the *Applications* tab, and enable the Connection for your Application. +3. Click the **Applications** tab, and enable the Connection. -### Create a Test User +## Create a test user -If you're working with a newly-created Connection, you won't have any users associated with the Connection. Before you can test your sample's login process, you'll need to create and associate a user with your Connection. +Since you're working with a newly-created Connection, there won't be any users associated with it. Before we can test the sample application's login process, we'll need to create and associate a user with the Connection. -1. In the [Auth0 Dashboard](${manage_url}), click on [Users](${manage_url}/#/users) in the left-hand navigation bar. Click **Create User**. +1. Navigate to the [Auth0 Dashboard](${manage_url}), and click on [Users](${manage_url}/#/users) in the left-hand nav. Click **Create User**. 2. Provide the requested information about the new user (**email address** and **password**), and select your newly-created **Connection**. -3. Click **Save** to proceed. - -## Create the Auth0 API +3. Click **Save**. -Log in to your Auth0 Dashboard, and navigate to the APIs section. +## Register a logical API in Auth0 -::: note - For detailed information on working with APIs in the Dashboard, refer to APIs. -::: +Register a single logical [API](/apis) that you will use to represent the multiple APIs contained within the sample application. -Click **Create API**. +1. Navigate to the [Auth0 Dashboard](${manage_url}), and click on [APIs](${manage_url}/#/apis) in the left-hand nav. Click **Create API**. ![](/media/articles/api-auth/tutorials/represent-multiple-apis/dashboard-apis.png) -You will be prompted to provide a **name** and **identifier**, as well as choose the **signing algorithm**, for your new API. +2. When prompted, provide a **name** and **identifier** for the new API, and choose the **signing algorithm** for the tokens obtained for this API. -For the purposes of this article, we'll call our API `Organizer Service` and set its unique identifier to `organize`. By default, the signing algorithm for the tokens this API issues is **RS256**, which we will leave as is. +For the purpose of this sample, we'll call our API `Organizer Service` and set its unique identifier to `organize`. By default, the [signing algorithm](/tokens/concepts/signing-algorithms) for the tokens obtained for this API is **RS256**, which we will leave as is. -![](/media/articles/api-auth/tutorials/represent-multiple-apis/create-new-api.png) +When finished, click **Create**. -Once you've provided the required details, click **Create** to proceed. +![](/media/articles/api-auth/tutorials/represent-multiple-apis/create-new-api.png) -### Configure the Auth0 API +## Configure scopes for the logical API -After Auth0 creates your API, you'll be directed to its *Quick Start* page. At this point, you'll need to create the appropriate **Scopes**, which you can do via the *Scopes* page. +To allow the logical API to represent the APIs included within the sample application, you will need to create the proper scopes. -![](/media/articles/api-auth/tutorials/represent-multiple-apis/scopes-page.png) +Scopes allow you to define which API actions will be accessible to calling applications. One scope will represent one API/action combination. -Scopes allow you to define the API data accessible to your applications. You'll need one scope for each API represented and action. For example, if you want to `read` and `delete` from an API called `samples`, you'll need to create the following scopes: +For example, if you want calling applications to be able to `read` and/or `delete` from one API called `samples` and another one called `examples`, you would need to create the following permissions: * `read:samples` * `delete:samples` +* `read:examples` +* `delete:examples` -For our sample application, we'll add two scopes: +You can think of each one as a microservice. -* `read:calendar`; -* `read:contacts`. +1. In your newly-created logical API, click the **Scopes** (or **Permissions**) tab. -You can think of each one as a microservice. +![](/media/articles/api-auth/tutorials/represent-multiple-apis/scopes-page.png) -![](/media/articles/api-auth/tutorials/represent-multiple-apis/new-scopes.png) +2. Add two scopes: + +* `read:calendar` +* `read:contacts` -Add these two scopes to your API and **Save** your changes. +**Save** your changes. + +![](/media/articles/api-auth/tutorials/represent-multiple-apis/new-scopes.png) -## Grant Access to the Auth0 API +## Grant access to the logical API -You are now ready to provide access to your APIs by granting Access Tokens to the Auth0 API. By including specific scopes, you can control an application to some or all of the APIs represented by the Auth0 API. +You are now ready to provide access to your APIs by allowing the logical API to obtain Access Tokens. By including the necessary scopes, you can control an application's access to the APIs represented by the logical API. :::panel Authorization Flows -The rest of this article covers use of the [Implicit Grant](/api-auth/grant/implicit) to reflect the sample. You can, however, use whichever flow best suits your needs. +The rest of this article covers use of the [Implicit Flow](/flows/concepts/implicit) to reflect the sample. However, you can use whichever flow best suits your needs. For example: -* If you have a **Machine to Machine Application**, you can authorize it to request Access Tokens to your API by executing a [client credentials exchange](/api-auth/grant/client-credentials). -* If you are building a **Native App**, you can implement the use of [Authorization Codes using PKCE](/api-auth/grant/authorization-code-pkce). +* If you have a **Machine-to-Machine Application**, you can authorize it to request Access Tokens for your API by executing a [Client Credentials Flow](/flows/concepts/client-credentials). +* If you are building a **Native App**, you can implement the [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce). For a full list of available Authorization flows, see [API Authorization](/api-auth). ::: -The app initiates the flow and redirects the browser to Auth0 (specifically to the `/authorize` endpoint), so the user can authenticate. +1. The user clicks Login within the SPA, and the app redirects the user to the Auth0 Authorization Server (`/authorize` endpoint). ```text https://YOUR_AUTH0_DOMAIN/authorize? @@ -120,21 +132,21 @@ redirect_uri=http://localhost:3000& nonce=NONCE ``` -For additional information on the call's parameters, refer to the [docs on executing an implementing the Implicit Grant](/api-auth/tutorials/implicit-grant#1-get-the-user-s-authorization). - -The SPA executes this call whenever the user clicks **Login**. +::: note +For additional information on the call's parameters, refer to our tutorial, [Call Your API Using the Implicit Flow](/flows/guides/implicit/call-api-implicit#authorize-the-user). +::: ![SPA Home before Login](/media/articles/api-auth/tutorials/represent-multiple-apis/home.png) -Lock handles the login process. +2. Your Auth0 Authorization Server redirects the user to the login page, where the user authenticates using one of the configured login options. ![SPA Login](/media/articles/api-auth/tutorials/represent-multiple-apis/lock.png) -Next, Auth0 authenticates the user. If this is the first time the user goes through this flow, they will be asked to consent to the scopes that are given to the Application. In this case, the user's asked to consent to the app reading their contacts and calendar. +3. If this is the first time the user has been through this flow, they see a consent prompt listing the permissions Auth0 will give to the SPA. In this case, the user is asked to consent to the app reading their contacts and calendar. ![Consent Screen](/media/articles/api-auth/tutorials/represent-multiple-apis/consent-screen.png) -If the user consents, Auth0 continues the authentication process, and upon completion, redirects them back to the app with an Access Token in the hash fragment of the URI. The app can now extract the tokens from the hash fragment. In a Single Page Application (SPA) this is done using JavaScript. +4. If the user consents, Auth0 redirects the user back to the SPA with tokens in the hash fragment of the URI. The SPA can now extract the tokens from the hash fragment using JavaScript and use the Access Token to call your APIs on behalf of the user. ```js function getParameterByName(name) { @@ -147,12 +159,11 @@ function getAccessToken() { } ``` -The app can then use the Access Token to call the API on behalf of the user. - -After logging in, you can see buttons that allow you to call either of your APIs. +In our sample, after you successfully log in, you will see buttons that allow you to call either of your APIs using the Access Token obtained from the logical API. ![SPA Home after Login](/media/articles/api-auth/tutorials/represent-multiple-apis/apis.png) -## Polling checkSession() to attain SSO or SLO + +## Implement Single Logout (SLO) or Single Sign-on (SSO) <%= include('../../_includes/_checksession_polling') %> diff --git a/articles/api-auth/tutorials/silent-authentication.md b/articles/api-auth/tutorials/silent-authentication.md index 808e752433..cb23a93b46 100644 --- a/articles/api-auth/tutorials/silent-authentication.md +++ b/articles/api-auth/tutorials/silent-authentication.md @@ -1,120 +1,143 @@ --- -description: How to keep users logged in to your application +description: Learn how to keep users logged in to your application using silent authentication. +toc: true topics: - api-authentication - oidc - silent-authentication -contentType: tutorial +contentType: how-to useCase: - secure-api - call-api --- -# Silent Authentication +# Configure Silent Authentication -<%= include('../../_includes/_pipeline2') %> +The OpenID Connect protocol supports a `prompt=none` parameter on the authentication request that allows applications to indicate that the authorization server must not display any user interaction (such as authentication, consent or MFA). Auth0 will either return the requested response back to the application or return an error if the user is not already authenticated, or that some type of consent or prompt is required before proceeding. -There are two main participants involved in a [single sign-on (SSO)](/sso) scenario: an Authorization Server (Auth0), and multiple applications. +Use of the [Implicit Flow](/flows/concepts/implicit) in SPAs presents security challenges requiring explicit mitigation strategies. You can use the [Authorization Code Flow with PKCE](/flows/concepts/auth-code-pkce) in conjunction with Silent Authentication to renew sessions in SPAs. -For privacy reasons, applications cannot query Auth0 directly to determine if a user has logged in via SSO. This means that users must be redirected to Auth0 for SSO authentication. +<%= include('../../_includes/_refresh_token_rotation_recommended.md') %> -However, redirecting users away from your application is usually considered disruptive and should be avoided, from a UX perspective. **Silent authentication** lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. +## Initiate Silent Authentication requests -## Initiate a Silent Authentication request - -To initiate a silent authentication request, add the `prompt=none` parameter when you redirect a user to the [`/authorize` endpoint of Auth0's authentication API](/api/authentication#authorize-application). +To initiate a silent authentication request, add the `prompt=none` parameter when you redirect a user to the [`/authorize` endpoint of Auth0's authentication API](/api/authentication#authorize-application). (The individual parameters on the authentication request will vary depending on the specific needs of your app. +) For example: ```text GET https://${account.namespace}/authorize - ?response_type=code& + ?response_type=id_token token& client_id=...& redirect_uri=...& state=...& scope=openid...& + nonce=...& + audience=...& + response_mode=...& prompt=none ``` -::: note - The specific parameters on the authentication request will depend on what kind of application is authenticating (regular web application, single page app), and so forth). -::: - -The `prompt=none` parameter will cause Auth0 to immediately redirect to the specified `redirect_uri` (callback URL) with two possible responses: - -* A successful authentication response if the user was already logged in via SSO -* An error response if the user is not logged in via SSO and therefore cannot be silently authenticated +The `prompt=none` parameter causes Auth0 to immediately send a result to the specified `redirect_uri` (callback URL) using the specified `response_mode` with one of two possible responses: success or error. ::: note Any applicable [rules](/rules) will be executed as part of the silent authentication process. ::: -### Successful authentication response +### Successful authentication responses -If the user was already logged in via SSO, Auth0 will respond exactly as if the user had authenticated manually through the SSO login page. +If the user was already logged in to Auth0 and no other interactive prompts are required, Auth0 will respond exactly as if the user had authenticated manually through the login page. -For example, when using the [Authorization Code Grant](/api-auth/grant/authorization-code) (`response_type=code`, used for regular web applications), Auth0 will respond with an authorization code that can be exchanged for an ID Token and optionally an Access Token: +For example, when using the Implicit Flow, (`response_type=id_token token`, used for single-page applications), Auth0 will respond with the requested tokens: ```text GET ${account.callback} - ?code=...& + #id_token=...& + access_token=...& state=...& expires_in=... ``` -Note that this response is indistinguishable from a login performed directly without the `prompt=none` parameter. +This response is indistinguishable from a login performed directly without the `prompt=none` parameter. -### Error response +### Error responses -If the user was not logged in via SSO or their SSO session had expired, Auth0 will redirect to the specified `redirect_uri` (callback URL) with an error: +If the user was not logged in via Single Sign-on (SSO) or their SSO session had expired, Auth0 will redirect to the specified `redirect_uri` (callback URL) with an error: ``` GET https://your_callback_url/ - ?error=ERROR_CODE& + #error=ERROR_CODE& error_description=ERROR_DESCRIPTION& state=... ``` -When using the [Authorization Code Grant](/api-auth/grant/authorization-code), the error response parameters are returned in the query string. When using the [Implicit Grant](/api-auth/grant/implicit), they are returned in the hash fragment instead. - The possible values for `ERROR_CODE` are defined by the [OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html#AuthError): -* `login_required`: The user was not logged in at Auth0, so silent authentication is not possible -* `consent_required`: The user was logged in at Auth0, but needs to give consent to authorize the application -* `interaction_required`: The user was logged in at Auth0 and has authorized the application, but needs to be redirected elsewhere before authentication can be completed; for example, when using a [redirect rule](/rules/redirect). +| Response | Description | +| -- | -- | +| `login_required` | The user was not logged in at Auth0, so silent authentication is not possible. This error can occur based on the way the tenant-level **Log In Session Management** settings are configured; specifically, it can occur after the time period set in the **Require log in after** setting. See [Configure Session Lifetime Settings](/dashboard/guides/tenants/configure-session-lifetime-settings) for details. | +| `consent_required` | The user was logged in at Auth0, but needs to give consent to authorize the application. | +| `interaction_required` | The user was logged in at Auth0 and has authorized the application, but needs to be redirected elsewhere before authentication can be completed; for example, when using a [redirect rule](/rules/redirect). | If any of these errors are returned, the user must be redirected to the Auth0 login page without the `prompt=none` parameter to authenticate. ## Renew expired tokens +You can make a silent authentication request to get new tokens as long as the user still has a valid session at Auth0. The [`checkSession` method from auth0.js](/libraries/auth0js#using-checksession-to-acquire-new-tokens) uses a silent token request in combination with `response_mode=web_message` for SPAs so that the request happens in a hidden iframe. With SPAs, Auth0.js handles the result processing (either the token or the error code) and passes the information through a callback function provided by the application. This results in no UX disruption (no page refresh or lost state). + ::: note -Please review [our notes on token renewal for Safari users](/api-auth/token-renewal-in-safari). +See [Renew Tokens When Using Safari](/api-auth/token-renewal-in-safari) for other important limitations and workarounds with the Safari browser. ::: -Access Tokens are opaque to applications. This means that applications are unable to inspect the contents of Access Tokens to determine their expiration date. +### Access Token expiration + +Access Tokens are opaque to applications. This means that applications are unable to inspect the contents of Access Tokens to determine their expiration date. There are two options to determine when an Access Token expires: -1. Read the `expires_in` response parameter returned by Auth0 -2. Ignore expiration dates altogether. Instead, try to renew the Access Token if your API rejects a request from the application (such as with a 401). +* Read the `expires_in` response parameter returned by Auth0. +* Ignore expiration dates altogether. Instead, renew the Access Token if your API rejects a request from the application (such as with a 401). -In the case of the [Implicit Grant](/api-auth/grant/implicit), the `expires_in` parameter is returned by Auth0 as a hash parameter following a successful authentication. For the [Authorization Code Grant](/api-auth/grant/code), it is returned to the backend server when performing the authorization code exchange. +In the case of the [Implicit Flow](/flows/concepts/implicit), the `expires_in` parameter is returned by Auth0 as a hash parameter following a successful authentication. In the [Authorization Code Flow](/flows/concepts/auth-code), it is returned to the backend server when performing the authorization code exchange. The `expires_in` parameter indicates how many seconds the Access Token will be valid for, and can be used to anticipate expiration of the Access Token. -When the Access Token has expired, silent authentication can be used to retrieve a new one without user interaction, assuming the user's SSO session has not expired. +### Error response -In the case of single-page applications, the [`checkSession` method from auth0.js](/libraries/auth0js#using-checksession-to-acquire-new-tokens) can be used to perform silent authentication within a hidden iframe, which results in no UX disruption at all. +You may receive the `timeout` error response which indicates that timeout during executing `web_message` communication has occurred. This error is typically associated with fallback to cross-origin authentication. To resolve, make sure to add all of the URLs from which you want to perform silent authentication in the **Allowed Web Origins** field for your Application using the Auth0 Dashboard. -## Polling with checkSession() +## Poll with `checkSession()` <%= include('../../_includes/_checksession_polling') %> -### How to implement +## Silent authentication with MFA + +In some scenarios, you may want to avoid prompting the user for MFA each time they log in from the same browser. To do this, set up a rule so that MFA occurs only once per session. This is useful when performing silent authentication (`prompt=none`) to renew short-lived Access Tokens in a SPA during the duration of a user's session without having to rely on setting `allowRememberBrowser` to `true`. + +```js +function (user, context, callback) { + const completedMfa = !!context.authentication.methods.find( + (method) => method.name === 'mfa' + ); + + if (completedMfa) { + return callback(null, user, context); + } + + context.multifactor = { + provider: 'any', + allowRememberBrowser: false + }; + + callback(null, user, context); +} +``` + +See [Change Authentication Request Frequency](/mfa/guides/customize-mfa-universal-login#change-authentication-request-frequency) for details. + +## Keep reading -Implementation of token renewal will depend on the type of application and framework being used. Sample implementations for some of the common platforms can be found below: +* [Refresh Token Rotation](/tokens/concepts/refresh-token-rotation) +* [Configure Refresh Token Rotation](/tokens/guides/configure-refresh-token-rotation) -* [Plain JavaScript](/quickstart/spa/vanillajs/05-token-renewal) -* [jQuery](/quickstart/spa/jquery/05-token-renewal) -* [React](/quickstart/spa/react/05-token-renewal) -* [Angular](/quickstart/spa/angular2/05-token-renewal) diff --git a/articles/api-auth/tutorials/using-resource-owner-password-from-server-side.md b/articles/api-auth/tutorials/using-resource-owner-password-from-server-side.md index cd6d84f809..e6a60b46de 100644 --- a/articles/api-auth/tutorials/using-resource-owner-password-from-server-side.md +++ b/articles/api-auth/tutorials/using-resource-owner-password-from-server-side.md @@ -1,28 +1,28 @@ --- -title: Using resource owner password from the server side -description: How to use Resource Owner Password Grant from the server side together with anomaly detection. +description: Learn how to use Resource Owner Password Grant (ROPG) from the server side together with anomaly detection. toc: true topics: - api-authentication - oidc - resource-owner-password + - anomaly-detection contentType: tutorial useCase: - secure-api - call-api --- -# Using Resource Owner Password from Server side +# Use Resource Owner Password Grant From the Server Side -<%= include('../../_includes/_pipeline2') %> +<%= include('../_includes/_ropg-warning') %> -Server-side applications can use the [Resource Owner Password Grant](/api-auth/grant/password) to access an API. The flow typically involves prompting the user for username and password as credentials which your server will submit to Auth0 to get an Access Token. When using this flow from server side, some anomaly detection features might fail because of the particularities of this scenario. This document details how to use [Resource Owner Password Grant](/api-auth/grant/password) flow from server side preventing some common issues. +Server-side applications can use the [Resource Owner Password Grant](/api-auth/grant/password) to access an API. The flow typically involves prompting the user for username and password as credentials which your server will submit to Auth0 to get an Access Token. When using this flow from server side, some anomaly detection features might fail because of the particularities of this scenario. This document details how to use [Resource Owner Password Grant](/api-auth/grant/password) flow from server side preventing some common issues. ## Prerequisites -Before you continue, make sure to have [brute force protection](/anomaly-detection#brute-force-protection) enabled from your dashboard. +Before you continue, make sure to have [brute force protection](/anomaly-detection/guides/enable-disable-brute-force-protection) enabled from your dashboard. -## The flow +## How it works 1. Your server prompts the user for credentials (such as username and password). This could be achieved in many different ways, for example via a browser UI or providing an API. @@ -39,35 +39,48 @@ Brute-force protection relies on having the original user's IP. When calling the To prevent this, you may send the end-user's IP address to Auth0 along with the credentials and configure the application to trust the provided IP. Because of security considerations, this configuration is only possible for Authenticated applications (such as those with authentication based on a client secret). ::: warning -Warning! Authenticated applications must only be used from protected resources, typically server-side. Do not use them from native applications or SPAs, as they are not capable of storing secrets. +Authenticated applications must only be used from protected resources, typically server-side. Do not use them from native applications or SPAs, as they are not capable of storing secrets. ::: +### Configure the Auth0 Application to receive and trust the IP sent by your server -### Configuring the Auth0 Application to receive and trust the IP sent by your server +1. Navigate to your [dashboard](${manage_url}) and [configure a regular web application or machine-to-machine application](/applications). -1. Navigate to your [dashboard](${manage_url}) and configure a regular web application or machine to machine application using this [tutorial](/applications#how-to-configure-an-application). +2. Choose a __Token Endpoint Authentication Method__ other than `None` under the [Settings](/dashboard/reference/settings-application) section. -2. Choose a __Token Endpoint Authentication Method__ other than `None` under the [Settings](/applications#application-settings) section. + ![Token Endpoint Authentication Method](/media/articles/api-auth/client-auth-method.png) -![Token Endpoint Authentication Method](/media/articles/api-auth/client-auth-method.png) +3. Scroll to the bottom and click _Show Advanced Settings_. -::: warning -Due to security considerations, the configuration stated on Step 3 will not be available for Non-Authenticated applications. -::: + ::: warning + Due to security considerations, the configuration stated on Step 3 will not be available for Non-Authenticated applications. + ::: -3. Scroll to the bottom and click _Show Advanced Settings_. +4. Enable __Trust Token Endpoint IP Header__ under the _OAuth_ tab to configure the application to trust the IP sent from your server. + + ![Enabling Auth0-Forwarded-For](/media/articles/api-auth/enabling-auth0-forwarded-for.png) + +### Send the end-user IP from your server + +If your application is configured to send the `auth0-forwarded-for` header and it authenticates (sends `client_secret` in the request): -4. Switch on __Trust Token Endpoint IP Header__ under the _OAuth_ tab to configure the application to trust the IP sent from your server. +- Only the IP in the `auth0-forwarded-for` header is checked against the brute-force protection whitelist. +- The corollary to the above is the proxy IP is ignored by brute-force protection. Don't add the proxy IP to the whitelist (if you did it would have no effect). +- If specific clients that use the proxy should be whitelisted, add them to the whitelist and they will not be subject to brute-force protection. -![Enabling Auth0-Forwarded-For](/media/articles/api-auth/enabling-auth0-forwarded-for.png) +If the application is **not** configured to use the `auth0-forwarded-for` header *or* if it does not authenticate (send `client_secret` in the request): -### Sending the end-user IP from your server +- The originating IP of each request is checked against the brute-force protection whitelist. +- Whitelisting the IP proxy exempts **all** traffic passing through the proxy from brute-force protection (this is probably not what you want). -To send the end-user IP from your server, include a `auth0-forwarded-for` header with the value of the end-user IP address. If the IP is valid, Auth0 will use it as the source IP for brute-force protection. It is important to make sure the provided IP address really belongs to your end user. +1. To send the end-user IP from your server, include a `auth0-forwarded-for` header with the value of the end-user IP address. + + If the `auth0-forwarded-for` header is marked as trusted, as explained above, Auth0 will use it as the source IP for [brute-force protection](/anomaly-detection). It is important to make sure the provided IP address really belongs to your end user. + +2. When using the resource owner password grant from your webserver with brute-force protection enabled, specify a whitelist of IPs that will not be considered when triggering brute-force protection. Both the `auth0-forwarded-for` IP address and the IP address of the proxy server will be taken into account for IP address whitelists. ::: warning -Warning! Trusting headers like the x-forwarded-for (or, in general, data from application) as source for the end-user IP can be a big risk. This should not be done unless you know you can trust that header, since it is easy to spoof and makes possible to bypass the anomaly-detection validation. -
    +Trusting headers like the `x-forwarded-for` (or, in general, data from application) as source for the end user IP can be a big risk. This should not be done unless you know you can trust that header, since it is easy to spoof and makes possible to bypass the anomaly detection validation. ::: ### Example @@ -80,19 +93,18 @@ app.post('/api/auth', function(req, res, next) { method: 'POST', url: 'https://${account.namespace}/oauth/token', headers: { - 'content-type': 'application/json', + 'content-type': 'application/x-www-form-urlencoded', 'auth0-forwarded-for': req.ip // End user ip }, - body: { + form: { grant_type: 'password', username: 'USERNAME', password: 'PASSWORD', - audience: 'API_IDENTIFIER', + audience: 'YOUR_API_IDENTIFIER', scope: 'SCOPE', client_id: '${account.clientId}', client_secret: 'YOUR_CLIENT_SECRET' // Client is authenticated - }, - json: true + } }; request(options, function (error, response, body) { @@ -102,3 +114,15 @@ app.post('/api/auth', function(req, res, next) { }); }); ``` + +### Validate with logs + +If your settings are working correctly, you will see the following in the logs: + +```text +type: sepft +... +ip: +client_ip: +... +``` \ No newline at end of file diff --git a/articles/api-auth/tutorials/verify-access-token.md b/articles/api-auth/tutorials/verify-access-token.md deleted file mode 100644 index e0521f8d5b..0000000000 --- a/articles/api-auth/tutorials/verify-access-token.md +++ /dev/null @@ -1,168 +0,0 @@ ---- -description: How an API can verify a bearer JWT Access Token -toc: true -topics: - - api-authentication - - oidc - - access-tokens -contentType: tutorial -useCase: - - secure-api - - call-api ---- -# Verify Access Tokens for Custom APIs - -<%= include('../../_includes/_pipeline2') %> - -When a custom API receives a request with a bearer [Access Token](/tokens/access-token), the first thing to do is to validate the token. - -At Auth0, an Access Token used for a custom API is formatted as a [JSON Web Token](/jwt) which must be validated before use. - -:::note -If the Access Token you got from Auth0 is not a JWT but an opaque string (like `kPoPMRYrCEoYO6s5`), this means that your implementation follows our legacy pipeline. For info on how to use the latest and more secure pipeline, see our [OIDC Conformant Authentication Adoption Guide](/api-auth/tutorials/adoption#terminology). -::: - -Validating the token consists of a series of steps, and if any of these fails, then the request **must** be rejected. This document lists all the validations that your API should perform: - -- Check that the JWT is well formed -- Check the signature -- Validate the standard claims -- Check the Application permissions (scopes) - -::: note -JWT.io provides a list of libraries that can do most of the work for you: parse the JWT, verify the signature and the claims. -::: - -## Parse the JWT - -First, the API needs to parse the JSON Web Token (JWT) to make sure it's well formed. If this fails the token is considered invalid and the request must be rejected. - -A well formed JWT, consists of three strings separated by dots (.): the header, the payload and the signature. Typically it looks like the following: - -![Sample JWT](/media/articles/api-auth/sample-jwt.png) - -The header and the payload are Base64Url encoded. The signature is created using these two, a secret and the hashing algorithm being used (as specified in the header: HMAC, SHA256 or RSA). - -For details on the JWT structure refer to [What is the JSON Web Token structure?](/jwt#what-is-the-json-web-token-structure-). - -### How can I parse the JWT? - -In order to parse the JWT you can either manually implement all the checks as described in the specification [RFC 7519 > 7.2 Validating a JWT](https://tools.ietf.org/html/rfc7519#section-7.2), or use one of the libraries listed in the _Libraries for Token Signing/Verification_ section of [JWT.io](https://jwt.io/). - -For example, if your API is implemented with Node.js and you want to use the [node-jsonwebtoken library](https://github.com/auth0/node-jsonwebtoken), then you would call the [jwt.verify()](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback) method. If the parsing fails then the library will return a [JsonWebTokenError error](https://github.com/auth0/node-jsonwebtoken#jsonwebtokenerror) with the message `jwt malformed`. - -We should note here that many web frameworks (such as [ASP.NET Core](/quickstart/backend/aspnet-core-webapi) for example) have JWT middleware that handle the token validation. Most of the times this will be a better route to take, rather that resorting to use a third-party library, as the middleware typically integrates well with the framework's overall authentication mechanisms. - -### How can I visually inspect a token? - -A quick way to see what is inside a JWT is by using the [JWT.io](https://jwt.io/) website (alternatively, you can use the [JWT Debugger Chrome Extension](https://chrome.google.com/webstore/detail/jwt-debugger/ppmmlchacdbknfphdeafcbmklcghghmd?hl=en)). It has a handy debugger which allows you to quickly check that a JWT is well formed, and also inspect the values of the various claims. - -Just paste your token at the _Encoded_ text area and review the decoded results at the right. - -![Decode JWT with JWT.io](/media/articles/api-auth/decode-jwt.png) - -## Check the Signature Algorithm - -The API needs to check if the algorithm, as specified by the JWT header (property `alg`), matches the one expected by the API. If not, the token is considered invalid and the request must be rejected. - -In this case the mismatch might be due to mistake (it is common that the tokens are signed using the `HS256` signing algorithm, but your API is configured for `RS256`, or vice versa), but it could also be due to an attack, hence the request has to be rejected. - -### How can I check the signature algorithm? - -To check if the signature matches the API's expectations, you have to decode the JWT and retrieve the `alg` property of the JWT header. - -Alternatively, you can use one of the libraries listed in the _Libraries for Token Signing/Verification_ section of [JWT.io](https://jwt.io/). - -Following the Node.js example of the previous section, the [jwt.verify()](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback) method of the [node-jsonwebtoken library](https://github.com/auth0/node-jsonwebtoken), supports an `algorithms` argument, that contains a list of strings with the names of the allowed algorithms. - -## Verify the signature - -The API needs to verify the signature of each token. - -This is necessary to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed along the way. - -Remember that the signature is created using the header and the payload of the JWT, a secret and the hashing algorithm being used (as specified in the header: HMAC, SHA256 or RSA). The way to verify it, depends on the hashing algorithm: - -- For `HS256`, the API's __Signing Secret__ is used. You can find this information at your [API's Settings](${manage_url}/#/apis). Note that the field is only displayed for APIs that use `HS256`. -- For `RS256`, the tenant's [JSON Web Key Set (JWKS)](/jwks) is used. Your tenant's JWKS is `https://${account.namespace}/.well-known/jwks.json`. - -The most secure practice, and our recommendation, is to use `RS256`. - -### How can I verify the signature? - -To verify a token's signature, you can use one of the libraries available in [JWT.io](https://jwt.io/#libraries-io). - -Following the Node.js example of the previous section, the [jwt.verify()](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback) method supports a `secretOrPublicKey` argument. This should be populated with a string or buffer containing either the secret (for `HS256`), or the PEM encoded public key (for `RS256`). - -::: panel Where can I find my public key? -Go to [Dashboard > Applications](${manage_url}/#/applications). Open the **Settings** of your application, scroll down and open **Advanced Settings**. Open the **Certificates** tab and you will find the Public Key in the **Signing Certificate** field. - -If you want to verify the signature of a token from one of your applications, we recommend getting it by parsing your tenant's [JSON Web Key Set (JWKS)](/jwks). Your tenant's JWKS is `https://${account.namespace}/.well-known/jwks.json`. - -For more info on **RS256** and **JWKS** see [Navigating RS256 and JWKS](https://auth0.com/blog/navigating-rs256-and-jwks/). -::: - -If the verification fails you will get a `invalid signature` error. - -## Validate the Claims - -Once the API verifies the token's signature, the next step is to validate the standard claims of the token's payload. The following validations need to be made: - -- _Token expiration_: The current date/time _must_ be before the expiration date/time listed in the `exp` claim (which is a Unix timestamp). If not, the request must be rejected. -- _Token issuer_: The `iss` claim denotes the issuer of the JWT. The value _must_ match the one configured in your API. For JWTs issued by Auth0, `iss` holds your Auth0 domain with a `https://` prefix and a `/` suffix: `https://${account.namespace}/`. If you are using the [custom domains](/custom-domains) feature, the value will instead be in the following format: `https:///`. -- _Token audience_: The `aud` claim identifies the recipients that the JWT is intended for. For JWTs issued by Auth0, `aud` holds the unique identifier of the target API (field __Identifier__ at your [API's Settings](${manage_url}/#/apis)). If the API is not the intended audience of the JWT, it _must_ reject the request. - -::: panel Token issuance -Auth0 issues tokens with the **iss** claim of whichever domain you used with the request. Custom domain users might use either, their custom domain, or their Auth0 domain. For example, if you used **https://northwind.auth0.com/authorize...** to obtain an Access Token, the **iss** claim of the token you receive will be **https://northwind.auth0.com/**. If you used your custom domain **https://login.northwind.com/authorize...**, the **iss** claim value will be **https://login.northwind.com/**. - -If you get an Access Token for the [Management API](/api/management/v2) using an authorization flow with your custom domain, you **must** call the Management API using the custom domain (your token will be considered invalid otherwise). -::: - -### How can I validate the claims? - -To validate the claims, you have to decode the JWT, retrieve the claims (`exp`, `iss`, `aud`) and validate their values. - -The easiest way however, is to use one of the libraries listed in the _Libraries for Token Signing/Verification_ section of [JWT.io](https://jwt.io/). Note that not all libraries validate all the claims. In [JWT.io](https://jwt.io/) you can see which validations each library supports (look for the green check marks). - -Following the Node.js example, the [jwt.verify()](https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback) method of the [node-jsonwebtoken library](https://github.com/auth0/node-jsonwebtoken), validates these claims, depending on the input arguments: - -- `audience`: set `aud` to the __Identifier__ of the API -- `issuer`: string or array of strings of valid values for the `iss` field -- `ignoreExpiration`: set to `false` to validate the expiration of the token - -## Check the Permissions - -By now you have verified that the JWT is valid. The last step is to verify that the application has the permissions required to access the protected resources. - -To do so, you need to check the [scopes](/scopes) of the decoded JWT. This claim is part of the payload and it is a space-separated list of strings. - -### How can I check the permissions? - -To check the permissions granted to the application, you need to check the contents of the `scope`. - -For example, a user management API might provide three endpoints to read, create or delete a user record: `/create`, `/read` and `/delete`. We have configured this API, so each endpoint requires a specific permission (or scope): - -- The `read:users` scope provides access to the `/read` endpoint. -- The `create:users` scope provides access to the `/create` endpoint. -- The `delete:users` scope provides access to the `/delete` endpoint. - -If a request requests to access the `/create` endpoint, but the `scope` claim does NOT include the value `create:users`, then the API should reject the request with `403 Forbidden`. - -You can see how to do this, for a simple timesheets API in Node.js, in this document: [Check the Application permissions](/architecture-scenarios/application/server-api/api-implementation-nodejs#check-the-application-permissions). - -## Sample Implementation - -You can find a sample API implementation, in Node.js, in [Server Application + API: Node.js Implementation for the API](/architecture-scenarios/application/server-api/api-implementation-nodejs). - -This document is part the [Server + API Architecture Scenario](/architecture-scenarios/application/server-api), an implementation of a Client Credentials grant for a hypothetical scenario. For more information on the complete solution refer to [Server + API Architecture Scenario](/architecture-scenarios/application/server-api). - - -## Read more - -- [RFC 7519 - JSON Web Token (JWT)](https://tools.ietf.org/html/rfc7519) -- [JSON Web Tokens (JWT) in Auth0](/jwt) -- [APIs in Auth0](/apis) -- [Why you should always use Access Tokens to secure an API](/api-auth/why-use-access-tokens-to-secure-apis) -- [Tokens used by Auth0](/tokens) -- [Server Application + API: Node.js Implementation for the API](/architecture-scenarios/application/server-api/api-implementation-nodejs#check-the-application-permissions) -- [How to implement API authentication and authorization scenarios](/api-auth) diff --git a/articles/api-auth/user-consent.md b/articles/api-auth/user-consent.md index 26902fa108..75c4329390 100644 --- a/articles/api-auth/user-consent.md +++ b/articles/api-auth/user-consent.md @@ -1,5 +1,5 @@ --- -title: User consent and third-party applications +description: Learn how to decouple APIs from applications that consume them and define third-party apps that you don't control or may not trust. topics: - api-authentication - oidc @@ -12,35 +12,18 @@ useCase: # User Consent and Third-Party Applications -<%= include('../_includes/_pipeline2') %> +The [OIDC-conformant authentication pipeline](/api-auth/tutorials/adoption) supports defining [resource servers (such as APIs) as entities separate from applications](/api-auth/tutorials/adoption/api-tokens). This lets you decouple APIs from the applications that consume them, and also lets you define third-party applications that you might not control or even fully trust. -The [OIDC-conformant authentication pipeline](/api-auth/tutorials/adoption) supports defining [resource servers (such as APIs) as entities separate from applications](/api-auth/tutorials/adoption/api-tokens). -This lets you decouple APIs from the applications that consume them, and also lets you define third-party applications that you might not control or even fully trust. +All applications created from the [Dashboard](${manage_url}/#/applications) are assumed to be first-party by default. -## Types of applications - -All Auth0 applications are either first-party or third-party. - -**First-party** applications are those controlled by the same organization or person that owns the Auth0 domain. -For example, suppose you wanted to access the Contoso API; in this case, there would likely be a first-party application used for logging in at contoso.com. - -**Third-party** applications are controlled by different people or organizations who most likely should not have administrative access to your Auth0 domain. -They enable external parties or partners to access protected resources at your API in a secure way. -A practical application of third-party applications is the creation of "developer centers", which allow users to obtain credentials in order to integrate their applications with your API. -Similar functionality is provided by well-known APIs such as Facebook, Twitter, GitHub, and many others. - -## Creating a third-party application - -All applications created from the [management dashboard](${manage_url}/#/applications) are assumed to be first-party by default. - -At the time of writing, third-party applications cannot be created from the management dashboard. -They must be created through the management API, by setting `is_first_party: false`. +Third-party applications cannot be created from the Dashboard. They must be created through the Management API, by setting `is_first_party: false`. All applications created through [Dynamic Client Registration](/api-auth/dynamic-client-registration) will be third-party. ## Consent dialog If a user is authenticating through a third-party application and is requesting authorization to access the user's information or perform some action at an API on their behalf, they will see a consent dialog. + For example: @@ -64,15 +47,13 @@ client_id=some_third_party_client
    -If the user chooses to allow the application, this will create a user grant which represents this user's consent to this combination of application, resource server and scopes. - -The application will then receive a successful authentication response from Auth0 as usual. +If the user allows the application, this creates a *user grant* which represents the user's consent to this combination of application, resource server, and scopes. -Once consent has been given, the user will no longer see the consent dialog on subsequent logins. +The application then receives a successful authentication response from Auth0 as usual. Once consent has been given, the user won't see the consent dialog during subsequent logins until consent is revoked explicitly. -## Scope Descriptions +## Scope descriptions -By default, the consent page will use the scopes' names to prompt for the user's consent. As shown below, you should define scopes using the **resource_name:action** format. +By default, the consent page will use the scopes' names to prompt for the user's consent. As shown below, you should define scopes using the **action:resource_name** format. ![API Scopes](/media/articles/api-auth/consent-scopes.png) @@ -98,7 +79,7 @@ To set the **use_scope_descriptions_for_consent** flag, you will need to make th } ``` -## Handling rejected permissions +## Handle rejected permissions If a user decides to reject consent to the application, they will be redirected to the `redirect_uri` specified in the request with an `access_denied` error: @@ -109,7 +90,7 @@ Location: https://fabrikam.com/contoso_social# &state=... ``` -## Skipping consent for first-party applications +## Skip consent for first-party applications Only first-party applications can skip the consent dialog, assuming the resource server they are trying to access on behalf of the user has the "Allow Skipping User Consent" option enabled. @@ -120,12 +101,12 @@ Note that this option only allows __verifiable__ first-party applications to ski 127.0.0.1 myapp.example ``` -Once you do this, remember to update your application configuration URLs, such as the **Allowed Callback URLs** (found in [Dashboard > Applications > Settings](${manage_url}/#/applications/${account.clientId}/settings)), and the callback URL you configured in your application, to match the updated domain-mapping. +Similarly, you **cannot** skip consent (even for first-party applications) if `localhost` appears in any domain in the **Allowed Callback URLs** setting (found in [Dashboard > Applications > Settings](${manage_url}/#/applications/${account.clientId}/settings)). Make sure to update **Allowed Callback URLs**, and the callback URL you configured in your application, to match the updated domain-mapping. ::: Since third-party applications are assumed to be untrusted, they are not able to skip consent dialogs. -## Revoking Consent +## Revoke Consent If a user has provided consent, but you would like to revoke it, you can do so via [Dashboard > Users](${manage_url}/#/users). Select the user in which you are interested, and switch over to the **Authorized Applications** tab. @@ -136,11 +117,18 @@ Click **Revoke** next to the appropriate application. When performing a [Resource Owner Password Credentials exchange](/api-auth/grant/password), there is no consent dialog involved. During a password exchange, the user provides their password to the application directly, which is equivalent to granting the application full access to the user's account. -### Forcing users to provide consent +### Force users to provide consent When redirecting to /authorize, the `prompt=consent` parameter will force users to provide consent, even if they have an existing user grant for that application and requested scopes. -### Customizing the consent dialog +### Customize the consent dialog + +The consent dialog UI cannot be customized or set to a custom domain. + +## Keep reading -As of today the consent dialog UI cannot be customized or set to a custom domain. -We plan to implement this in future releases. +* [First-Party and Third-Party Applications](/applications/concepts/app-types-first-third-party) +* [View Application Ownership](/api/management/guides/applications/view-ownership) +* [Confidential and Public Applications](/applications/concepts/app-types-confidential-public) +* [Enable Third-Party Applications](/applications/guides/enable-third-party-apps) +* [Auth0 Grant Types Mapping](/applications/reference/grant-types-auth0-mapping) diff --git a/articles/api-auth/which-oauth-flow-to-use.md b/articles/api-auth/which-oauth-flow-to-use.md index f47353f935..3c2fe7f418 100644 --- a/articles/api-auth/which-oauth-flow-to-use.md +++ b/articles/api-auth/which-oauth-flow-to-use.md @@ -1,63 +1,69 @@ --- -title: Which OAuth 2.0 flow should I use? +title: Which OAuth 2.0 Flow Should I Use? toc: true -description: Helps the user identify the proper OAuth 2.0 grant for each use case. +description: Learn how to identify the proper OAuth 2.0 grant for your use case. topics: - api-authentication - oidc - application-grants -contentType: discussion + - flows +contentType: + - concept useCase: - secure-api - call-api --- -# Which OAuth 2.0 flow should I use? +# Which OAuth 2.0 Flow Should I Use? -<%= include('../_includes/_pipeline2') %> +[OAuth 2.0](https://tools.ietf.org/html/rfc6749) supports several different **grants**. Grants are ways of retrieving an Access Token. Deciding which one is suited for your case depends mostly on your Client's type, but other parameters weigh in as well, like the level of trust for the Client, or the experience you want your users to have. -OAuth 2.0 supports several different **grants**. By grants we mean ways of retrieving an Access Token. Deciding which one is suited for your case depends mostly on your Application's type, but other parameters weigh in as well, like the level of trust for the Application, or the experience you want your users to have. +## OAuth 2.0 terminology -Follow this flow to identify the grant that best matches your case. - -![Flowchart for OAuth 2.0 Grants](/media/articles/api-auth/oauth2-grants-flow.png) - -::: panel Quick refresher - OAuth 2.0 terminology - **Resource Owner**: the entity that can grant access to a protected resource. Typically this is the end-user. -- **Application**: an application requesting access to a protected resource on behalf of the Resource Owner. +- **Client**: an application requesting access to a protected resource on behalf of the Resource Owner. - **Resource Server**: the server hosting the protected resources. This is the API you want to access. -- **Authorization Server**: the server that authenticates the Resource Owner, and issues Access Tokens after getting proper authorization. In this case, Auth0. -- **User Agent**: the agent used by the Resource Owner to interact with the Application, for example a browser or a native application. -::: +- **Authorization Server**: the server that authenticates the Resource Owner and issues Access Tokens after getting proper authorization. In this case, Auth0. +- **User Agent**: the agent used by the Resource Owner to interact with the Client, for example a browser or a native application. + +## Is the Client the Resource Owner? + +The first decision point is about whether the party that requires access to resources is a machine. In the case of machine-to-machine authorization, the Client is also the Resource Owner, so no end-user authorization is needed. An example is a cron job that uses an API to import information to a database. In this example, the cron job is the Client and the Resource Owner since it holds the Client ID and Client Secret and uses them to get an Access Token from the Authorization Server. + +If this case matches your needs, then for more information on how this flow works and how to implement it, refer to [Client Credentials Flow (Client Credentials Grant)](/flows/concepts/client-credentials). + +## Is the Client a web app executing on the server? + +If the Client is a regular web app executing on a server, then the **Authorization Code Flow (Authorization Code grant)** is the flow you should use. Using this the Client can retrieve an Access Token and, optionally, a Refresh Token. It's considered the safest choice since the Access Token is passed directly to the web server hosting the Client, without going through the user's web browser and risk exposure. + +If this case matches your needs, then for more information on how this flow works and how to implement it, refer to [Authorization Code Flow](/flows/concepts/auth-code). -## Is the Application the Resource Owner? +## Is the Client absolutely trusted with user credentials? -The first decision point is about whether the party that requires access to resources is a machine. In this case of machine to machine authorization, the Application is also the Resource Owner. No end-user authorization is needed in this case. An example is a cron job that uses an API to import information to a database. In this example the cron job is the Application and the Resource Owner since it holds the Client ID and Client Secret and uses them to get an Access Token from the Authorization Server. +This decision point may result in the **Resource Owner Password Credentials Grant**. In this flow, the end-user is asked to fill in credentials (username/password), typically using an interactive form. This information is sent to the backend and from there to Auth0. It is therefore imperative that the Client is absolutely trusted with this information. -If this case matches your needs, then for more information on how this flow works and how to implement it refer to [Calling APIs from a service](/api-auth/grant/client-credentials). +This grant should **only** be used when redirect-based flows (like the [Authorization Code Flow](/flows/concepts/auth-code)) are not possible. If this is your case, then for more information on how this flow works and how to implement it, refer to [Call APIs from Highly Trusted Applications](/api-auth/grant/password). -## Is the Application a web app executing on the server? +## Is the Client a Single Page App? -If the Application is a regular web app executing on a server then the **Authorization Code Grant** is the flow you should use. Using this the Application can retrieve an Access Token and, optionally, a Refresh Token. It's considered the safest choice since the Access Token is passed directly to the web server hosting the Application, without going through the user's web browser and risk exposure. +If the Client is a Single Page App, an application running in a browser using a scripting language like JavaScript, there are two grant options: the **Authorization Code Grant using Proof Key for Code Exchange (PKCE)** and the **Implicit Grant**. For most cases, we recommend using the Authorization Code Grant with PKCE. -If this case matches your needs, then for more information on how this flow works and how to implement it refer to [Calling APIs from server-side web apps](/api-auth/grant/authorization-code). +### Authorization Code Grant with PKCE -## Is the Application absolutely trusted with user credentials? +This grant adds the concept of a `code_verifier` to the Authorization Code Grant. When the Client asks for an **Authorization Code** it generates a `code_verifier` and its transformed value called `code_challenge`. The `code_challenge` and a `code_challenge_method` are sent along with the request. When the Client wants to exchange the Authorization Code for an Access Token, it also sends along the `code_verifier`. The Authorization Server transforms this and if it matches the originally sent `code_challenge`, it returns an Access Token. -This decision point may result to suggesting the **Resource Owner Password Credentials Grant**. In this flow the end-user is asked to fill in credentials (username/password) typically using an interactive form. This information is sent to the backend and from there to Auth0. It is therefore imperative that the Application is absolutely trusted with this information. +The [Auth0 Single Page App SDK](/libraries/auth0-spa-js) provides high-level API for implementing Authorization Code Grant with PKCE in single page applications. -This grant should **only** be used when redirect-based flows (like the [Authorization Code Grant](/api-auth/grant/authorization-code)) are not possible. If this is your case, then for more information on how this flow works and how to implement it refer to [Call APIs from Highly Trusted Applications](/api-auth/grant/password). +For more information on how this flow works and how to implement it, refer to [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce). -## Is the Application a native app or a SPA? +### Implicit Grant -If the Application is a Single Page Application (meaning an application running in a browser using a scripting language such as Javascript) then the **Implicit Grant** should be used. In this case, instead of getting an authorization code that needs to be exchanged for an Access Token, the Application retrieves directly an Access Token. On the plus side, this is more efficient since it reduces the number of round trips required to get an Access Token. However, a security consideration is that the Access Token is exposed on the client side. Also, it should be noted that **Implicit Grant** does not return a Refresh Token because the browser cannot keep it private (read the __SPAs and Refresh Tokens__ panel for a workaround). +In this case, instead of getting an authorization code that needs to be exchanged for an Access Token, the Application directly retrieves an Access Token. On the plus side, this is more efficient since it reduces the number of round trips required to get an Access Token. However, a security consideration is that **the Access Token is exposed on the client side**. Also, note that this flow does not return a Refresh Token because the browser cannot keep it private. -For more information on how this flow works and how to implement it, refer to [Call APIs from client-side web apps](/api-auth/grant/implicit). +For more information on how this flow works and how to implement it, refer to [Implicit Flow](/flows/concepts/implicit). -::: panel SPAs and Refresh Tokens -While SPAs cannot use [Refresh Tokens](/tokens/refresh-token), they can take advantage of other mechanics that provide the same function. A workaround to improve user experience is to use `prompt=none` when you invoke [the /authorize endpoint](/api/authentication#implicit-grant). This will not display the login dialog or the consent dialog. For more information on this, refer to [Silent Authentication](/api-auth/tutorials/silent-authentication). In addition to that if you call `/authorize` from a hidden iframe and extract the new [Access Token](/tokens/access-token) from the parent frame, then the user will not see the redirects happening. -::: +## Is the Client a Native/Mobile App? -If the Application is a native app then the **Authorization Code Grant using Proof Key for Code Exchange** should be used. This grant adds the concept of a `code_verifier` to the Authorization Code Grant. When at first the application asks for an **Authorization Code** it generates a `code_verifier` and its transformed value called `code_challenge`. The `code_challenge` is sent along with the request. A `code_challenge_method` is also sent. Afterwards, when the application wants to exchange the Authorization Code for an Access Token, it also sends along the `code_verifier`. The Authorization Server transforms this and if it matches the originally sent `code challenge` it returns an Access Token. +If the Application is a native app, then the **Authorization Code Flow with PKCE (Authorization Code Grant using Proof Key for Code Exchange)** should be used. -For more information on how this flow works and how to implement it, refer to [Calling APIs from Mobile Apps](/api-auth/grant/authorization-code-pkce). +For more information on how this flow works and how to implement it, refer to [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce). diff --git a/articles/api-auth/why-use-access-tokens-to-secure-apis.md b/articles/api-auth/why-use-access-tokens-to-secure-apis.md deleted file mode 100644 index 006e26fd34..0000000000 --- a/articles/api-auth/why-use-access-tokens-to-secure-apis.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: Why you Should Always Use Access Tokens to Secure an API -description: Explains the differences between Access Token and ID Token and why the latter should never be used to access an API. -topics: - - api-authentication - - oidc - - access-tokens -contentType: discussion -useCase: - - secure-api - - call-api ---- -# Why you Should Always Use Access Tokens to Secure an API - -<%= include('../_includes/_pipeline2') %> - -There's a lot of confusion between **OpenID Connect** and **OAuth 2.0**, especially when it comes to determining which option is the best for a particular use case. As such, many developers publish insecure applications that compromise their users' data. - -To help you make an informed decision and be aware of any risks, this article includes: - -* A high-level overview of each protocol -* Information about the tokens issued by each protocol -* Suggestions on when you should use which protocol - -We'll wrap things up with a discussion of why you should always secure an API with an [Access Token](/tokens/access-token), *not* an [ID Token](/tokens/id-token). - -## Two complementary specifications - -::: note -OpenID Connect tells you who somebody is. OAuth 2.0 tells you what somebody is allowed to do. -::: - -OAuth 2.0 is used to __grant authorization__. It allows you to authorize Web App A access to your information from Web App B without requiring you to share your credentials. OAuth 2.0 was built with _only_ authorization in mind and doesn't include any authentication mechanisms. In other words, OAuth 2.0 doesn't give the Authorization Server any way of verifying who the user is. - -OpenID Connect builds on OAuth 2.0. It enables you, as the user, to **verify your identity** and to give some basic profile information without sharing your credentials. - -## An example of how these protocols are used - -Let's say that you use a to-do application that allows you to log in using your Google credentials. You are asked to provide permission for the to-do app to read and write to your Google Calendar. Then, with this app, you can push to-do items, such as calendar entries, to your Google Calendar. - -The portion of the login process where you "prove" your identity is implemented using OpenID Connect, while the part of the login process where you authorize the to-do application to modify your Google Calendar by adding entries is implemented using OAuth 2.0. - -## The role of tokens - -You may have noticed that we've used the phrase **without sharing your credentials** several times in the paragraph above. How does this work? - -Essentially, the two protocols operate by sharing **tokens**. - -OpenID Connect issues an identity token, known as an ID Token, while OAuth 2.0 issues an Access Token. - -## How to use tokens - -The **ID Token** is a [JSON Web Token (JWT)](/jwt), and it is meant for the application only. For example, in our calendar example above, Google sends an ID Token to the to-do app that tells the app who you are. The app then parses [the token's contents](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) and uses this information (including details like your name and your profile picture) to customize your user experience. - -::: warning -Be sure to [validate an ID Token](/tokens/id-token#validate-an-id-token) before using the information it contains! You can use a [library](https://jwt.io/#libraries-io) to help with this task. -::: - -The **Access Token** (which isn't necessarily a JWT), is meant for use by an API. - -The Access Token's purpose is to inform the API that the bearer of the token has been authorized to access the API and perform a predetermined set of actions (which is specified by the **scopes** granted). - -In the Google/to-do app example above, recall that Google sent an Access Token to the to-do app after you logged in and provided consent for your to-do app to read/write to your Google Calendar. - -Whenever the to-do app wants to write to your Google Calendar, it will send a request to the Google Calendar API, making sure to include the Access Token in the HTTP **Authorization** header. - -::: note -Your applications should treat Access Tokens as opaque strings, since they are meant for APIs. Your application should *not* attempt to decode them or expect to receive tokens in a particular format. -::: - -## How NOT to use tokens - -Now that we've seen some ways in which we can use tokens, let's talk about when they should **not** be used. - -* **Access Tokens must never be used for authentication.** Access Tokens cannot tell us if the user has authenticated. The only user information the Access Token possesses is the user ID, located in the **sub** claim. - -* **ID Tokens should not be used to gain access to an API**. Each token contains information for the intended audience (which is usually the recipient). Per the OpenID Connect specification, the audience of the ID Token (indicated by the **aud** claim) must be the **client ID** of the application making the authentication request. If this is not the case, you should not trust the token. Conversely, an API expects a token with the **aud** value to equal the API's unique identifier. Therefore, unless you maintain control over both the application and the API, sending an ID Token to an API will generally not work. Furthermore, the ID Token is signed with a secret known only to the application itself. If an API were to accept an ID Token, it would have no way of knowing if the application has modified the token (such as adding more scopes) and resigned it. - -## Compare the tokens - -To better clarify the concepts we covered above, let's look at the contents of some sample ID and Access Tokens. - -The (decoded) contents of our sample ID Token look like the following: - -```json -{ - "iss": "http://${account.namespace}/", - "sub": "auth0|123456", - "aud": "${account.clientId}", - "exp": 1311281970, - "iat": 1311280970, - "name": "Jane Doe", - "given_name": "Jane", - "family_name": "Doe", - "gender": "female", - "birthdate": "0000-10-31", - "email": "janedoe@example.com", - "picture": "http://example.com/janedoe/me.jpg" -} -``` - -This token is meant to **authenticate the user to the application**. The audience (the **aud** claim) of the token is set to the application's identifier, which means that only this specific application should consume this token. - -For comparison, let's look at the contents of an Access Token: - -```json -{ - "iss": "https://${account.namespace}/", - "sub": "auth0|123456", - "aud": [ - "my-api-identifier", - "https://${account.namespace}/userinfo" - ], - "azp": "${account.clientId}", - "exp": 1489179954, - "iat": 1489143954, - "scope": "openid profile email address phone read:appointments email" -} -``` - -Note that the token does not contain any information about the user itself besides their ID (**sub** claim), it only contains authorization information about which actions the application is allowed to perform at the API (**scope** claim). - -In many cases, you might find it useful to retrieve additional user information at the API, so the token is also valid for call [the /userinfo API](/api/authentication#user-profile), which returns the user's profile information. The intended audience (indicated by the **aud** claim) for this token is both your custom API as specified by its identifier (such as `https://my-api-identifier`) and the **/userinfo** endpoint (such as `https://${account.namespace}/userinfo`). - -## Keep reading - -::: next-steps -* [The problem with OAuth for Authentication](http://www.thread-safe.com/2012/01/problem-with-oauth-for-authentication.html) -* [User Authentication with OAuth 2.0](https://oauth.net/articles/authentication/) -* [OAuth 2.0 Overview](/protocols/oauth2) -* [OpenID Connect Overview](/protocols/oidc) -* [Obtaining and Using Access Tokens](/tokens/access-token) -* [Obtaining and Using ID Tokens](/tokens/id-token) -::: diff --git a/articles/api/authentication/_application-reg.md b/articles/api/authentication/_application-reg.md index 3ef1f90f27..21471c3821 100644 --- a/articles/api/authentication/_application-reg.md +++ b/articles/api/authentication/_application-reg.md @@ -39,7 +39,7 @@ curl --request POST \ "link": "#dynamic-application-client-registration" }) %> -With a name and the necessary callback URLs, you can dynamically register a client with Auth0. No token is needed for this request. +With a name and the necessary callback URL, you can dynamically register a client with Auth0. No token is needed for this request. ### Request Parameters @@ -47,4 +47,4 @@ With a name and the necessary callback URLs, you can dynamically register a clie |:-----------------|:------------| | `client_name` | The name of the Dynamic Client to be created. It is recommended to provide a value but if it is omitted, the default name "My App" will be used. | | `redirect_uris`
    Required | An array of URLs that Auth0 will deem valid to call at the end of an Authentication flow. | -| `token_endpoint_auth_method` | Default value is `client_secret_post`, but it can also be `none`. | +| `token_endpoint_auth_method` | Default value is `client_secret_post`. Use `token_endpoint_auth_method: none` in the request payload if creating a SPA.| diff --git a/articles/api/authentication/_change-password.md b/articles/api/authentication/_change-password.md index b023b6f934..00e44b2854 100644 --- a/articles/api/authentication/_change-password.md +++ b/articles/api/authentication/_change-password.md @@ -1,13 +1,13 @@ # Change Password - + ```http POST https://${account.namespace}/dbconnections/change_password Content-Type: application/json { "client_id": "${account.clientId}", "email": "EMAIL", - "password": "", "connection": "CONNECTION", + "organization": "ORGANIZATION_ID" } ``` @@ -15,7 +15,7 @@ Content-Type: application/json curl --request POST \ --url https://${account.namespace}/dbconnections/change_password \ --header 'content-type: application/json' \ - --data '{"client_id": "${account.clientId}","email": "EMAIL", "password": "", "connection": "CONNECTION"}' + --data '{"client_id": "${account.clientId}","email": "EMAIL", "connection": "CONNECTION", "organization": "ORGANIZATION_ID"}' ``` ```javascript @@ -29,7 +29,8 @@ curl --request POST \ webAuth.changePassword({ connection: 'CONNECTION', - email: 'EMAIL' + email: 'EMAIL', + organization: 'ORGANIZATION_ID' }, function (err, resp) { if(err){ console.log(err.message); @@ -53,40 +54,34 @@ curl --request POST \ "We've just sent you an email to reset your password." ``` -Given a user's `email` address and a `connection`, Auth0 will send a change password email. +Send a change password email to the user's provided email address and `connection`. + +Optionally, you may provide an Organization ID to support Organization-specific variables in [customized email templates](/customize/email/email-templates#common-variables) and to include the `organization_id` and `organization_name` parameters in the **Redirect To** URL. -This endpoint only works for database connections. +Note: This endpoint only works for database connections. ### Request Parameters | Parameter | Description | |:-----------------|:------------| -| `client_id` | The `client_id` of your client. We strongly recommend including a Client ID so that the email template knows from which client the request was triggered. | +| `client_id` | The `client_id` of your client. | | `email`
    Required | The user's email address. | -| `password ` | The new password. See the next paragraph for the case when a password can be set. | | `connection`
    Required | The name of the database connection configured to your client. | - - -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> +| `organization` | The `organization_id` of the Organization associated with the user. | ### Remarks -- If you are using Lock version 9 and above, **do not set the password field** or you will receive a *password is not allowed* error. You can only set the password if you are using Lock version 8. -- If a password is provided, when the user clicks on the confirm password change link, the new password specified in this POST will be set for this user. -- If a password is NOT provided, when the user clicks on the password change link they will be redirected to a page asking them for a new password. -- The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). +- When the user clicks on the password change link they will be redirected to a page asking them for a new password. - This endpoint will return three HTTP Response Headers, that provide relevant data on its rate limits: * `X-RateLimit-Limit`: Number of requests allowed per minute. * `X-RateLimit-Remaining`: Number of requests available. Each new request reduces this number by 1. For each minute that passes, requests are added back, so this number increases by 1 each time. * `X-RateLimit-Reset`: Remaining time until the rate limit (`X-RateLimit-Limit`) resets. The value is in [UTC epoch seconds](https://en.wikipedia.org/wiki/Unix_time). -### More Information +### Learn More - [Changing a User's Password](/connections/database/password-change) - [Password Strength in Auth0 Database Connections](/connections/database/password-strength) - [Password Options in Auth0 Database Connections](/connections/database/password-options) -- [Auth0 API Rate Limit Policy](/policies/rate-limits) +- [Auth0 API Rate Limit Policy](/troubleshoot/customer-support/operational-policies/rate-limit-policy/rate-limit-configurations) diff --git a/articles/api/authentication/_introduction.md b/articles/api/authentication/_introduction.md index 798744e836..0df041af98 100644 --- a/articles/api/authentication/_introduction.md +++ b/articles/api/authentication/_introduction.md @@ -2,7 +2,7 @@ The Authentication API enables you to manage all aspects of user identity when you use Auth0. It offers endpoints so your users can log in, sign up, log out, access APIs, and more. -The API supports various identity protocols, like [OpenID Connect](/protocols/oidc), [OAuth 2.0](/protocols/oauth2), and [SAML](/protocols/saml). +The API supports various identity protocols, like [OpenID Connect](/protocols/oidc), [OAuth 2.0](/protocols/oauth2), [FAPI](/secure/highly-regulated-identity#advanced-security-with-openid-connect-fapi-) and [SAML](/protocols/saml). :::note This API is designed for people who feel comfortable integrating with RESTful APIs. If you prefer a more guided approach check out our [Quickstarts](/quickstarts) or our [Libraries](/libraries). @@ -14,24 +14,49 @@ The Authentication API is served over HTTPS. All URLs referenced in the document ## Authentication methods -There are three ways to authenticate with this API: -- with an OAuth2 Access Token in the `Authorization` request header field (which uses the `Bearer` authentication scheme to transmit the Access Token) -- with your Client ID and Client Secret credentials -- only with your Client ID +You have five options for authenticating with this API: +- OAuth2 Access Token +- Client ID and Client Assertion (confidential applications) +- Client ID and Client Secret (confidential applications) +- Client ID (public applications) +- mTLS Authentication (confidential applications) -Each endpoint supports only one option. +### OAuth2 Access Token -### OAuth2 token +Send a valid Access Token in the `Authorization` header, using the `Bearer` authentication scheme. -In this case, you have to send a valid [Access Token](/tokens/access-token) in the `Authorization` header, using the `Bearer` authentication scheme. An example is the [Get User Info endpoint](#get-user-info). In this scenario, you get an Access Token when you authenticate a user, and then you can make a request to the [Get User Info endpoint](#get-user-info), using that token in the `Authorization` header, in order to retrieve the user's profile. +An example is the [Get User Info endpoint](#get-user-info). In this scenario, you get an Access Token when you authenticate a user, and then you can make a request to the [Get User Info endpoint](#get-user-info), using that token in the `Authorization` header, in order to retrieve the user's profile. + +### Client ID and Client Assertion +Generate a [client assertion](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authenticate-with-private-key-jwt) containing a signed JSON Web Token (JWT) to authenticate. In the body of the request, include your Client ID, a `client_assertion_type` parameter with the value `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`, and a `client_assertion` parameter with your signed assertion. Review [Private Key JWT]( https://auth0.com/docs/get-started/authentication-and-authorization-flow/authenticate-with-private-key-jwt) for examples. ### Client ID and Client Secret -In this case, you have to send your Client ID and Client Secret information in the request JSON body. An example is the [Revoke Refresh Token endpoint](#revoke-refresh-token). This option is available only for confidential applications (such as applications that are able to hold credentials in a secure way without exposing them to unauthorized parties). +Send the Client ID and Client Secret. The method you can use to send this data is determined by the [Token Endpoint Authentication Method](/get-started/applications/confidential-and-public-applications/view-application-type) configured for your application. + +If you are using **Post**, you must send this data in the JSON body of your request. + +If you are using **Basic**, you must send this data in the `Authorization` header, using the `Basic` authentication scheme. To generate your credential value, concatenate your Client ID and Client Secret, separated by a colon (`:`), and encode it in Base64. + +An example is the [Revoke Refresh Token endpoint](#revoke-refresh-token). This option is available only for confidential applications (such as applications that are able to hold credentials in a secure way without exposing them to unauthorized parties). ### Client ID -For public applications (such as applications that cannot hold credentials securely, like SPAs or mobile apps) we offer some endpoints that can be accessed using only the Client ID. An example is the [Implicit Grant](#implicit-grant). +Send the Client ID. For public applications (applications that cannot hold credentials securely, such as SPAs or mobile apps), we offer some endpoints that can be accessed using only the Client ID. + +An example is the [Implicit Grant](#implicit-flow). + +### mTLS Authentication + +Generate a certificate, either [self-signed](/get-started/applications/configure-mtls/configure-mtls-for-a-client#self-signed-certificates) or [certificate authority signed](/get-started/applications/configure-mtls/configure-mtls-for-a-client#certificate-authority-signed-certificates). Then, [set up the customer edge network](/get-started/applications/configure-mtls/set-up-the-customer-edge) that performs the mTLS handshake. + +Once your edge network verifies the certificate, forward the request to the Auth0 edge network with the following headers: + +- The Custom Domain API key as the `cname-api-key` header. +- The client certificate as the `client-certificate` header. +- The client certificate CA verification status as the `client-certificate-ca-verified` header. For more information, see [Forward the Request](/get-started/applications/configure-mtls/set-up-the-customer-edge#forward-the-request-). + +To learn more, read [Authenticate with mTLS](/get-started/authentication-and-authorization-flow/authenticate-with-mtls). ## Parameters @@ -44,12 +69,12 @@ For POST requests, parameters not included in the URL should be encoded as JSON `curl --request POST --url 'https://${account.namespace}/some-endpoint' --header 'content-type: application/json' --data '{"param": "value", "param": "value"}'` ::: note -An exception to that is the [SAML IdP-Initiated SSO Flow](#idp-initiated-sso-flow) that uses both a query string parameter and a `x-www-form-urlencoded` value. +An exception to that is the [SAML IdP-Initiated Single Sign-on (SSO) Flow](#idp-initiated-sso-flow), which uses both a query string parameter and a `x-www-form-urlencoded` value. ::: ## Code samples -For each endpoint you will find sample snippets you can use, in three available formats: +For each endpoint, you will find sample snippets you can use, in three available formats: - HTTP request - Curl command - JavaScript: depending on the endpoint each snippet may use the [Auth0.js library](/libraries/auth0js), Node.js code or simple JavaScript @@ -58,24 +83,40 @@ Each request should be sent with a Content-Type of `application/json`. ## Testing -You can test the endpoints using either the [Authentication API Debugger](/extensions/authentication-api-debugger) or our preconfigured [Postman collection](https://app.getpostman.com/run-collection/2a9bc47495ab00cda178). For some endpoints both options are available. +You can test the endpoints using the [Authentication API Debugger](/extensions/authentication-api-debugger). -### Test with the Authentication API Debugger +### Authentication API Debugger The [Authentication API Debugger](/extensions/authentication-api-debugger) is an Auth0 extension you can use to test several endpoints of the Authentication API. -If it's the first time you use it, you have to install it using the [dashboard](https://${manage_url}/#/extensions). Once you do you are ready to configure your app's settings and run your tests. +<%= include('../../_includes/_test-this-endpoint') %> + +### Configure Connections + +1. On the *Configuration* tab, set the fields **Application** (select the application you want to use for the test) and **Connection** (the name of the social connection to use). + +1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). + +1. At the *OAuth2 / OIDC* tab, select **OAuth2 / OIDC Login**. + +### Endpoint options +Configure other endpoints with the following options: -Note that its URL varies according to your tenant's region: -- US West -- Europe Central -- Australia +- Passwordless: On the *OAuth2 / OIDC* tab, set **Username** to the user's phone number if `connection=sms`, or the user's email if `connection=email`, and **Password** to the user's verification code. Click **Resource Owner Endpoint**. +- SAML SSO: On the *Other Flows* tab, select **SAML**. +- WS-Federation: On the *Other Flows* tab, select **WS-Federation**. +- Logout: On the *Other Flows* tab, select **Logout**, or **Logout (Federated)** to log the user out of the identity provider as well. +- Legacy Login: On the *OAuth2 / OIDC* tab, set the fields **ID Token**, **Refresh Token** and **Target Client ID**. Click **Delegation**. +- Legacy Delegation: On the *OAuth2 / OIDC* tab, set **Username** and **Password**. Click **Resource Owner Endpoint**. +- Legacy Resource Owner: On the *OAuth2 / OIDC* tab, set the **Username** and **Password**, then select **Resource Owner Endpoint**. -### Test with Postman +### Authentications flows -If you are working with APIs, you are probably already familiar with [Postman](https://www.getpostman.com/), a development tool that enables you to configure and run API requests. +Configure authentication flows with the following options: +- Authorization Code Flow: On the *OAuth2 / OIDC* tab, set the field **Authorization Code** to the code you retrieved from [Authorization Code Grant](/get-started/authentication-and-authorization-flow/authorization-code-flow), and the **Code Verifier** to the key. Click **OAuth2 Code Exchange**. +- Authorization Code Flow + PKCE: On the *OAuth2 / OIDC* tab, set the field **Authorization Code** to the code you retrieved from [Authorization Code Grant](/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce), and the **Code Verifier** to the key. Click **OAuth2 Code Exchange**. +- Client Credential Flow: On the *OAuth2 / OIDC* tab, select **OAuth2 Client Credentials**. -We have preconfigured a collection that you can [download](https://app.getpostman.com/run-collection/2a9bc47495ab00cda178). You will have to configure some environment variables to customize the requests. For more information on this, refer to [Using the Auth0 API with our Postman Collections](/api/postman). ## Errors @@ -95,10 +136,10 @@ If you exceed the provided rate limit for a given endpoint, you will receive the For details on rate limiting, refer to [Auth0 API Rate Limit Policy](/policies/rate-limits). -Note that for database connections Auth0 limits certain types of repeat login attempts depending on the user account and IP address. For details, refer to [Rate Limits on User/Password Authentication](/connections/database/rate-limits). +Note that for database connections Auth0 limits certain types of repeat login attempts depending on the user account and IP address. For details, refer to [Rate Limits on User/Password Authentication](/policies/rate-limit-policy/database-connections-rate-limits). ## Support -If you have problems or need help with your case you can always reach out to our [Support](${env.DOMAIN_URL_SUPPORT}). +If you have problems or need help with your case, you can always reach out to our [Support](${env.DOMAIN_URL_SUPPORT}). Note that if you have a free subscription plan, and you are not in your 22-day trial period, you will not be able to access or open tickets in the [Support Center](${env.DOMAIN_URL_SUPPORT}). In this case, you can seek support through the [Auth0 Community](https://community.auth0.com/). For more info on our support program, refer to [Support Options](/support). diff --git a/articles/api/authentication/_login.md b/articles/api/authentication/_login.md index 12cd56bf51..ede24026ba 100644 --- a/articles/api/authentication/_login.md +++ b/articles/api/authentication/_login.md @@ -1,5 +1,13 @@ + # Login +<%= include('../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "GET", + "path": "/authorize", + "link": "#social" +}) %> + ## Social ```http @@ -39,14 +47,9 @@ GET https://${account.namespace}/authorize? ``` -<%= include('../../_includes/_http-method', { - "http_badge": "badge-primary", - "http_method": "GET", - "path": "/authorize", - "link": "#social" -}) %> +You can connect your Auth0 service to a social identity provider and allow your users to log in to your application via Facebook, Google, Apple, or other supported providers. To learn more about supported providers, visit [Marketplace](https://marketplace.auth0.com/features/social-connections). -Use this endpoint to authenticate a user with a social provider. It will return a `302` redirect to the social provider specified in `connection`. +To authenticate users with a social provider, make a `GET` call to the `/authorize` endpoint. It will return a `302` redirect to the social provider specified in the `connection` parameter. ::: note Social connections only support browser-based (passive) authentication because most social providers don't allow a username and password to be entered into applications that they don't own. Therefore, the user will be redirected to the provider's sign in page. @@ -56,40 +59,26 @@ Social connections only support browser-based (passive) authentication because m | Parameter | Description | |:-----------------|:------------| -| `response_type`
    Required | Use `code` for server side flows and `token` for application side flows | +| `response_type`
    Required | Specifies the token type. Use `code` for server side flows and `token` for application side flows | | `client_id`
    Required | The `client_id` of your application | | `connection` | The name of a social identity provider configured to your application, for example `google-oauth2` or `facebook`. If null, it will redirect to the [Auth0 Login Page](https://${account.namespace}/login) and show the Login Widget. | -| `redirect_uri`
    Required | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | +| `redirect_uri`
    Required | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. Specify the `redirect_uri` under your [Application's Settings](${manage_url}/#/applications).| | `state`
    Recommended | An opaque value the applications adds to the initial request that the authorization server includes when redirecting the back to the application. This value must be used by the application to prevent CSRF attacks. | -| `ADDITIONAL_PARAMETERS` | Append any additional parameter to the end of your request, and it will be sent to the provider. For example, `access_type=offline` (for Google Refresh Tokens) , `display=popup` (for Windows Live popup mode). | - -### Test with Authentication API Debugger - -<%= include('../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the fields **Application** (select the application you want to use for the test) and **Connection** (the name of the social connection to use). - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, click **OAuth2 / OIDC Login**. +| `ADDITIONAL_PARAMETERS` | Append any additional parameter to the end of your request, and it will be sent to the provider. For example, `access_type=offline` (for Google Refresh Tokens) , `display=popup` (for Windows Live popup mode). | ### Remarks -- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). - -- If `response_type=token`, after the user authenticates on the provider, it will redirect to your application `callback URL` passing the Access Token and ID Token in the address `location.hash`. This is used for Single Page Apps and also on Native Mobile SDKs. +- If `response_type=token`, after the user authenticates on the provider, it will redirect to your application `callback URL` passing the Access Token and ID Token in the address `location.hash`. This is used for Single-Page Apps and also on Native Mobile SDKs. - The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). +### Learn More -### More Information - -- [Supported Social Identity Providers](/identityproviders#social) +- [Supported Social Identity Providers](https://marketplace.auth0.com/features/social-connections) - [Custom Social Connections](/connections/social/oauth2) -- [Using the State Parameter](/protocols/oauth2/oauth-state) +- [State Parameter](/secure/attack-protection/state-parameters) - [Auth0.js /authorize Method Reference](/libraries/auth0js#webauth-authorize-) - ## Database/AD/LDAP (Passive) ```http @@ -98,6 +87,7 @@ GET https://${account.namespace}/authorize? client_id=${account.clientId}& connection=CONNECTION& redirect_uri=${account.callback}& + scope=openid%20profile%20email& state=STATE ``` @@ -116,6 +106,7 @@ GET https://${account.namespace}/authorize? clientID: '${account.clientId}', // string responseType: 'token', // code or token redirectUri: '${account.callback}', + scope: 'openid profile email' state: 'YOUR_STATE' }); @@ -124,50 +115,31 @@ GET https://${account.namespace}/authorize? ``` -<%= include('../../_includes/_http-method', { - "http_badge": "badge-primary", - "http_method": "GET", - "path": "/authorize", - "link": "#database-ad-ldap-passive-" -}) %> - -Use this endpoint for browser based (passive) authentication. It returns a `302` redirect to the [Auth0 Login Page](https://${account.namespace}/login) that will show the Login Widget where the user can login with email and password. +Use the Auth0 user store or your own database to store and manage username and password credentials. If you have your own user database, you can use it as an identity provider in Auth0 to authenticate users. When you make a `GET` call to the `/authorize` endpoint for browser based (passive) authentication. It returns a `302` redirect to the [Auth0 Login Page](https://${account.namespace}/login) that will show the Login Widget where the user can log in with email and password. ### Request Parameters | Parameter | Description | |:-----------------|:------------| -| `response_type`
    Required | Use `code` for server side flows and `token` for application side flows. | +| `response_type`
    Required | Specifies the token type. Use `code` for server side flows and `token` for application side flows. | | `client_id`
    Required | The `client_id` of your application. | | `connection` | The name of the connection configured to your application. If null, it will redirect to the [Auth0 Login Page](https://${account.namespace}/login) and show the Login Widget using the first database connection. | -| `redirect_uri`
    Required | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | +| `redirect_uri`
    Required | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. Specify the `redirect_uri` under your [Application's Settings](${manage_url}/#/applications).| +| `scope`
    Recommended | OIDC scopes and custom API scopes. For example: `openid read:timesheets`. Include `offline_access` to get a Refresh Token.| | `state`
    Recommended | An opaque value the applications adds to the initial request that the authorization server includes when redirecting the back to the application. This value must be used by the application to prevent CSRF attacks. | - -### Test with Authentication API Debugger - -<%= include('../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the fields **Application** (select the application you want to use for the test) and **Connection** (the name of the social connection to use). - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, click **OAuth2 / OIDC Login**. - - ### Remarks -- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). -- If `response_type=token`, after the user authenticates, it will redirect to your application `callback URL` passing the Access Token and ID Token in the address `location.hash`. This is used for Single Page Apps and also on Native Mobile SDKs. +- If `response_type=token`, after the user authenticates, it will redirect to your application `callback URL` passing the Access Token and ID Token in the address `location.hash`. This is used for Single-Page Apps and also on Native Mobile SDKs. - The main difference between passive and active authentication is that the former happens in the browser through the [Auth0 Login Page](https://${account.namespace}/login) and the latter can be invoked from anywhere (a script, server to server, and so forth). - The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). -### More Information +### Learn More - [Database Identity Providers](/connections/database) -- [Rate Limits on User/Password Authentication](/connections/database/rate-limits) +- [Rate Limits on User/Password Authentication](/policies/rate-limit-policy/database-connections-rate-limits) - [Active Directory/LDAP Connector](/connector) -- [Using the State Parameter](/protocols/oauth2/oauth-state) +- [State Parameter](/protocols/oauth2/oauth-state) - [Auth0.js /authorize Method Reference](/libraries/auth0js#webauth-authorize-) ## Enterprise (SAML and Others) @@ -191,68 +163,211 @@ GET https://${account.namespace}/authorize? clientID: '${account.clientId}' }); - // Trigger login using redirect with credentials to enterprise connections - webAuth.redirect.loginWithCredentials({ - connection: 'Username-Password-Authentication', - username: 'testuser', - password: 'testpass', - scope: 'openid' + // Calculate URL to redirect to + var url = webAuth.client.buildAuthorizeUrl({ + clientID: 'YOUR_CLIENT_ID', // string + responseType: 'token', // code or token + redirectUri: 'https://YOUR_APP/callback', + scope: 'openid profile email' + state: 'YOUR_STATE' }); - // Trigger login using popup mode with credentials to enterprise connections - webAuth.popup.loginWithCredentials({ - connection: 'Username-Password-Authentication', - username: 'testuser', - password: 'testpass', - scope: 'openid' - }); + // Redirect to url + // ... ``` -<%= include('../../_includes/_http-method', { - "http_badge": "badge-primary", - "http_method": "GET", - "path": "/authorize", - "link": "#enterprise-saml-and-others-" -}) %> - -Use this endpoint for passive authentication. It returns a `302` redirect to the SAML Provider (or Windows Azure AD and the rest, as specified in the `connection`) to enter their credentials. +You can connect your Auth0 service to an enterprise identity provider and allow your users to log in to your application via Microsoft Azure Active Directory, Google Workspace, Okta Workforce, or other supported providers. To learn more about supported providers, visit [Auth0 Marketplace](https://marketplace.auth0.com/features/enterprise-connections). +Make a `GET` call to the `/authorize` endpoint for passive authentication. It returns a `302` redirect to the SAML Provider (or Windows Azure AD and the rest, as specified in the `connection`) to enter their credentials. ### Request Parameters | Parameter | Description | |:-----------------|:------------| -| `response_type`
    Required | Use `code` for server side flows, `token` for application side flows. | +| `response_type`
    Required | Specifies the token type. Use `code` for server side flows, `token` for application side flows. | | `client_id`
    Required | The `client_id` of your application. | | `connection` | The name of the connection configured to your application. If null, it will redirect to the [Auth0 Login Page](https://${account.namespace}/login) and show the Login Widget using the first database connection. | -| `redirect_uri`
    Required | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | +| `redirect_uri`
    Required | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. Specify the `redirect_uri` under your [Application's Settings](${manage_url}/#/applications).| | `state`
    Recommended | An opaque value the applications adds to the initial request that the authorization server includes when redirecting the back to the application. This value must be used by the application to prevent CSRF attacks. | +### Remarks -### Test with Authentication API Debugger +- If no `connection` is specified, it will redirect to the [Login Page](https://${account.namespace}/login) and show the Login Widget. +- If `response_type=token`, after the user authenticates, it will redirect to your application `callback URL` passing the Access Token and ID Token in the address `location.hash`. This is used for Single-Page Apps and also on Native Mobile SDKs. +- Additional parameters can be sent that will be passed to the provider. +- The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). -<%= include('../../_includes/_test-this-endpoint') %> +### Learn More -1. At the *Configuration* tab, set the fields **Application** (select the application you want to use for the test) and **Connection** (the name of the social connection to use). +- [SAML](/protocols/saml) +- [Obtain a Client Id and Client Secret for Microsoft Azure Active Directory](/connections/enterprise/azure-active-directory) +- [State Parameter](/protocols/oauth2/oauth-state) +- [Auth0.js /authorize Method Reference](/libraries/auth0js#webauth-authorize-) -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). +## Back-Channel Login -1. At the *OAuth2 / OIDC* tab, click **OAuth2 / OIDC Login**. +:::note +This feature is currently in Early Access. To request access, contact your Technical Account Manager. +::: +The Back-Channel Login endpoint enables applications to send an authentication request to a user’s phone, or the authentication device, provided they have an app installed and are enrolled for [push notifications using the Guardian SDK](/secure/multi-factor-authentication/auth0-guardian#enroll-in-push-notifications). + +Use the Back-Channel Login endpoint to authenticate users for the following use cases: + +- Users are not in front of the application that requires authentication, such as when they're telephoning a call center. +- The consumption device, or the device that helps the user consume a service, is insecure for sensitive operations e.g. web browser for financial transactions. +- The consumption device has limited interactive capability e.g. e-bicycles or e-scooters. + +<%= include('../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "POST", + "path": "/bc-authorize", + "link": "#back-channel-login" +}) %> + +```http +curl --location 'https://[TENANT_DOMAIN]/bc-authorize' \ +--header 'Content-Type: application/x-www-form-urlencoded' \ +--data-urlencode 'client_id=[CLIENT ID]' \ +--data-urlencode 'client_secret=[CLIENT SECRET]' \ +--data-urlencode 'binding_message=[YOUR BINDING MESSAGE]' \ +--data-urlencode 'login_hint={ "format": "iss_sub", "iss": +"https://[TENANT].auth0.com/", "sub": "auth0|[USER ID]" }' \ +--data-urlencode 'scope=openid' +``` + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `client_id`
    Required | Client ID of your application. | +| `binding_message`
    Required | Human-readable string displayed on both the device calling `/bc-authorize` and the user’s authentication device (e.g. phone) to ensure the user is approves the correct request. For example: `ABC-123-XYZ`. | +| `login_hint`
    Required | String containing information about the user to contact for authentication. It uses the [IETF9493 standard for Subject Identifiers for Security Event Tokens](https://datatracker.ietf.org/doc/html/rfc9493). Auth0 only supports the [Issuer and Identifier format](https://datatracker.ietf.org/doc/html/rfc9493#name-issuer-and-subject-identifi). For an example login hint, review the [Remarks](#remarks). | +| `scope`
    Required | Space-separated list of OIDC and custom API scopes. For example: `openid read:timesheets edit:timesheets`. Include `offline_access` to get a refresh token. At a minimum, you must include the scope `openid`. | +| `audience`
    Optional | Unique identifier of the audience for an issued token. If you require an access token for an API, pass the unique identifier of the target API you want to access. | +| `request_expiry`
    Optional | To configure a custom expiry time in seconds for this request, pass a number between 1 and 300. If not provided, expiry defaults to 300 seconds. | + +### Response Body + +If the request is successful, you should receive a response like the following: + +```http +{ + "auth_req_id": "eyJh...", + "expires_in": 300, + "interval": 5 +} +``` + +The `auth_req_id` value should be kept as it is used later in the flow to identify the authentication request. + +The `expires_in` value tells you how many seconds you have until the authentication request expires. + +The `interval` value tells you how many seconds you must wait between poll requests. + +The request should be approved or rejected on the user’s authentication device using the Guardian SDK. ### Remarks -- If no `connection` is specified, it will redirect to the [Login Page](https://${account.namespace}/login) and show the Login Widget. -- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). -- If `response_type=token`, after the user authenticates, it will redirect to your application `callback URL` passing the Access Token and ID Token in the address `location.hash`. This is used for Single Page Apps and also on Native Mobile SDKs. -- Additional parameters can be sent that will be passed to the provider. -- The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). -- In order to use `loginWithCredentials`, auth0.js needs to make cross-origin calls. Check the [Cross-Origin Authentication](/cross-origin-authentication) article to understand the limitations of this approach. +The following code sample is an example login hint: -### More Information + ```http + { + "format": "iss_sub", + "iss": "https://[TENANT_DOMAIN]/", + "sub": "auth0|[USER ID]" + } + ``` -- [SAML](/protocols/saml) -- [Obtain a Client Id and Client Secret for Microsoft Azure Active Directory](/connections/enterprise/azure-active-directory) -- [Using the State Parameter](/protocols/oauth2/oauth-state) -- [Auth0.js /authorize Method Reference](/libraries/auth0js#webauth-authorize-) +White space is not significant. Replace the `[TENANT_DOMAIN]` with your tenant domain or custom domain. Replace the `[USER ID]` with a valid `user_id` for the authorizing user returned from the [User Search APIs](https://auth0.com/docs/manage-users/user-search). + +Include an optional parameter for application authentication in the request: + +- Client Secret with HTTP Basic auth, in which case no parameters are required. The `client_id` and `client_secret` are passed in a header. +- Client Secret Post, in which case the `client_id` and `client_secret` are required. +- Private Key JWT, where the `client_id`, `client_assertion` and `client_assertion` type are required. +- mTLS, where the `client_id` parameter is required and the `client-certificate` and `client-certificate-ca-verified` headers are required. + +<%= include('../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "POST", + "path": "/oauth/token", + "link": "#post-token" +}) %> + +```http +curl --location 'https://[TENANT_DOMAIN]/oauth/token' \ +--header 'Content-Type: application/x-www-form-urlencoded' \ +--data-urlencode 'client_id=[CLIENT ID]' \ +--data-urlencode 'client_secret=[CLIENT SECRET]' \ +--data-urlencode 'auth_req_id=[FROM THE BC-AUTHORIZE RESPONSE]' \ +--data-urlencode 'grant_type=urn:openid:params:grant-type:ciba' +``` + +To check on the status of a Back-Channel Login flow, poll the `/oauth/token` endpoint at regular intervals by passing the following: + +- `auth_req_id` returned from the call to `/bc-authorize` +- `urn:openid:params:grant-type:ciba` grant type + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `client_id`
    Required | Client ID of your application | +| `auth_req_id`
    Required | Used to reference the authentication request. Returned from the call to `/bc-authorize` | +| `grant_type`
    Required | Must be set to `urn:openid:params:grant-type:ciba` | + +### Response Body + +If the authorizing user has not yet approved or rejected the request, you should receive a response like the following: + +```http +{ + "error": "authorization_pending", + "error_description": "The end-user authorization is pending" +} +``` + +If the authorizing user rejects the request, you should receive a response like the following: + +```http +{ + "error": "access_denied", + "error_description": "The end-user denied the authorization request or it +has been expired" +} +``` + +If you are polling too quickly (faster than the interval value returned from `/bc-authorize`), you should receive a response like the following: + +```http +{ + "error": "slow_down", + "error_description": "You are polling faster than allowed. Try again in 10 seconds." +} +``` + +In addition, Auth0 will add the the [Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header to the response indicating how many seconds to wait before attempting to poll again. If you consistently poll too frequently, the number of seconds you must wait increases. + +If the authorizing user has approved the push notification, the call returns the ID token and access token (and potentially a refresh token): + +```http +{ + "access_token": "eyJh...", + "id_token": "eyJh...", + "expires_in": 86400, + "scope": "openid" +} +``` + +Once you have exchanged an `auth_req_id` for an ID or access token, it is no longer usable. + +### Remarks + +Include an optional parameter for application authentication in the request: + +- Client Secret with HTTP Basic auth, in which case no parameters are required. The `client_id` and `client_secret` are passed in a header. +- Client Secret Post, in which case the `client_id` and `client_secret` are required. +- Private Key JWT, where the `client_id`, `client_assertion` and `client_assertion` type are required. +- mTLS, where the `client_id` parameter is required and the `client-certificate` and `client-certificate-ca-verified` headers are required. \ No newline at end of file diff --git a/articles/api/authentication/_logout.md b/articles/api/authentication/_logout.md index b70f77b01f..930bf1a337 100644 --- a/articles/api/authentication/_logout.md +++ b/articles/api/authentication/_logout.md @@ -1,4 +1,13 @@ + # Logout +## Auth0 Logout + +<%= include('../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "GET", + "path": "/v2/logout", + "link": "#logout" +}) %> ```http GET https://${account.namespace}/v2/logout? @@ -30,43 +39,158 @@ curl --request GET \ ``` +Use this endpoint to logout a user. If you want to navigate the user to a specific URL after the logout, set that URL at the `returnTo` parameter. The URL should be included in any the appropriate `Allowed Logout URLs` list: +- If the `client_id` parameter is included, the `returnTo` URL must be listed in the `Allowed Logout URLs` set at the application level. To learn more, read [Log Users Out of Applications](/authenticate/login/logout/log-users-out-of-applications). +- If the `client_id` parameter is NOT included, the `returnTo` URL must be listed in the `Allowed Logout URLs` set at the tenant level. To learn more, read [Log Users Out of Auth0](/authenticate/login/logout/log-users-out-of-auth0). +- If the `client_id` parameter is included and the `returnTo` URL is NOT set, the server returns the user to the first Allowed Logout URLs set in the Dashboard. To learn more, read [Log Users Out of Applications](/authenticate/login/logout/log-users-out-of-applications). + + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `returnTo` | URL to redirect the user after the logout. | +| `client_id` | The `client_id` of your application. | +| `federated` | Add this query string parameter to the logout URL, to log the user out of their identity provider, as well: `https://${account.namespace}/v2/logout?federated`. | + +### Remarks + +- Logging the user out of their identity provider is not common practice, so think about the user experience before you use the `federated` query string parameter. +- The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). + +### Learn More + +- [Logout](/logout) + +## OIDC Logout <%= include('../../_includes/_http-method', { "http_badge": "badge-primary", "http_method": "GET", - "path": "/v2/logout", + "path": "/oidc/logout", "link": "#logout" }) %> -Use this endpoint to logout a user. If you want to navigate the user to a specific URL after the logout, set that URL at the `returnTo` parameter. The URL should be included in any the appropriate `Allowed Logout URLs` list: -- If the `client_id` parameter is included, the `returnTo` URL must be listed in the `Allowed Logout URLs` set at the application level (see [Setting Allowed Logout URLs at the App Level](/logout#set-the-allowed-logout-urls-at-the-application-level)). -- If the `client_id` parameter is NOT included, the `returnTo` URL must be listed in the `Allowed Logout URLs` set at the tenant level (see [Setting Allowed Logout URLs at the Tenant Level](/logout#set-the-allowed-logout-urls-at-the-tenant-level)). +```http +GET https://${account.namespace}/oidc/logout? + post_logout_redirect_uri=LOGOUT_URL& + id_token_hint=ID_TOKEN_HINT +``` + +```shell +curl --request GET \ + --url 'https://${account.namespace}/oidc/logout' \ + --header 'content-type: application/json' \ + --data-raw ' + { + "client_id":"${account.clientId}", + "post_logout_redirect_uri":"LOGOUT_URL", + "id_token_hint":"ID_TOKEN_HINT" + }' +``` + +```javascript +// Script uses auth0.js. See Remarks for details. + + +``` + +Use this endpoint to logout a user. If you want to navigate the user to a specific URL after the logout, set that URL at the `post_logout_redirect_uri` parameter. The URL should be included in the appropriate `Allowed Logout URLs` list: + +- If the `id_token_hint` parameter is included: + - When the `client_id` parameter is included, the server uses the URL from the `aud` claim in the `id_token_hint` to select which of the `Allowed Logout URLs` to use from the application specified by the `client_id`. + - When the `client_id` parameter is NOT included, the server uses the URL from the `aud` claim in the `id_token_hint` to select which of the `Allowed Logout URLs` at the tenant level to use. +- If the `id_token_hint` parameter is not included: + - If the `client_id` parameter is included, the `post_logout_redirect_uri` URL must be listed in the `Allowed Logout URLs` set at the application level. + - If the `client_id` parameter is NOT included, the `post_logout_redirect_uri` URL must be listed in the `Allowed Logout URLs` set at the tenant level. + - If the `client_id` parameter is included and the `post_logout_redirect_uri` URL is NOT set, the server returns the user to the first `Allowed Logout URLs` set in Auth0 Dashboard. + + To learn more, read [Log Users Out of Auth0 with OIDC Endpoint](/authenticate/login/logout/log-users-out-of-auth0). ### Request Parameters -| Parameter | Description | -|:-----------------|:------------| -| `returnTo ` | URL to redirect the user after the logout. | -| `client_id` | The `client_id` of your application. | -| `federated` | Add this querystring parameter to the logout URL, to log the user out of their identity provider, as well: `https://${account.namespace}/v2/logout?federated`. | +| Parameter | Description | +| :------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id_token_hint`
    Recommended | Previously issued ID Token for the user. This is used to indicate which user to log out. | +| `logout_hint`
    Optional | Optional `sid` (session ID) value to indicate which user to log out. Should be provided when `id_token_hint` is not available. | +| `post_logout_redirect_uri`
    Optional | URL to redirect the user after the logout. | +| `client_id`
    Optional | The `client_id` of your application. | +| `federated`
    Optional | Add this query string parameter to log the user out of their identity provider: `https://YOUR_DOMAIN/oidc/logout?federated`. | +| `state`
    Optional | An opaque value the applications adds to the initial request that the authorization server includes when redirecting the back to the`post_logout_redirect_uri`. | +| `ui_locales`
    Optional | Space-delimited list of locales used to constrain the language list for the request. The first locale on the list must match the enabled locale in your tenant | +### Remarks -### Test with Authentication API Debugger +- Logging the user out of their social identity provider is not common practice, so think about the user experience before you use the `federated` query string parameter with social identity providers. +- If providing both `id_token_hint` and `logout_hint`, the `logout_hint` value must match the `sid` claim from the id_token_hint. +- If providing both `id_token_hint` and `client_id`, the `client_id` value must match the `aud` claim from the `id_token_hint`. +- If `id_token_hint` is not provided, then the user will be prompted for consent unless a `logout_hint` that matches the user's session ID is provided. +- The `POST` HTTP method is also supported for this request. When using `POST`, the request parameters should be provided in the request body as form parameters instead of the query string. The federated parameter requires a value of `true` or `false`. +- This conforms to the [OIDC RP-initiated Logout Specification](https://openid.net/specs/openid-connect-rpinitiated-1_0.html). -<%= include('../../_includes/_test-this-endpoint') %> +### Learn More -1. At the *Configuration* tab, set the fields **Application** (select the application you want to use for the test) and **Connection** (the name of the social connection to use). +- [Logout](/logout) +- [Use the OIDC Endpoint to Log Users Out of Auth0](/logout/log-users-out-of-auth0) +- [OIDC RP-initiated Logout Specification](https://openid.net/specs/openid-connect-rpinitiated-1_0.html) -1. Copy the **Callback URL** and set it as part of the **Allowed Logout URLs** of your [Application Settings](${manage_url}/#/applications). +## SAML Logout -1. At the *Other Flows* tab, click **Logout**, or **Logout (Federated)** to log the user out of the identity provider as well. +```http +POST https://${account.namespace}/samlp/CLIENT_ID/logout +``` +```shell +curl --request POST \ + --url 'https://${account.namespace}/samlp/CLIENT_ID/logout' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data '{SAML_LOGOUT_REQUEST}' +``` -### Remarks +Use this endpoint to log out a user from an Auth0 tenant configured as a SAML identity provider (IdP). -- Logging the user out of their identity provider is not common practice, so think about the user experience before you use the `federated` querystring parameter. -- The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). +Logout behavior is determined by the configuration of the SAML2 Web App addon for the application on the Auth0 tenant acting as the SAML IdP. To learn more, read [Log Users Out of SAML Identity Providers](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-saml-idps#configure-slo-when-auth0-is-the-saml-idp). -### More Information +### Request Parameters +| Parameter | Description | +|:--|:--| +| `CLIENT_ID` | Client ID of your application configured with the [SAML2 Web App addon](https://auth0.com/docs/authenticate/protocols/saml/saml-sso-integrations/enable-saml2-web-app-addon). | +| `SAML_LOGOUT_REQUEST` | SAML `` message. | + +### Remarks +- The POST body must contain a valid SAML `` message. To learn more, read [Assertions and Protocols for the OASIS Security Assertion Markup Language (SAML) V2.0 on Oasis](https://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf). + +### Learn More - [Logout](/logout) +- [Log Users Out of SAML Identity Providers](https://auth0.com/docs/authenticate/login/logout/log-users-out-of-saml-idps) + +## Global Token Revocation +<%= include('../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "POST", + "path": "/oauth/global-token-revocation/connection/YourConnectionName", + "link": "#logout" +}) %> + +Use this endpoint with the [Okta Workforce Identity Cloud Universal Logout](https://developer.okta.com/docs/guides/oin-universal-logout-overview/) to log users out of your applications. To learn more, read [Universal Logout](https://auth0.com/docs/authenticate/login/logout/universal-logout). + +### Request Parameters +| Parameter | Description | +| :-- | :-- | +| `subject` | `{ "format": "iss_sub", "iss": "https://issuer.example.com/", "sub": "145234573" }` | + +### Remarks +- A request to this endpoint revokes sessions cookies and refresh tokens, but not access tokens. +- You must authenticate at the endpoint before revoking user sessions. Review [Endpoint Authentication](https://developer.okta.com/docs/guides/oin-universal-logout-overview/#endpoint-authentication). diff --git a/articles/api/authentication/_multifactor-authentication.md b/articles/api/authentication/_multifactor-authentication.md index 6297df92bf..32c6a59802 100644 --- a/articles/api/authentication/_multifactor-authentication.md +++ b/articles/api/authentication/_multifactor-authentication.md @@ -1,18 +1,18 @@ # Multi-factor Authentication -The Multi-factor Authentication (MFA) API endpoints allow you to enforce MFA when users interact with [the Token endpoints](#get-token), as well as enroll and manage user authenticators. +The Multi-factor Authentication (MFA) API endpoints allow you to enforce MFA when users interact with [the Token endpoints](#get-token), as well as enroll and manage user authenticators. First, request a challenge based on the challenge types supported by the application and user. If you know that one-time password (OTP) is supported, you can skip the challenge request. Next, verify the multi-factor authentication using the `/oauth/token` endpoint and the specified challenge type: a one-time password (OTP), a recovery code, or an out-of-band (OOB) challenge. -For more information, check out: +To learn more, read: -- [Multi-factor Authentication and Resource Owner Password](/api-auth/tutorials/multifactor-resource-owner-password) -- [Multi-factor Authentication API](/multifactor-authentication/api) -- [Multi-factor Authentication in Auth0](/multifactor-authentication) +- [Multi-factor Authentication and Resource Owner Password](/mfa/guides/mfa-api/multifactor-resource-owner-password) +- [Multi-factor Authentication API](/mfa/concepts/mfa-api) +- [Multi-factor Authentication in Auth0](/mfa) -## Challenge request +## Challenge Request ```http POST https://${account.namespace}/mfa/challenge @@ -62,6 +62,7 @@ Content-Type: application/json ``` > RESPONSE SAMPLE FOR OOB WITHOUT BINDING METHOD: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -72,6 +73,7 @@ Content-Type: application/json ``` > RESPONSE SAMPLE FOR OOB WITH BINDING METHOD: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -82,19 +84,12 @@ Content-Type: application/json } ``` -<%= include('../../_includes/_http-method', { - "http_badge": "badge-success", - "http_method": "POST", - "path": "/mfa/challenge", - "link": "#multifactor-authentication" -}) %> - -Request a challenge based on the challenge types supported by the application and user. +Request a challenge for multi-factor authentication (MFA) based on the challenge types supported by the application and user. The `challenge_type` is how the user will get the challenge and prove possession. Supported challenge types include: - `otp`: for one-time password (OTP) -- `oob`: for SMS messages or out-of-band (OOB) +- `oob`: for SMS/Voice messages or out-of-band (OOB) If OTP is supported by the user and you don't want to request a different factor, you can skip the challenge request and [verify the multi-factor authentication with a one-time password](#verify-with-one-time-password-otp-). @@ -104,10 +99,11 @@ If OTP is supported by the user and you don't want to request a different factor |:-----------------|:------------| | `mfa_token`
    Required | The token received from `mfa_required` error. | | `client_id`
    Required | Your application's Client ID. | -| `client_secret` | Your application's Client Secret. **Required** when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | +| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is your application authentication method.| +| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.| +| `client_secret` | Your application's Client Secret. Required when the Token Endpoint Authentication Method field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | | `challenge_type` | A whitespace-separated list of the challenges types accepted by your application. Accepted challenge types are `oob` or `otp`. Excluding this parameter means that your client application accepts all supported challenge types. | -| `oob_channel` | **(early access users only)** The channel to use for OOB. Can only be provided when `challenge_type` is `oob`. Accepted channel types are `sms` or `auth0`. Excluding this parameter means that your client application will accept all supported OOB channels. | -| `authenticator_id` | **(early access users only)** The ID of the authenticator to challenge. You can get the ID by querying the list of available authenticators for the user as explained on [List authenticators](#list-authenticators) below. | +| `authenticator_id` | The ID of the authenticator to challenge. You can get the ID by querying the list of available authenticators for the user as explained on [List authenticators](#list-authenticators) below. | ### Remarks @@ -115,31 +111,27 @@ If OTP is supported by the user and you don't want to request a different factor - Auth0 chooses the challenge type based on the application's supported types and types the user is enrolled with. - An `unsupported_challenge_type` error is returned if your application does not support any of the challenge types the user has enrolled with. - An `unsupported_challenge_type` error is returned if the user is not enrolled. -- **(early access only)** If the user is not enrolled, you will get a `association_required` error, indicating the user needs to enroll to use MFA. Check [Add an authenticator](#add-an-authenticator) below on how to proceed. +- If the user is not enrolled, you will get a `association_required` error, indicating the user needs to enroll to use MFA. Read [Add an authenticator](#add-an-authenticator) below on how to proceed. -### More information +### Learn More -- [Trigger MFA using the API](/multifactor-authentication/api/challenges) +* [Authenticate With Resource Owner Password Grant and MFA](/mfa/guides/mfa-api/authenticate) +* [Manage Authenticator Factors using the MFA API](/mfa/guides/mfa-api/manage) -## Verify with one-time password (OTP) +## Verify with One-Time Password (OTP) ```http POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET", - "mfa_token": "MFA_TOKEN", - "grant_type": "http://auth0.com/oauth/grant-type/mfa-otp", - "otp": "OTP_CODE" -} +Content-Type: application/x-www-form-urlencoded + +client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&mfa_token=MFA_TOKEN&grant_type=http%3A%2F%2Fauth0.com%2Foauth%2Fgrant-type%2Fmfa-otp&otp=OTP_CODE ``` ```shell curl --request POST \ --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"mfa_token":"MFA_TOKEN", "otp":"OTP_CODE", "grant_type": "http://auth0.com/oauth/grant-type/mfa-otp", "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET"}' + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'mfa_token=MFA_TOKEN&otp=OTP_CODE&grant_type=http://auth0.com/oauth/grant-type/mfa-otp&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET' ``` ```javascript @@ -147,14 +139,14 @@ var request = require("request"); var options = { method: 'POST', url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: { mfa_token: 'MFA_TOKEN', otp: 'OTP_CODE', grant_type: 'http://auth0.com/oauth/grant-type/mfa-otp', client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; + client_secret: 'YOUR_CLIENT_SECRET' } + }; request(options, function (error, response, body) { if (error) throw new Error(error); @@ -164,6 +156,7 @@ request(options, function (error, response, body) { ``` > RESPONSE SAMPLE FOR OTP: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -181,7 +174,7 @@ Content-Type: application/json "link": "#multifactor-authentication" }) %> -Verifies multi-factor authentication (MFA) using a one-time password (OTP). +Verifies multi-factor authentication (MFA) using a one-time password (OTP). To verify MFA with an OTP, prompt the user to get the OTP code, then make a request to the `/oauth/token` endpoint. The request must have the OTP code, the `mfa_token` you received (from the `mfa_required` error), and the `grant_type` set to `http://auth0.com/oauth/grant-type/mfa-otp`. @@ -192,35 +185,31 @@ The response is the same as responses for `password` or `http://auth0.com/oauth/ | Parameter | Description | |:-----------------|:------------| | `grant_type`
    Required | Denotes the flow you are using. For OTP MFA use `http://auth0.com/oauth/grant-type/mfa-otp`. | -| `client_id`
    Required | Your application's Client ID. | -| `client_secret` | Your application's Client Secret. **Required** when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | +| `client_id` | Your application's Client ID. | +| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is your application authentication method.| +| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method. | +| `client_secret` | Your application's Client Secret. Required when the Token Endpoint Authentication Method field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | | `mfa_token`
    Required | The `mfa_token` you received from `mfa_required` error. | | `otp`
    Required | OTP Code provided by the user. | -### More information +### Learn More -- [Associate an OTP Authenticator](/multifactor-authentication/api/otp) +- [Associate OTP Authenticators](/mfa/guides/mfa-api/otp) -## Verify with out-of-band (OOB) +## Verify with Out-of-Band (OOB) ```http POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET", - "mfa_token": "MFA_TOKEN", - "grant_type": "http://auth0.com/oauth/grant-type/mfa-oob", - "oob_code": "OOB_CODE", - "binding_code": "BINDING_CODE" -} +Content-Type: application/x-www-form-urlencoded + +client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&mfa_token=MFA_TOKEN&grant_type=http%3A%2F%2Fauth0.com%2Foauth%2Fgrant-type%2Fmfa-oob&oob_code=OOB_CODE&binding_code=BINDING_CODE ``` ```shell curl --request POST \ --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"mfa_token":"MFA_TOKEN", "oob_code": "OOB_CODE", "binding_code": "BINDING_CODE", "grant_type": "http://auth0.com/oauth/grant-type/mfa-oob", "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET"}' + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&mfa_token=MFA_TOKEN&grant_type=http://auth0.com/oauth/grant-type/mfa-oob&oob_code=OOB_CODE&binding_code=BINDING_CODE' ``` ```javascript @@ -228,15 +217,15 @@ var request = require("request"); var options = { method: 'POST', url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: { mfa_token: 'MFA_TOKEN', oob_code: "OOB_CODE", binding_code: "BINDING_CODE" grant_type: 'http://auth0.com/oauth/grant-type/mfa-oob', client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; + client_secret: 'YOUR_CLIENT_SECRET' } + }; request(options, function (error, response, body) { if (error) throw new Error(error); @@ -246,6 +235,7 @@ request(options, function (error, response, body) { ``` > RESPONSE SAMPLE FOR PENDING CHALLENGE: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -256,6 +246,7 @@ Content-Type: application/json ``` > RESPONSE SAMPLE FOR VERIFIED CHALLENGE: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -267,6 +258,7 @@ Content-Type: application/json ``` > RESPONSE SAMPLE FOR REJECTED CHALLENGE: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -283,7 +275,7 @@ Content-Type: application/json "link": "#multifactor-authentication" }) %> -Verifies multi-factor authentication (MFA) using an out-of-band (OOB) challenge (either Push notification or SMS). +Verifies multi-factor authentication (MFA) using an out-of-band (OOB) challenge (either Push notification, SMS, or Voice). To verify MFA using an OOB challenge, your application must make a request to `/oauth/token` with `grant_type=http://auth0.com/oauth/grant-type/mfa-oob`. Include the `oob_code` you received from the challenge response, as well as the `mfa_token` you received as part of `mfa_required` error. @@ -300,34 +292,31 @@ When the challenge response includes a `binding_method: prompt`, your app needs |:-----------------|:------------| | `grant_type`
    Required | Denotes the flow you are using. For OTP MFA, use `http://auth0.com/oauth/grant-type/mfa-oob`. | | `client_id`
    Required | Your application's Client ID. | -| `client_secret` | Your application's Client Secret. **Required** when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | +| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is your application authentication method.| +| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.| +| `client_secret` | Your application's Client Secret. Required when the Token Endpoint Authentication Method field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | | `mfa_token`
    Required | The `mfa_token` you received from `mfa_required` error. | | `oob_code`
    Required | The oob code received from the challenge request. | | `binding_code`| A code used to bind the side channel (used to deliver the challenge) with the main channel you are using to authenticate. This is usually an OTP-like code delivered as part of the challenge message. | -### More information +### Learn More -- [Associate an Out-of-Band Authenticator](/multifactor-authentication/api/oob) +- [Associate Out-of-Band Authenticators](/mfa/guides/mfa-api/oob) -## Verify with recovery code +## Verify with Recovery Code ```http POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET", - "mfa_token": "MFA_TOKEN", - "grant_type": "http://auth0.com/oauth/grant-type/mfa-recovery-code", - "recovery_code": "RECOVERY_CODE" -} +Content-Type: application/x-www-form-urlencoded + +client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&mfa_token=MFA_TOKEN&grant_type=http%3A%2F%2Fauth0.com%2Foauth%2Fgrant-type%2Fmfa-recovery-code&recovery_code=RECOVERY_CODE ``` ```shell curl --request POST \ --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"mfa_token":"MFA_TOKEN", "recovery_code":"RECOVERY_CODE", "grant_type": "http://auth0.com/oauth/grant-type/mfa-recovery-code", "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET"}' + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&mfa_token=MFA_TOKEN&grant_type=http://auth0.com/oauth/grant-type/mfa-recovery-code&recovery_code=RECOVERY_CODE' ``` ```javascript @@ -335,14 +324,14 @@ var request = require("request"); var options = { method: 'POST', url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: { mfa_token: 'MFA_TOKEN', recovery_code: 'RECOVERY_CODE', - grant_type: 'http://auth0.com/oauth/grant-type/mfa-recover-code', + grant_type: 'http://auth0.com/oauth/grant-type/mfa-recovery-code', client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; + client_secret: 'YOUR_CLIENT_SECRET' } + }; request(options, function (error, response, body) { if (error) throw new Error(error); @@ -352,6 +341,7 @@ request(options, function (error, response, body) { ``` > RESPONSE SAMPLE FOR OTP: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -370,7 +360,7 @@ Content-Type: application/json "link": "#multifactor-authentication" }) %> -Verifies multi-factor authentication (MFA) using a recovery code. +Verifies multi-factor authentication (MFA) using a recovery code. Some multi-factor authentication (MFA) providers (such as Guardian) support using a recovery code to login. Use this method to authenticate when the user's enrolled device is unavailable, or the user cannot receive the challenge or accept it due to connectivity issues. @@ -380,13 +370,15 @@ To verify MFA using a recovery code your app must prompt the user for the recove | Parameter | Description | |:-----------------|:------------| -| `grant_type`
    Required | Denotes the flow you are using. For OTP MFA use `http://auth0.com/oauth/grant-type/mfa-otp`. | +| `grant_type`
    Required | Denotes the flow you are using. For recovery code use `http://auth0.com/oauth/grant-type/mfa-recovery-code`. | | `client_id`
    Required | Your application's Client ID. | -| `client_secret` | Your application's Client Secret. **Required** when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | +| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is your application authentication method.| +| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.| +| `client_secret` | Your application's Client Secret. Required when the Token Endpoint Authentication Method field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | | `mfa_token`
    Required | The `mfa_token` you received from `mfa_required` error. | | `recovery_code`
    Required | Recovery code provided by the end-user. -## Add an authenticator +## Add an Authenticator ```http POST https://${account.namespace}/mfa/associate @@ -401,7 +393,6 @@ Authorization: Bearer ACCESS_TOKEN or MFA_TOKEN } ``` - ```shell curl --request POST \ --url 'https://${account.namespace}/mfa/associate' \ @@ -435,6 +426,7 @@ request(options, function (error, response, body) { ``` > RESPONSE SAMPLE FOR OOB (SMS channel): + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -442,12 +434,13 @@ Content-Type: application/json "oob_code": "Fe26.2**da6....", "binding_method":"prompt", "authenticator_type":"oob", - "oob_channel":"sms", + "oob_channels":"sms", "recovery_codes":["ABCDEFGDRFK75ABYR7PH8TJA"], } ``` > RESPONSE SAMPLE FOR OOB (Auth0 channel): + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -455,12 +448,13 @@ Content-Type: application/json "oob_code": "Fe26.2**da6....", "barcode_uri":"otpauth://...", "authenticator_type":"oob", - "oob_channel":"auth0", + "oob_channels":"auth0", "recovery_codes":["ABCDEFGDRFK75ABYR7PH8TJA"], } ``` > RESPONSE SAMPLE FOR OTP: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -478,17 +472,17 @@ Content-Type: application/json "link": "#multifactor-authentication" }) %> -Associates or adds a new authenticator for multi-factor authentication. +Associates or adds a new authenticator for multi-factor authentication (MFA). -If the user has active authenticators, an [Access Token](/tokens/access-token) with the `enroll` scope and the `audience` set to `https://${account.namespace}/mfa/` is required to use this endpoint. +If the user has active authenticators, an Access Token with the `enroll` scope and the `audience` set to `https://${account.namespace}/mfa/` is required to use this endpoint. -If the user has no active authenticators, you can use the `mfa_token` from the `mfa_required` error in place of an [Access Token](/tokens/access-token) for this request. +If the user has no active authenticators, you can use the `mfa_token` from the `mfa_required` error in place of an Access Token for this request. After an authenticator is added, it must be verified. To verify the authenticator, use the response values from the `/mfa/associate` request in place of the values returned from the `/mfa/challenge` endpoint and continue with the verification flow. A `recovery_codes` field is included in the response the first time an authenticator is added. You can use `recovery_codes` to pass multi-factor authentication as shown on [Verify with recovery code](#verify-with-recovery-code) above. -To access this endoint, you must set an [Access Token](/tokens/access-token) at the Authorization header, with the following claims: +To access this endpoint, you must set an Access Token at the Authorization header, with the following claims: - `scope`: `enroll` - `audience`: `https://${account.namespace}/mfa/` @@ -497,16 +491,18 @@ To access this endoint, you must set an [Access Token](/tokens/access-token) at | Parameter | Description | |:-----------------|:------------| | `client_id`
    Required | Your application's Client ID. | -| `client_secret` | Your application's Client Secret. **Required** when the **Token Endpoint Authentication Method** field in your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | +| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is your application authentication method.| +| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.| +| `client_secret` | Your application's Client Secret. Required when the Token Endpoint Authentication Method field in your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | | `authenticator_types`
    Required | The type of authenticators supported by the client. Value is an array with values `"otp"` or `"oob"`. | -| `oob_channel` | The type of OOB channels supported by the client. An array with values `"auth0"` or `"sms"`. Required if `authenticator_types` include `oob`. | -| `phone_number` | The phone number to use for SMS. Required if `oob_channel` includes `sms`. | +| `oob_channels` | The type of OOB channels supported by the client. An array with values `"auth0"`, `"sms"`, `"voice"`. Required if `authenticator_types` include `oob`. | +| `phone_number` | The phone number to use for SMS or Voice. Required if `oob_channels` includes `sms` or `voice`. | -### More information +### Learn More -- [Multi-factor Authentication API](/multifactor-authentication/api) +- [Multi-factor Authentication API](/mfa/concepts/mfa-api) -## List authenticators +## List Authenticators ```http GET https://${account.namespace}/mfa/authenticators @@ -540,6 +536,7 @@ request(options, function (error, response, body) { ``` > RESPONSE SAMPLE: + ```JSON HTTP/1.1 200 OK Content-Type: application/json @@ -552,21 +549,21 @@ Content-Type: application/json { "id":"sms|dev_gB342kcL2K22S4yB", "authenticator_type":"oob", - "oob_channel":"sms", + "oob_channels":"sms", "name":"+X XXXX1234", "active":true }, { "id":"sms|dev_gB342kcL2K22S4yB", "authenticator_type":"oob", - "oob_channel":"sms", + "oob_channels":"sms", "name":"+X XXXX1234", "active":false }, { "id":"push|dev_433sJ7Mcwj9P794y", "authenticator_type":"oob", - "oob_channel":"auth0", + "oob_channels":"auth0", "name":"John's Device", "active":true }, @@ -577,6 +574,7 @@ Content-Type: application/json } ] ``` + <%= include('../../_includes/_http-method', { "http_badge": "badge-primary", "http_method": "GET", @@ -586,7 +584,7 @@ Content-Type: application/json Returns a list of authenticators associated with your application. -To access this endoint you must set an [Access Token](/tokens/access-token) at the Authorization header, with the following claims: +To access this endpoint you must set an Access Token at the Authorization header, with the following claims: - `scope`: `read:authenticators` - `audience`: `https://${account.namespace}/mfa/` @@ -597,11 +595,11 @@ To access this endoint you must set an [Access Token](/tokens/access-token) at t | `ACCESS_TOKEN`
    Required | The Access Token obtained during login. | -#### More information +#### Learn More -- [Manage Authenticators: List Authenticators](/multifactor-authentication/api/manage#list-authenticators) +- [Manage Authenticators](/mfa/guides/mfa-api/manage) -## Delete an authenticator +## Delete an Authenticator ```http DELETE https://${account.namespace}/mfa/authenticators/AUTHENTICATOR_ID @@ -633,6 +631,7 @@ request(options, function (error, response, body) { ``` > RESPONSE SAMPLE: + ```JSON HTTP/1.1 204 OK ``` @@ -647,11 +646,10 @@ Deletes an associated authenticator using its ID. You can get authenticator IDs by [listing the authenticators](#list-authenticators). -To access this endpoint, you must set an [Access Token](/tokens/access-token) at the Authorization header, with the following claims: +To access this endpoint, you must set an Access Token at the Authorization header, with the following claims: - `scope`: `remove:authenticators` - `audience`: `https://${account.namespace}/mfa/` - ### Request Parameters | Parameter | Description | @@ -659,6 +657,6 @@ To access this endpoint, you must set an [Access Token](/tokens/access-token) at | `ACCESS_TOKEN`
    Required | The Access Token obtained during login. | | `AUTHENTICATOR_ID`
    Required | The ID of the authenticator to delete. -### More information +### Learn More -- [Manage Authenticators: Delete Authenticators](/multifactor-authentication/api/manage#delete-authenticators) +- [Manage Authenticators](/mfa/guides/mfa-api/manage) diff --git a/articles/api/authentication/_passwordless.md b/articles/api/authentication/_passwordless.md index 84ae2d1886..4cb6994684 100644 --- a/articles/api/authentication/_passwordless.md +++ b/articles/api/authentication/_passwordless.md @@ -2,7 +2,7 @@ # Passwordless -Passwordless connections do not require the user to remember a password. Instead, another mechanism is used to prove identity, such as a one-time code sent through email or SMS, every time the user logs in. +Passwordless connections do not require the user to remember a password. Instead, another mechanism is used to prove identity, such as a one-time code sent through email or SMS, every time the user logs in. ## Get Code or Link @@ -11,9 +11,10 @@ POST https://${account.namespace}/passwordless/start Content-Type: application/json { "client_id": "${account.clientId}", + "client_secret": "YOUR_CLIENT_SECRET", // for web applications "connection": "email|sms", - "email": "EMAIL", //set for connection=email - "phone_number": "PHONE_NUMBER", //set for connection=sms + "email": "USER_EMAIL", //set for connection=email + "phone_number": "USER_PHONE_NUMBER", //set for connection=sms "send": "link|code", //if left null defaults to link "authParams": { // any authentication parameters that you would like to add "scope": "openid", @@ -26,7 +27,7 @@ Content-Type: application/json curl --request POST \ --url 'https://${account.namespace}/passwordless/start' \ --header 'content-type: application/json' \ - --data '{"client_id":"${account.clientId}", "connection":"email|sms", "email":"EMAIL", "phone_number":"PHONE_NUMBER", "send":"link|code", "authParams":{"scope": "openid","state": "YOUR_STATE"}}' + --data '{"client_id":"${account.clientId}", "connection":"email|sms", "email":"USER_EMAIL", "phone_number":"USER_PHONE_NUMBER", "send":"link|code", "authParams":{"scope": "openid","state": "YOUR_STATE"}}' ``` ```javascript @@ -89,53 +90,54 @@ You have three options for [passwordless authentication](/connections/passwordle | Parameter | Description | |:-----------------|:------------| | `client_id`
    Required | The `client_id` of your application. | +| `client_assertion`
    | A JWT containing containing a signed assertion with your applications credentials. Required when Private Key JWT is your application authentication method. | +|`client_assertion_type`| Use the value `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.| +| `client_secret` | The `client_secret` of your application. Required when the Token Endpoint Authentication Method field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. Specifically required for Regular Web Applications **only**. | | `connection`
    Required | How to send the code/link to the user. Use `email` to send the code/link using email, or `sms` to use SMS. | | `email` | Set this to the user's email address, when `connection=email`. | | `phone_number` | Set this to the user's phone number, when `connection=sms`. | | `send` | Use `link` to send a link or `code` to send a verification code. If null, a link will be sent. | | `authParams` | Use this to append or override the link parameters (like `scope`, `redirect_uri`, `protocol`, `response_type`), when you send a link using email. | -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> ### Remarks -- If you sent a verification code, using either email or SMS, after you get the code, you have to authenticate the user using the [/oauth/ro endpoint](#authenticate-user), using `email` or `phone_number` as the `username`, and the verification code as the `password`. -- This endpoint is designed to be called from the client-side, and has a [rate limit](/policies/rate-limits#authentication-api) of 50 requests per hour per IP. +- If you sent a verification code, using either email or SMS, after you get the code, you have to authenticate the user using the [/passwordless/verify endpoint](#authenticate-user), using `email` or `phone_number` as the `username`, and the verification code as the `password`. +- This endpoint is designed to be called from the client-side, and is subject to [rate limits](/policies/rate-limit-policy/authentication-api-endpoint-rate-limits). - The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). ### Error Codes For the complete error code reference for this endpoint refer to [Errors > POST /passwordless/start](#post-passwordless-start). -### More Information +### Learn More - [Passwordless Authentication](/connections/passwordless) -- [Authenticate users with using Passwordless Authentication via Email](/connections/passwordless/email) -- [Authenticate users with a one-time code via SMS](/connections/passwordless/sms) -- [Passwordless FAQ](/connections/passwordless/faq) +- [Passwordless Best Practices](/connections/passwordless/best-practices) ## Authenticate User ```http -POST https://${account.namespace}/oauth/ro +POST https://${account.namespace}/oauth/token Content-Type: application/json { + "grant_type" : "http://auth0.com/oauth/grant-type/passwordless/otp", "client_id": "${account.clientId}", - "connection": "email|sms", - "grant_type": "password", - "username": "EMAIL|PHONE", //email or phone number - "password": "VERIFICATION_CODE", //the verification code - "scope": "SCOPE" + "client_secret": "YOUR_CLIENT_SECRET", // for web applications + "otp": "CODE", + "realm": "email|sms" //email or sms + "username":"USER_EMAIL|USER_PHONE_NUMBER", // depends on which realm you chose + "audience" : "API_IDENTIFIER", // in case you need an access token for a specific API + "scope": "SCOPE", + "redirect_uri": "REDIRECT_URI" } ``` ```shell curl --request POST \ - --url 'https://${account.namespace}/oauth/ro' \ + --url 'https://${account.namespace}/oauth/token' \ --header 'content-type: application/json' \ - --data '{"client_id":"${account.clientId}", "connection":"email|sms", "grant_type":"password", "username":"EMAIL|PHONE", "password":"VERIFICATION_CODE", "scope":"SCOPE"}' + --data '{"grant_type":"http://auth0.com/oauth/grant-type/passwordless/otp", "client_id":"${account.clientId}", "client_secret":"CLIENT_SECRET", "otp":"CODE", "realm":"email|sms", "username":"USER_EMAIL|USER_PHONE_NUMBER", "audience":"API_IDENTIFIER", "scope":"SCOPE", "redirect_uri": "REDIRECT_URI"}' ``` ```javascript @@ -183,55 +185,72 @@ curl --request POST \ <%= include('../../_includes/_http-method', { "http_badge": "badge-success", "http_method": "POST", - "path": "/oauth/ro", + "path": "/oauth/token", "link": "#authenticate-user" }) %> -::: warning -This feature is disabled by default for new tenants as of 8 June 2017. Please see [Application Grant Types](/applications/application-grant-types) for more information. -::: -Once you have a verification code, use this endpoint to login the user with their phone number/email and verification code. This is active authentication, so the user must enter the code in your app. +Once you have a verification code, use this endpoint to login the user with their phone number/email and verification code. ### Request Parameters | Parameter |Description | |:-----------------|:------------| +| `grant_type`
    Required | It should be `http://auth0.com/oauth/grant-type/passwordless/otp`. | | `client_id`
    Required | The `client_id` of your application. | -| `connection`
    Required | Use `sms` or `email` (should be the same as [POST /passwordless/start](#get-code-or-link)) | -| `grant_type`
    Required | Use `password` | -| `username`
    Required | The user's phone number if `connection=sms`, or the user's email if `connection=email`. | -| `password`
    Required | The user's verification code. | -| `scope` | Use `openid` to get an ID Token, or `openid profile email` to include also user profile information in the ID Token. | +| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is your application authentication method.| +| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.| +| `client_secret` | The `client_secret` of your application. Required** when the Token Endpoint Authentication Method field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. Specifically required for Regular Web Applications **only**. | +| `username`
    Required | The user's phone number if `realm=sms`, or the user's email if `realm=email`. | +| `realm`
    Required | Use `sms` or `email` (should be the same as [POST /passwordless/start](#get-code-or-link)) | +| `otp`
    Required | The user's verification code. | +| `audience` | API Identifier of the API for which you want to get an Access Token. | +| `scope` | Use `openid` to get an ID Token, or `openid profile email` to also include user profile information in the ID Token. | +| `redirect_uri`
    Required | A callback URL that has been registered with your application's **Allowed Callback URLs**. | + +### Error Codes -### Test with Postman +For the complete error code reference for this endpoint refer to [Standard Error Responses](#standard-error-responses). -<%= include('../../_includes/_test-with-postman') %> +### Learn More -### Test with Authentication API Debugger +- [Passwordless Authentication](/connections/passwordless) + +<%= include('../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/passwordless/verify", + "link": "#authenticate-user-legacy" +}) %> -<%= include('../../_includes/_test-this-endpoint') %> +::: warning +This feature is disabled by default for new tenants as of 8 June 2017. Please see [Application Grant Types](/applications/concepts/application-grant-types) for more information. +::: -1. At the *Configuration* tab, set the fields **Application** (select the application you want to use for the test) and **Connection** (use `sms` or `email`). +Once you have a verification code, use this endpoint to login the user with their phone number/email and verification code. This is active authentication, so the user must enter the code in your app. -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). +### Request Parameters -1. At the *OAuth2 / OIDC* tab, set **Username** to the user's phone number if `connection=sms`, or the user's email if `connection=email`, and **Password** to the user's verification code. Click **Resource Owner Endpoint**. +| Parameter |Description | +|:-----------------|:------------| +| `client_id`
    Required | The `client_id` of your application. | +| `connection`
    Required | Use `sms` or `email` (should be the same as [POST /passwordless/start](#get-code-or-link)) | +| `grant_type`
    Required | Use `password` | +| `username`
    Required | The user's phone number if `connection=sms`, or the user's email if `connection=email`. | +| `password`
    Required | The user's verification code. | +| `scope` | Use `openid` to get an ID Token, or `openid profile email` to include also user profile information in the ID Token. | ### Remarks -- The `profile` scope value requests access to the End-User's default profile Claims, which are: `name`, `family_name`, `given_name`, `middle_name`, `nickname`, `preferred_username`, `profile`, `picture`, `website`, `gender`, `birthdate`, `zoneinfo`, `locale`, and `updated_at`. +- The `profile` scope value requests access to the End-User's default profile Claims, which are: `name`, `family_name`, `given_name`, `middle_name`, `nickname`, `preferred_username`, `profile`, `picture`, `website`, `gender`, `birthdate`, `zoneinfo`, `locale`, and `updated_at`. - The `email` scope value requests access to the `email` and `email_verified` Claims. - The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). ### Error Codes -For the complete error code reference for this endpoint refer to [Errors > POST /oauth/ro](#post-oauth-ro). +For the complete error code reference for this endpoint refer to [Errors > POST /passwordless/verify](#post-passwordless-verify). -### More Information +### Learn More + +- [Passwordless Best Practices](/connections/passwordless/best-practices) -- [Passwordless Authentication](/connections/passwordless) -- [Authenticate users with using Passwordless Authentication via Email](/connections/passwordless/email) -- [Authenticate users with a one-time code via SMS](/connections/passwordless/sms) -- [Authenticate users with Touch ID](/connections/passwordless/ios-touch-id-swift) -- [Passwordless FAQ](/connections/passwordless/faq) diff --git a/articles/api/authentication/_saml-sso.md b/articles/api/authentication/_saml-sso.md index 0064d3325d..0769a51318 100644 --- a/articles/api/authentication/_saml-sso.md +++ b/articles/api/authentication/_saml-sso.md @@ -1,6 +1,6 @@ # SAML -The SAML protocol is used for 3rd party SaaS applications mostly, like Salesforce and Box. Auth0 supports SP and IDP Initiated Sign On. For more information refer to: [SAML](/protocols/saml). +The SAML protocol is used mostly for third-party SaaS applications, like Salesforce and Box. Auth0 supports Service Provider (SP) and Identity Provider (IDP) initiated Sign On. To learn more, see [SAML](/protocols/saml). ## Accept Request @@ -25,30 +25,28 @@ include('../../_includes/_http-method', { "link": "#accept-request" }) %> -Use this endpoint to accept a SAML request to initiate a login. +Use this endpoint to accept a SAML request to initiate a login. -Optionally, it accepts a connection parameter to login with a specific provider. If no connection is specified, the [Auth0 Login Page](/login_page) will be shown. +Optionally, you can include a `connection` parameter to log in with a specific provider. If no connection is specified, the [Auth0 Login Page](/authenticate/login/auth0-universal-login) will be shown. + +Optionally, SP-initiated login requests can include an `organization` parameter to authenticate users in the context of an organization. To learn more, see [Organizations](/organizations). ### Request Parameters | Parameter | Description | |:-----------------|:------------| -| `client_id`
    Required | The `client_id` of your application. | -| `connection` | The connection to use. | - - -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> +| `client_id`
    Required | Client ID of your application. | +| `connection` | Connection to use during login. | +| `organization` | Organization ID, if authenticating in the context of an organization. | ### Remarks - All the parameters of the SAML response can be modified with [Rules](/rules). -- The SAML request `AssertionConsumerServiceURL` will be used to `POST` back the assertion. It must match the application's `callback_URL`. +- The SAML request `AssertionConsumerServiceURL` will be used to `POST` back the assertion. It must match one of the application's `callback_URLs`. -### More Information +### Learn More - [SAML](/protocols/saml) ## Get Metadata @@ -71,7 +69,7 @@ include('../../_includes/_http-method', { "link": "#get-metadata" }) %> -This endpoint returns the SAML 2.0 metadata. +This endpoint returns the SAML 2.0 metadata. ### Request Parameters @@ -80,16 +78,11 @@ This endpoint returns the SAML 2.0 metadata. | `client_id`
    Required | The `client_id` of your application. | -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> - - -### More Information +### Learn More - [SAML](/protocols/saml) -## IdP-Initiated SSO Flow +## IdP-Initiated Single Sign-On (SSO) Flow ```http POST https://${account.namespace}/login/callback?connection=CONNECTION @@ -113,7 +106,7 @@ include('../../_includes/_http-method', { "link": "#idp-initiated-sso-flow" }) %> -This endpoint accepts an IdP-Initiated Sign On SAMLResponse from a SAML Identity Provider. The connection corresponding to the identity provider is specified in the querystring. The user will be redirected to the application that is specified in the SAML Provider IdP-Initiated Sign On section. +This endpoint accepts an IdP-Initiated Sign On SAMLResponse from a SAML Identity Provider. The connection corresponding to the identity provider is specified in the query string. The user will be redirected to the application that is specified in the SAML Provider IdP-Initiated Sign On section. ### Request Parameters @@ -123,17 +116,5 @@ This endpoint accepts an IdP-Initiated Sign On SAMLResponse from a SAML Identity | `connection`
    Required | The name of an identity provider configured to your application. | | `SAMLResponse`
    Required | An IdP-Initiated Sign On SAML Response. | - -### Test with Authentication API Debugger - -<%= include('../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the field **Application** (select the application you want to use for the test) and **Connection** (the name of the configured identity provider). - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *Other Flows* tab, click **SAML**. - - -### More Information +### Learn More - [SAML](/protocols/saml) diff --git a/articles/api/authentication/_sign-up.md b/articles/api/authentication/_sign-up.md index c00be0399f..46e637c7bd 100644 --- a/articles/api/authentication/_sign-up.md +++ b/articles/api/authentication/_sign-up.md @@ -1,4 +1,5 @@ # Signup + ```http POST https://${account.namespace}/dbconnections/signup @@ -8,6 +9,12 @@ Content-Type: application/json "email": "EMAIL", "password": "PASSWORD", "connection": "CONNECTION", + "username": "johndoe", + "given_name": "John", + "family_name": "Doe", + "name": "John Doe", + "nickname": "johnny", + "picture": "http://example.org/jdoe.png" "user_metadata": { plan: 'silver', team_id: 'a111' } } ``` @@ -16,7 +23,7 @@ Content-Type: application/json curl --request POST \ --url 'https://${account.namespace}/dbconnections/signup' \ --header 'content-type: application/json' \ - --data '{"client_id":"${account.clientId}", "email":"test.account@signup.com", "password":"PASSWORD", "connection":"CONNECTION", "user_metadata":{ "plan": "silver", "team_id": "a111" }}' + --data '{"client_id":"${account.clientId}", "email":"test.account@signup.com", "password":"PASSWORD", "connection":"CONNECTION", "username": "johndoe", "given_name": "John", "family_name": "Doe", "name": "John Doe", "nickname": "johnny", "picture": "http://example.org/jdoe.png", "user_metadata":{ "plan": "silver", "team_id": "a111" }}' ``` ```javascript @@ -33,6 +40,12 @@ curl --request POST \ connection: 'CONNECTION', email: 'EMAIL', password: 'PASSWORD', + username: "johndoe", + given_name: "John", + family_name: "Doe", + name: "John Doe", + nickname: "johnny", + picture: "http://example.org/jdoe.png", user_metadata: { plan: 'silver', team_id: 'a111' } }, function (err) { if (err) return alert('Something went wrong: ' + err.message); @@ -48,7 +61,12 @@ curl --request POST \ "_id": "58457fe6b27...", "email_verified": false, "email": "test.account@signup.com", - "user_metadata":{"plan":"silver","team_id":"a111"} + "username": "johndoe", + "given_name": "John", + "family_name": "Doe", + "name": "John Doe", + "nickname": "johnny", + "picture": "http://example.org/jdoe.png" } ``` @@ -59,7 +77,7 @@ curl --request POST \ "link": "#signup" }) %> -Given a user's credentials, and a `connection`, this endpoint will create a new user using active authentication. +Given a user's credentials and a `connection`, this endpoint creates a new user. This endpoint only works for database connections. @@ -68,24 +86,26 @@ This endpoint only works for database connections. | Parameter | Description | |:-----------------|:------------| -| `client_id`
    Required | The `client_id` of your client. | +| `client_id` | The `client_id` of your client. | | `email`
    Required | The user's email address. | | `password`
    Required | The user's desired password. | | `connection`
    Required | The name of the database configured to your client. | -| `user_metadata` | The [user metadata](/metadata) to be associated with the user. If set, the field must be an object containing no more than ten properties. Property names can have a maximum of 100 characters, and property values must be strings of no more than 500 characters. | - -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> +| `username` | The user's username. Only valid if the connection requires a username. | +| `given_name` | The user's given name(s). | +| `family_name` | The user's family name(s). | +| `name` | The user's full name. | +| `nickname` | The user's nickname. | +| `picture` | A URI pointing to the user's picture. | +| `user_metadata` | The [user metadata](/users/concepts/overview-user-metadata) to be associated with the user. If set, the field must be an object containing no more than ten properties. Property names can have a maximum of 100 characters, and property values must be strings of no more than 500 characters. | ### Remarks - The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). -### More Information +### Learn More - [Password Strength in Auth0 Database Connections](/connections/database/password-strength) - [Password Options in Auth0 Database Connections](/connections/database/password-options) - [Adding Username for Database Connections](/connections/database/require-username) -- [User Metadata](/metadata) +- [Metadata Overview](/users/concepts/overview-user-metadata) diff --git a/articles/api/authentication/_userinfo.md b/articles/api/authentication/_userinfo.md index ffdd408509..f21daa73ff 100644 --- a/articles/api/authentication/_userinfo.md +++ b/articles/api/authentication/_userinfo.md @@ -1,5 +1,4 @@ # User Profile - ## Get User Info ```http @@ -42,15 +41,28 @@ curl --request GET \ ```json { - "email_verified": false, - "email": "test.account@userinfo.com", - "updated_at": "2016-12-05T15:15:40.545Z", - "name": "test.account@userinfo.com", - "picture": "https://s.gravatar.com/avatar/dummy.png", - "user_id": "auth0|58454...", - "nickname": "test.account", - "created_at": "2016-12-05T11:16:59.640Z", - "sub": "auth0|58454..." + "sub": "248289761001", + "name": "Jane Josephine Doe", + "given_name": "Jane", + "family_name": "Doe", + "middle_name": "Josephine", + "nickname": "JJ", + "preferred_username": "j.doe", + "profile": "http://exampleco.com/janedoe", + "picture": "http://exampleco.com/janedoe/me.jpg", + "website": "http://exampleco.com", + "email": "janedoe@exampleco.com", + "email_verified": true, + "gender": "female", + "birthdate": "1972-03-31", + "zoneinfo": "America/Los_Angeles", + "locale": "en-US", + "phone_number": "+1 (111) 222-3434", + "phone_number_verified": false, + "address": { + "country": "us" + }, + "updated_at": "1556845729" } ``` @@ -61,9 +73,9 @@ curl --request GET \ "link": "#get-user-info" }) %> -Given the Auth0 [Access Token](/tokens/access-token) obtained during login, this endpoint returns a user's profile. +Given the Auth0 Access Token obtained during login, this endpoint returns a user's profile. -This endpoint will work only if `openid` was granted as a scope for the Access Token. +This endpoint will work only if `openid` was granted as a scope for the Access Token. The user profile information included in the response depends on the scopes requested. For example, a scope of just `openid` may return less information than a scope of `openid profile email`. ### Request Parameters @@ -71,26 +83,23 @@ This endpoint will work only if `openid` was granted as a scope for the Access T |:-----------------|:------------| | `access_token`
    Required | The Auth0 Access Token obtained during login. | -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> ### Remarks - The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](/libraries/auth0js/v7). -- The auth0.js `parseHash` method, requires that your tokens are signed with `RS256`, rather than `HS256`. For more information about this, check the [Auth0.js v8 Migration Guide](/libraries/auth0js/migration-guide#the-parsehash-method). -- If you want this endpoint to return `user_metadata` or other custom information, you can use [rules](/rules#copy-user-metadata-to-id-token). For more information refer to [User profile claims and scope](/api-auth/tutorials/adoption/scope-custom-claims). +- The auth0.js `parseHash` method, requires that your tokens are signed with `RS256`, rather than `HS256`. +- To return `user_metadata` or other custom information from this endpoint, add a custom claim to the ID token with an [Action](/secure/tokens/json-web-tokens/create-custom-claims#create-custom-claims). For more information refer to [User profile claims and scope](/api-auth/tutorials/adoption/scope-custom-claims). - This endpoint will return three HTTP Response Headers, that provide relevant data on its rate limits: - `X-RateLimit-Limit`: Number of requests allowed per minute. - `X-RateLimit-Remaining`: Number of requests available. Each new request reduces this number by 1. For each minute that passes, requests are added back, so this number increases by 1 each time. - `X-RateLimit-Reset`: Remaining time until the rate limit (`X-RateLimit-Limit`) resets. The value is in [UTC epoch seconds](https://en.wikipedia.org/wiki/Unix_time). - The `Email` claim returns a snapshot of the email at the time of login - Standard claims (other than `email`) return the latest value (unless the value comes from an external IdP) -- Custom claims return a snapshot of the value at the time of login +- Custom claims always returns the latest value of the claim - To access the most up-to-date values for the `email` or custom claims, you must get new tokens. You can log in using silent authentication (where the `prompt` parameter for your call to the [`authorize` endpoint](/api/authentication#authorization-code-grant) equals `none`) - To access the most up-to-date values for standard claims that were changed using an external IdP (for example, the user changed their email address in Facebook)., you must get new tokens. Log in again using the external IdP, but *not* with silent authentication. -### More Information +### Learn More - [Auth0.js v8 Reference: Extract the authResult and get user info](/libraries/auth0js#extract-the-authresult-and-get-user-info) diff --git a/articles/api/authentication/_wsfed-req.md b/articles/api/authentication/_wsfed-req.md index 0fce416098..c8e94025b2 100644 --- a/articles/api/authentication/_wsfed-req.md +++ b/articles/api/authentication/_wsfed-req.md @@ -1,5 +1,4 @@ # WS-Federation - ## Accept Request ```http @@ -30,24 +29,7 @@ This endpoint accepts a WS-Federation request to initiate a login. | `wtrealm` | Can be used in place of `client-id`. | | `whr` | The name of the connection (used to skip the login page). | | `wctx` | Your application's state. | -| `wreply` | The callback URL. | - - -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> - - -### Test with Authentication API Debugger - -<%= include('../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the field **Application** (select the application you want to use for the test) and **Connection** (the name of the configured identity provider). - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *Other Flows* tab, click **WS-Federation**. - +| `wreply` | The callback URL. | ### Remarks @@ -56,11 +38,9 @@ This endpoint accepts a WS-Federation request to initiate a login. - If this parameter does not begin with a urn, the `client.clientAliases` array is used for look-up. This can only be set with the [/api/v2/clients](/api/management/v2#!/Clients/get_clients) Management API. - The `whr` parameter is mapped to the connection like this: `urn:CONNECTION_NAME`. For example, `urn:google-oauth2` indicates login with Google. If there is no `whr` parameter included, the user will be directed to the [Auth0 Login Page](/login_page). - -### More Information +### Learn More - [WS-Federation](/protocols/ws-fed) - ## Get Metadata ```http @@ -83,12 +63,6 @@ include('../../_includes/_http-method', { This endpoint returns the WS-Federation metadata. - -### Test with Postman - -<%= include('../../_includes/_test-with-postman') %> - - -### More Information +### Learn More - [WS-Federation](/protocols/ws-fed) diff --git a/articles/api/authentication/api-authz/_auth-code-flow.md b/articles/api/authentication/api-authz/_auth-code-flow.md new file mode 100644 index 0000000000..2a3e3d4f27 --- /dev/null +++ b/articles/api/authentication/api-authz/_auth-code-flow.md @@ -0,0 +1,120 @@ +# Authorization Code Flow +## Authorize + +```http +GET https://${account.namespace}/authorize? + audience=API_IDENTIFIER& + scope=SCOPE& + response_type=code& + client_id=${account.clientId}& + redirect_uri=${account.callback}& + state=STATE +``` + +> RESPONSE SAMPLE + +```text +HTTP/1.1 302 Found +Location: ${account.callback}?code=AUTHORIZATION_CODE&state=STATE +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "GET", + "path": "/authorize", + "link": "#authorization-code-grant" +}) %> + +This is the OAuth 2.0 grant that regular web apps utilize in order to access an API. + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `audience`
    | The unique identifier of the target API you want to access. | +| `scope` | The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OpenID Connect (OIDC) scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | +| `response_type`
    Required | Indicates to Auth0 which OAuth 2.0 flow you want to use. Use `code` for Authorization Code Grant Flow. | +| `client_id`
    Required | Your application's ID. | +| `state`
    Recommended | An opaque value the application adds to the initial request that Auth0 includes when redirecting the back to the application. This value must be used by the application to prevent CSRF attacks. | +| `redirect_uri` | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | +| `connection` | The name of the connection configured to your application. | +| `prompt` | To initiate a [silent authentication](/api-auth/tutorials/silent-authentication) request, use `prompt=none` (To learn more, read the Remarks). | +| `organization` | ID of the [organization](/organizations) to use when authenticating a user. When not provided, if your application is configured to **Display Organization Prompt**, the user will be able to enter the organization name when authenticating. | +| `invitation` | Ticket ID of the organization invitation. When [inviting a member to an Organization](/organizations/invite-members), your application should handle invitation acceptance by forwarding the invitation and organization key-value pairs when the user accepts the invitation. | + +## Get Token + +```http +POST https://${account.namespace}/oauth/token +Content-Type: application/x-www-form-urlencoded + +grant_type=authorization_code&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&code=AUTHORIZATION_CODE&redirect_uri=${account.callback} +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/token' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'grant_type=authorization_code&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&code=AUTHORIZATION_CODE&redirect_uri=${account.callback}' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/token', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: + { grant_type: 'authorization_code', + client_id: '${account.clientId}', + client_secret: 'YOUR_CLIENT_SECRET', + code: 'AUTHORIZATION_CODE', + redirect_uri: '${account.callback}' } + }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "access_token":"eyJz93a...k4laUWw", + "refresh_token":"GEbRxBN...edjnXbL", + "id_token":"eyJ0XAi...4faeEoQ", + "token_type":"Bearer", + "expires_in":86400 +} +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/token", + "link": "#authorization-code" +}) %> + +This is the flow that regular web apps use to access an API. Use this endpoint to exchange an Authorization Code for a token. + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `grant_type`
    Required | Denotes the flow you are using. For Authorization Code, use `authorization_code`. | +| `client_id`
    Required | Your application's Client ID. | +| `client_secret`
    Required | Your application's Client Secret. | +| `code`
    Required | The Authorization Code received from the initial `/authorize` call. | +| `redirect_uri`| This is required only if it was set at the [GET /authorize](#authorization-code-grant) endpoint. The values from `/authorize` must match the value you set at `/oauth/token`. | + +### Learn More + +- [Authorization Code Flow](/flows/concepts/auth-code) +- [Call API Using the Authorization Code Flow](/flows/guides/auth-code/call-api-auth-code) +- [State Parameter](/protocols/oauth2/oauth-state) +- [Silent Authentication](/api-auth/tutorials/silent-authentication) \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_auth-code-pkce.md b/articles/api/authentication/api-authz/_auth-code-pkce.md new file mode 100644 index 0000000000..23edc9a190 --- /dev/null +++ b/articles/api/authentication/api-authz/_auth-code-pkce.md @@ -0,0 +1,126 @@ +# Authorization Code Flow with PKCE +## Authorize + +```http +GET https://${account.namespace}/authorize? + audience=API_IDENTIFIER& + scope=SCOPE& + response_type=code& + client_id=${account.clientId}& + redirect_uri=${account.callback}& + code_challenge=CODE_CHALLENGE& + code_challenge_method=S256 +``` + +> RESPONSE SAMPLE + +```text +HTTP/1.1 302 Found +Location: ${account.callback}?code=AUTHORIZATION_CODE +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "GET", + "path": "/authorize", + "link": "#authorization-code-grant-pkce-" +}) %> + +This is the OAuth 2.0 grant that mobile apps utilize in order to access an API. Before starting with this flow, you need to generate and store a `code_verifier`, and using that, generate a `code_challenge` that will be sent in the authorization request. + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `audience`
    | The unique identifier of the target API you want to access. | +| `scope` | The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OpenID Connect (OIDC) scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | +| `response_type`
    Required | Indicates to Auth0 which OAuth 2.0 Flow you want to perform. Use `code` for Authorization Code Grant (PKCE) Flow. | +| `client_id`
    Required | Your application's Client ID. | +| `state`
    Recommended | An opaque value the client adds to the initial request that Auth0 includes when redirecting back to the client. This value must be used by the client to prevent CSRF attacks. | +| `redirect_uri` | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | +| `code_challenge_method`
    Required | Method used to generate the challenge. The PKCE spec defines two methods, `S256` and `plain`, however, Auth0 supports only `S256` since the latter is discouraged. | +| `code_challenge`
    Required | Generated challenge from the `code_verifier`. | +| `connection` | The name of the connection configured to your application. | +| `prompt` | To initiate a [silent authentication](/api-auth/tutorials/silent-authentication) request, use `prompt=none` (To learn more, read the Remarks). | +| `organization` | ID of the [organization](/organizations) to use when authenticating a user. When not provided, if your application is configured to **Display Organization Prompt**, the user will be able to enter the organization name when authenticating. | +| `invitation` | Ticket ID of the organization invitation. When [inviting a member to an Organization](/organizations/invite-members), your application should handle invitation acceptance by forwarding the invitation and organization key-value pairs when the user accepts the invitation. | + +## Get Token +```http +POST https://${account.namespace}/oauth/token +Content-Type: application/x-www-form-urlencoded + +grant_type=authorization_code&client_id=${account.clientId}&code_verifier=CODE_VERIFIER&code=AUTHORIZATION_CODE&redirect_uri=${account.callback} +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/token' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'grant_type=authorization_code&client_id=${account.clientId}&code_verifier=CODE_VERIFIER&code=AUTHORIZATION_CODE&redirect_uri=${account.callback}' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/token', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: { + grant_type:"authorization_code", + client_id: "${account.clientId}", + code_verifier: "CODE_VERIFIER", + code: "AUTHORIZATION_CODE", + redirect_uri: "${account.callback}", } }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "access_token":"eyJz93a...k4laUWw", + "refresh_token":"GEbRxBN...edjnXbL", + "id_token":"eyJ0XAi...4faeEoQ", + "token_type":"Bearer", + "expires_in":86400 +} +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/token", + "link": "#authorization-code-pkce-" +}) %> + +This is the flow that mobile apps use to access an API. Use this endpoint to exchange an Authorization Code for a token. + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `grant_type`
    Required | Denotes the flow you are using. For Authorization Code (PKCE) use `authorization_code`. | +| `client_id`
    Required | Your application's Client ID. | +| `code`
    Required | The Authorization Code received from the initial `/authorize` call. | +| `code_verifier`
    Required | Cryptographically random key that was used to generate the `code_challenge` passed to `/authorize`. | +| `redirect_uri` | This is required only if it was set at the [GET /authorize](#authorization-code-grant-pkce-) endpoint. The values from `/authorize` must match the value you set at `/oauth/token`. | + +### Remarks + +- In order to improve compatibility for applications, Auth0 will now return profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID tokens or access tokens, they must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims) to avoid possible collisions with standard OIDC claims. +- Include `offline_access` to the `scope` request parameter to get a refresh token from [POST /oauth/token](#authorization-code-pkce-). Make sure that the **Allow Offline Access** field is enabled in the [API Settings](${manage_url}/#/apis). +- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). +- Silent authentication lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. When an Access Token has expired, silent authentication can be used to retrieve a new one without user interaction, assuming the user's Single Sign-on (SSO) session has not expired. + +### Learn More +- [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce) +- [Call API Using the Authorization Code Flow with PKCE](/flows/guides/auth-code-pkce/call-api-auth-code-pkce) +- [Silent Authentication](/api-auth/tutorials/silent-authentication) \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_authz-client.md b/articles/api/authentication/api-authz/_authz-client.md index e41cf8db28..4979eff892 100644 --- a/articles/api/authentication/api-authz/_authz-client.md +++ b/articles/api/authentication/api-authz/_authz-client.md @@ -2,227 +2,24 @@ To begin an OAuth 2.0 Authorization flow, your application should first send the user to the authorization URL. -The purpose of this call is to obtain consent from the user to invoke the API (specified in `audience`) and do certain things (specified in `scope`) on behalf of the user. Auth0 will authenticate the user and obtain consent, unless consent has been previously given. If you alter the value in `scope`, Auth0 will require consent to be given again. +## Authorize endpoint +The purpose of this call is to obtain consent from the user to invoke the API (specified in `audience`) and do certain things (specified in `scope`) on behalf of the user. Auth0 will authenticate the user and obtain consent, unless consent has been previously given. If you alter the value in `scope`, Auth0 will require consent to be given again. The OAuth 2.0 flows that require user authorization are: -- [Authorization Code Grant](/api-auth/grant/authorization-code) -- [Authorization Code Grant using Proof Key for Code Exchange (PKCE)](/api-auth/grant/authorization-code-pkce) -- [Implicit Grant](/api-auth/grant/implicit) +- [Authorization Code Flow](/flows/concepts/auth-code) +- [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce) +- [Implicit Flow](/flows/concepts/implicit) -On the other hand, the [Resource Owner Password Grant](/api-auth/grant/password) and [Client Credentials](/api-auth/grant/client-credentials) flows do not use this endpoint since there is no user authorization involved. Instead they invoke directly the `POST /oauth/token` endpoint to retrieve an Access Token. +The [Resource Owner Password Grant](/api-auth/grant/password) and [Client Credentials Flow](/flows/concepts/client-credentials) do not use this endpoint since there is no user authorization involved. Instead, they directly invoke the `POST /oauth/token` endpoint to retrieve an Access Token. -Based on the OAuth 2.0 flow you are implementing, the parameters slightly change. To determine which flow is best suited for your case refer to: [Which OAuth 2.0 flow should I use?](/api-auth/which-oauth-flow-to-use). +Based on the OAuth 2.0 flow you are implementing, the parameters slightly change. To determine which flow is best suited for your case, refer to: [Which OAuth 2.0 flow should I use?](/api-auth/which-oauth-flow-to-use). -## Authorization Code Grant +## Get Token +For token-based authentication, use the `oauth/token` endpoint to get an access token for your application to make authenticated calls to a secure API. Optionally, you can also retrieve an ID Token and a Refresh Token. ID Tokens contains user information in the form of scopes you application can extract to provide a better user experience. Refresh Tokens allow your application to request a new access token once the current token expires without interruping the user experience. To learn more, read [ID Tokens](https://auth0.com/docs/secure/tokens/id-tokens) and [Refresh Tokens](https://auth0.com/docs/secure/tokens/refresh-tokens). -```http -GET https://${account.namespace}/authorize? - audience=API_IDENTIFIER& - scope=SCOPE& - response_type=code& - client_id=${account.clientId}& - redirect_uri=${account.callback}& - state=STATE -``` - -> RESPONSE SAMPLE - -```text -HTTP/1.1 302 Found -Location: ${account.callback}?code=AUTHORIZATION_CODE&state=STATE -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-primary", - "http_method": "GET", - "path": "/authorize", - "link": "#authorization-code-grant" -}) %> - -This is the OAuth 2.0 grant that regular web apps utilize in order to access an API. - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `audience`
    | The unique identifier of the target API you want to access. | -| `scope` | The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | -| `response_type`
    Required | Indicates to Auth0 which OAuth 2.0 flow you want to perform. Use `code` for Authorization Code Grant Flow. | -| `client_id`
    Required | Your application's ID. | -| `state`
    Recommended | An opaque value the application adds to the initial request that Auth0 includes when redirecting the back to the application. This value must be used by the application to prevent CSRF attacks. | -| `redirect_uri` | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | -| `prompt` | To initiate a [silent authentication](/api-auth/tutorials/silent-authentication) request, use `prompt=none` (see Remarks for more info). | - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Client** field to the application you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the fields **Audience** (to the unique identifier of the API you want to access), **Response Type** (set to `code`) and enable the **Audience** switch. - -1. Click **OAuth / OIDC Login**. Following the redirect, the URL will contain the authorization code. Note, that the code will be set at the **Authorization Code** field so you can proceed with exchanging it for an Access Token. - -### Remarks - -- In order to improve compatibility for applications, Auth0 will now return profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID Tokens or Access Tokens, they must conform to a namespaced format to avoid possible collisions with standard OIDC claims. For example, if you choose the namespace `https://foo.com/` and you want to add a custom claim named `myclaim`, you would name the claim `https://foo.com/myclaim`, instead of `myclaim`. -- Include `offline_access` to the `scope` request parameter to get a Refresh Token from [POST /oauth/token](#authorization-code). Make sure that the **Allow Offline Access** field is enabled in the [API Settings](${manage_url}/#/apis). -- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). -- Silent authentication lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. When an Access Token has expired, silent authentication can be used to retrieve a new one without user interaction, assuming the user's SSO session has not expired. - -### More Information - -- [Calling APIs from Server-side Web Apps](/api-auth/grant/authorization-code) -- [Executing an Authorization Code Grant Flow](/api-auth/tutorials/authorization-code-grant) -- [Using the State Parameter](/protocols/oauth2/oauth-state) -- [Silent Authentication](/api-auth/tutorials/silent-authentication) - - -## Authorization Code Grant (PKCE) - -```http -GET https://${account.namespace}/authorize? - audience=API_IDENTIFIER& - scope=SCOPE& - response_type=code& - client_id=${account.clientId}& - redirect_uri=${account.callback}& - code_challenge=CODE_CHALLENGE& - code_challenge_method=S256 -``` - -> RESPONSE SAMPLE - -```text -HTTP/1.1 302 Found -Location: ${account.callback}?code=AUTHORIZATION_CODE -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-primary", - "http_method": "GET", - "path": "/authorize", - "link": "#authorization-code-grant-pkce-" -}) %> - -This is the OAuth 2.0 grant that mobile apps utilize in order to access an API. Before starting with this flow, you need to generate and store a `code_verifier`, and using that, generate a `code_challenge` that will be sent in the authorization request. - - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `audience`
    | The unique identifier of the target API you want to access. | -| `scope` | The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must conform to a namespaced format, or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | -| `response_type`
    Required | Indicates to Auth0 which OAuth 2.0 Flow you want to perform. Use `code` for Authorization Code Grant (PKCE) Flow. | -| `client_id`
    Required | Your application's Client ID. | -| `state`
    Recommended | An opaque value the clients adds to the initial request that Auth0 includes when redirecting the back to the client. This value must be used by the client to prevent CSRF attacks. | -| `redirect_uri` | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | -| `code_challenge_method`
    Required | Method used to generate the challenge. The PKCE spec defines two methods, `S256` and `plain`, however, Auth0 supports only `S256` since the latter is discouraged. | -| `code_challenge`
    Required | Generated challenge from the `code_verifier`. | -| `prompt` | To initiate a [silent authentication](/api-auth/tutorials/silent-authentication) request, use `prompt=none` (see Remarks for more info). | - - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Application** field to the app you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the fields **Audience** (to the unique identifier of the API you want to access), **Response Type** (set to `code`) and enable the **Audience** and **PKCE** switches. - -1. Click **OAuth / OIDC Login**. Following the redirect, the URL will contain the authorization code. Note, that the code will be set at the **Authorization Code** field, and the **Code Verifier** will be automatically set as well, so you can proceed with exchanging the code for an Access Token. - - -### Remarks - -- In order to improve compatibility for applications, Auth0 will now return profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID Tokens or Access Tokens, they must conform to a namespaced format to avoid possible collisions with standard OIDC claims. For example, if you choose the namespace `https://foo.com/` and you want to add a custom claim named `myclaim`, you would name the claim `https://foo.com/myclaim`, instead of `myclaim`. -- Include `offline_access` to the `scope` request parameter to get a Refresh Token from [POST /oauth/token](#authorization-code-pkce-). Make sure that the **Allow Offline Access** field is enabled in the [API Settings](${manage_url}/#/apis). -- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). -- Silent authentication lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. When an Access Token has expired, silent authentication can be used to retrieve a new one without user interaction, assuming the user's SSO session has not expired. - - -### More Information - -- [Calling APIs from Mobile Apps](/api-auth/grant/authorization-code-pkce) -- [Executing an Authorization Code Grant Flow with PKCE](/api-auth/tutorials/authorization-code-grant-pkce) -- [Silent Authentication](/api-auth/tutorials/silent-authentication) - - -## Implicit Grant - -```http -GET https://${account.namespace}/authorize? - audience=API_IDENTIFIER& - scope=SCOPE& - response_type=token|id_token|id_token token& - client_id=${account.clientId}& - redirect_uri=${account.callback}& - state=STATE& - nonce=NONCE -``` - -> RESPONSE SAMPLE - -```text -HTTP/1.1 302 Found -Location: ${account.callback}#access_token=TOKEN&state=STATE&token_type=TYPE&expires_in=SECONDS -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-primary", - "http_method": "GET", - "path": "/authorize", - "link": "#implicit-grant" -}) %> - -This is the OAuth 2.0 grant that web apps utilize in order to access an API. - - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `audience`
    | The unique identifier of the target API you want to access. | -| `scope` | The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must conform to a namespaced format, or any scopes supported by the target API (for example, `read:contacts`). | -| `response_type`
    Required | This will specify the type of token you will receive at the end of the flow. Use `token` to get only an Access Token, `id_token` to get only an ID Token (if you don't plan on accessing an API), or `id_token token` to get both an ID Token and an Access Token. | -| `client_id`
    Required | Your application's ID. | -| `state`
    Recommended | An opaque value the application adds to the initial request that Auth0 includes when redirecting the back to the application. This value must be used by the application to prevent CSRF attacks. | -| `redirect_uri` | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | -| `nonce`
    Recommended | A string value which will be included in the ID Token response from Auth0, [used to prevent token replay attacks](/api-auth/tutorials/nonce). It is required for `response_type=id_token token`. | -| `connection` | The name of the connection configured to your application. | -| `prompt` | To initiate a [silent authentication](/api-auth/tutorials/silent-authentication) request, use `prompt=none` (see Remarks for more info). | - - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Application** field to the app you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the fields **Audience** (to the unique identifier of the API you want to access), **Response Type** (set to `token`) and enable the **Audience** switch. - -1. Click **OAuth / OIDC Login**. - - -### Remarks - -- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). -- If `response_type=token`, after the user authenticates with the provider, this will redirect them to your application callback URL while passing the `access_token` in the address `location.hash`. This is used for Single Page Apps and on Native Mobile SDKs. -- The Implicit Grant does not support the issuance of Refresh Tokens. You can use [Silent Authentication](/api-auth/tutorials/silent-authentication) instead. -- In order to improve compatibility for applications, Auth0 will now return profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID Tokens or Access Tokens, they must conform to a namespaced format to avoid possible collisions with standard OIDC claims. For example, if you choose the namespace `https://foo.com/` and you want to add a custom claim named `myclaim`, you would name the claim `https://foo.com/myclaim`, instead of `myclaim`. -- Silent authentication lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. When an Access Token has expired, silent authentication can be used to retrieve a new one without user interaction, assuming the user's SSO session has not expired. - -### More Information - -- [Calling APIs from Client-side Web Apps](/api-auth/grant/implicit) -- [Executing the Implicit Grant Flow](/api-auth/tutorials/implicit-grant) -- [Using the State Parameter](/protocols/oauth2/oauth-state) -- [Mitigate replay attacks when using the Implicit Grant](/api-auth/tutorials/nonce) -- [Silent Authentication](/api-auth/tutorials/silent-authentication) +Note that the only OAuth 2.0 flows that can retrieve a Refresh Token are: +- [Authorization Code Flow (Authorization Code)](/flows/concepts/auth-code) +- [Authorization Code Flow with PKCE (Authorization Code with PKCE)](/flows/concepts/auth-code-pkce) +- [Resource Owner Password](/api-auth/grant/password) +- [Device Authorization Flow](/flows/concepts/device-auth) +- Token Exchange\* \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_client-credential.md b/articles/api/authentication/api-authz/_client-credential.md new file mode 100644 index 0000000000..3f532cd8bb --- /dev/null +++ b/articles/api/authentication/api-authz/_client-credential.md @@ -0,0 +1,74 @@ +# Client Credential Flow +## Get Token + +```http +POST https://${account.namespace}/oauth/token +Content-Type: application/x-www-form-urlencoded + +audience=API_IDENTIFIER&grant_type=client_credentials&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/token' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'audience=API_IDENTIFIER&grant_type=client_credentials&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/token', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: + { client_id: '${account.clientId}', + client_secret: 'YOUR_CLIENT_SECRET', + audience: 'API_IDENTIFIER', + grant_type: 'client_credentials' } + }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "access_token":"eyJz93a...k4laUWw", + "token_type":"Bearer", + "expires_in":86400 +} +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/token", + "link": "#client-credentials" +}) %> + +This is the OAuth 2.0 grant that server processes use to access an API. Use this endpoint to directly request an access token by using the application's credentials (a Client ID and a Client Secret). + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `grant_type`
    Required | Denotes the flow you are using. For Client Credentials use `client_credentials`. | +| `client_id`
    Required | Your application's Client ID. | +| `client_secret`
    Required | Your application's Client Secret. | +| `audience`
    Required | The unique identifier of the target API you want to access. | +| `organization`
    Optional| The organization or identifier with which you want the request to be associated. To learn more, read [Machine-to-Machine Access for Organizations](https://auth0.com/docs/manage-users/organizations/organizations-for-m2m-applications)| + +### Learn More + +- [Client Credentials Flow](/flows/concepts/client-credentials) +- [Call API using the Client Credentials Flow](/flows/guides/client-credentials/call-api-client-credentials) +- [Setting up a Client Grant using the Management Dashboard](/api-auth/config/using-the-auth0-dashboard) +- [Asking for Access Tokens for a Client Credentials Grant](/api-auth/config/asking-for-access-tokens) \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_device-code.md b/articles/api/authentication/api-authz/_device-code.md new file mode 100644 index 0000000000..11a26b9470 --- /dev/null +++ b/articles/api/authentication/api-authz/_device-code.md @@ -0,0 +1,186 @@ +# Device Authorization Flow +## Authorize + +```http +POST https://${account.namespace}/oauth/device/code +Content-Type: application/x-www-form-urlencoded + +client_id=${account.clientId}&scope=SCOPE&audience=API_IDENTIFIER +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/device/code' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'client_id=${account.clientId}&scope=SCOPE&audience=API_IDENTIFIER' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/device/code', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: + { client_id: '${account.clientId}', + scope: 'SCOPE', + audience: 'API_IDENTIFIER' } + }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "device_code":"GmRh...k9eS", + "user_code":"WDJB-MJHT", + "verification_uri":"https://${account.namespace}/device", + "verification_uri_complete":"https://${account.namespace}/device?user_code=WDJB-MJHT", + "expires_in":900, //in seconds + "interval":5 +} +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "POST", + "path": "/oauth/device/code", + "link": "#device-code" +}) %> + +This is the flow that input-constrained devices use to access an API. Use this endpoint to get a device code. To begin the [Device Authorization Flow](/flows/concepts/device-auth), your application should first request a device code. + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `audience`
    | The unique identifier of the target API you want to access. | +| `scope` | The scopes for which you want to request authorization. These must be separated by a space. You can request any of the [standard OIDC scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | +| `client_id`
    Required | Your application's ID. | + +### Response Values + +| Value | Description | +|:-----------------------------|:------------| +| `device_code` | The unique code for the device. When the user visits the `verification_uri` in their browser-based device, this code will be bound to their session. | +| `user_code` | The code that the user should input at the `verification_uri` to authorize the device. | +| `verification_uri` | The URL the user should visit to authorize the device. | +| `verification_uri_complete` | The complete URL the user should visit to authorize the device. Your app can use this value to embed the `user_code` in the URL, if you so choose. | +| `expires_in` | The lifetime (in seconds) of the `device_code` and `user_code`. | +| `interval` | The interval (in seconds) at which the app should poll the token URL to request a token. | + +### Remarks + +- Include `offline_access` to the `scope` request parameter to get a Refresh Token from [POST /oauth/token](#device-auth). Make sure that the **Allow Offline Access** field is enabled in the [API Settings](${manage_url}/#/apis). + +```http +POST https://${account.namespace}/oauth/token +Content-Type: application/x-www-form-urlencoded + +client_id=${account.clientId}&device_code=YOUR_DEVICE_CODE&grant_type=urn:ietf:params:oauth:grant-type:device_code +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/token' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'client_id=${account.clientId}&device_code=YOUR_DEVICE_CODE&grant_type=urn:ietf:params:oauth:grant-type:device_code' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/token', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: + { client_id: '${account.clientId}', + device_code: 'YOUR_DEVICE_CODE', + grant_type: 'urn:ietf:params:oauth:grant-type:device_code' } + }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "access_token": "eyJz93a...k4laUWw", + "id_token": "eyJ...0NE", + "refresh_token": "eyJ...MoQ", + "scope": "...", + "expires_in": 86400, + "token_type": "Bearer" +} +``` + +```JSON +HTTP/1.1 403 Forbidden +Content-Type: application/json + { + // Can be retried + "error": "authorization_pending", + "error_description": "User has yet to authorize device code." + } +``` + +```JSON +HTTP/1.1 429 Too Many Requests +Content-Type: application/json + { + // Can be retried + "error": "slow_down", + "error_description": "You are polling faster than the specified interval of 5 seconds." + } +``` + +```JSON +HTTP/1.1 403 Forbidden +Content-Type: application/json + { + // Cannot be retried; transaction failed + "error": "access_denied|invalid_grant|...", + "error_description": "Failure: User cancelled the confirmation prompt or consent page; the code expired; there was an error." + } +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/token", + "link": "#device-auth" +}) %> + +This is the OAuth 2.0 grant that input-constrained devices use to access an API. Poll this endpoint using the interval returned with your [device code](/api/authentication#get-device-code) to directly request an access token using the application's credentials (a Client ID) and a device code. + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `grant_type`
    Required | Denotes the flow you are using. For Device Authorization, use `urn:ietf:params:oauth:grant-type:device_code`. | +| `client_id`
    Required | Your application's Client ID. | +| `device_code`
    Required | The device code previously returned from the [/oauth/device/code endpoint](/api/authentication#device-authorization-flow). | + +### Remarks +- Because you will be polling this endpoint (using the `interval` from the initial response to determine frequency) while waiting for the user to go to the verification URL and enter their user code, you will likely receive at least one failure before receiving a successful response. See sample responses for possible responses. + +### Learn More + +- [Device Authorization Flow](/flows/concepts/device-auth) +- [Call API using the Device Authorization Flow](/flows/guides/device-auth/call-api-device-auth) +- [Setting up a Device Code Grant using the Management Dashboard](/api-auth/config/using-the-auth0-dashboard) \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_get-token.md b/articles/api/authentication/api-authz/_get-token.md deleted file mode 100644 index 6746222c83..0000000000 --- a/articles/api/authentication/api-authz/_get-token.md +++ /dev/null @@ -1,495 +0,0 @@ -# Get Token - -Use this endpoint to: -- Get an Access Token in order to call an API. You can, optionally, retrieve an ID Token and a Refresh Token as well. -- Refresh your Access Token, using a Refresh Token you got during authorization. - -Note that the only OAuth 2.0 flows that can retrieve a Refresh Token are: -- [Authorization Code](/api-auth/grant/authorization-code) -- [Authorization Code with PKCE](/api-auth/grant/authorization-code-pkce) -- [Resource Owner Password](/api-auth/grant/password) - -## Authorization Code - -```http -POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "grant_type": "authorization_code", - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET", - "code": "AUTHORIZATION_CODE", - "redirect_uri": "${account.callback}" -} -``` - -```shell -curl --request POST \ - --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"grant_type":"authorization_code","client_id": "${account.clientId}","client_secret": "YOUR_CLIENT_SECRET","code": "AUTHORIZATION_CODE","redirect_uri": "${account.callback}"}' -``` - -```javascript -var request = require("request"); - -var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { grant_type: 'authorization_code', - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET', - code: 'AUTHORIZATION_CODE', - redirect_uri: '${account.callback}' }, - json: true }; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - console.log(body); -}); -``` - -> RESPONSE SAMPLE: - -```JSON -HTTP/1.1 200 OK -Content-Type: application/json -{ - "access_token":"eyJz93a...k4laUWw", - "refresh_token":"GEbRxBN...edjnXbL", - "id_token":"eyJ0XAi...4faeEoQ", - "token_type":"Bearer", - "expires_in":86400 -} -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-success", - "http_method": "POST", - "path": "/oauth/token", - "link": "#authorization-code" -}) %> - -This is the OAuth 2.0 grant that regular web apps utilize in order to access an API. Use this endpoint to exchange an Authorization Code for a Token. - - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `grant_type`
    Required | Denotes the flow you are using. For Authorization Code use `authorization_code`. | -| `client_id`
    Required | Your application's Client ID. | -| `client_secret`
    Required | Your application's Client Secret. | -| `code`
    Required | The Authorization Code received from the initial `/authorize` call. | -| `redirect_uri`| This is required only if it was set at the [GET /authorize](#authorization-code-grant) endpoint. The values must match. | - - -### Test with Postman - -<%= include('../../../_includes/_test-with-postman') %> - - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -If you have just executed the [Authorization Code Grant](#authorization-code-grant) you should already have a code set at the **Authorization Code** field of the *OAuth2 / OIDC* tab. If so, click **OAuth2 Code Exchange**, otherwise follow the instructions. - -1. At the *Configuration* tab, set the **Application** field to the application you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the field **Authorization Code** to the code you retrieved from [Authorization Code Grant](#authorization-code-grant). Click **OAuth2 Code Exchange**. - - -### More Information - -- [Calling APIs from Server-side Web Apps](/api-auth/grant/authorization-code) -- [Executing an Authorization Code Grant Flow](/api-auth/tutorials/authorization-code-grant) - - -## Authorization Code (PKCE) - -```http -POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "grant_type": "authorization_code", - "client_id": "${account.clientId}", - "code_verifier": "CODE_VERIFIER", - "code": "AUTHORIZATION_CODE", - "redirect_uri": "com.myclientapp://myclientapp.com/callback" -} -``` - -```shell -curl --request POST \ - --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"grant_type":"authorization_code","client_id": "${account.clientId}","code_verifier": "CODE_VERIFIER","code": "AUTHORIZATION_CODE","redirect_uri": "com.myclientapp://myclientapp.com/callback"}' -``` - -```javascript -var request = require("request"); - -var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: '{"grant_type":"authorization_code","client_id": "${account.clientId}","code_verifier": "CODE_VERIFIER","code": "AUTHORIZATION_CODE","redirect_uri": "com.myclientapp://myclientapp.com/callback", }' }; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - console.log(body); -}); -``` - -> RESPONSE SAMPLE: - -```JSON -HTTP/1.1 200 OK -Content-Type: application/json -{ - "access_token":"eyJz93a...k4laUWw", - "refresh_token":"GEbRxBN...edjnXbL", - "id_token":"eyJ0XAi...4faeEoQ", - "token_type":"Bearer", - "expires_in":86400 -} -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-success", - "http_method": "POST", - "path": "/oauth/token", - "link": "#authorization-code-pkce-" -}) %> - -This is the OAuth 2.0 grant that mobile apps utilize in order to access an API. Use this endpoint to exchange an Authorization Code for a Token. - - - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `grant_type`
    Required | Denotes the flow you are using. For Authorization Code (PKCE) use `authorization_code`. | -| `client_id`
    Required | Your application's Client ID. | -| `code`
    Required | The Authorization Code received from the initial `/authorize` call. | -| `code_verifier`
    Required | Cryptographically random key that was used to generate the `code_challenge` passed to `/authorize`. | -| `redirect_uri` | This is required only if it was set at the [GET /authorize](#authorization-code-grant-pkce-) endpoint. The values must match. | - - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -If you have just executed the [Authorization Code Grant (PKCE)](#authorization-code-grant-pkce-) you should already have the **Authorization Code** and **Code Verifier** fields, of the *OAuth2 / OIDC* tab, set. If so, click **OAuth2 Code Exchange**, otherwise follow the instructions. - -1. At the *Configuration* tab, set the **Client** field to the application you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the field **Authorization Code** to the code you retrieved from [Authorization Code Grant](#authorization-code-grant-pkce-), and the **Code Verifier** to the key. Click **OAuth2 Code Exchange**. - - -### More Information - -- [Calling APIs from Mobile Apps](/api-auth/grant/authorization-code-pkce) -- [Executing an Authorization Code Grant Flow with PKCE](/api-auth/tutorials/authorization-code-grant-pkce) - - -## Client Credentials - -```http -POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "audience": "API_IDENTIFIER", - "grant_type": "client_credentials", - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET" -} -``` - -```shell -curl --request POST \ - --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"audience":"API_IDENTIFIER", "grant_type":"client_credentials", "client_id":"${account.clientId}", "client_secret":"YOUR_CLIENT_SECRET"}' -``` - -```javascript -var request = require("request"); - -var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET', - audience: 'API_IDENTIFIER', - grant_type: 'client_credentials' }, - json: true }; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - console.log(body); -}); -``` - -> RESPONSE SAMPLE: - -```JSON -HTTP/1.1 200 OK -Content-Type: application/json -{ - "access_token":"eyJz93a...k4laUWw", - "token_type":"Bearer", - "expires_in":86400 -} -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-success", - "http_method": "POST", - "path": "/oauth/token", - "link": "#client-credentials" -}) %> - -This is the OAuth 2.0 grant that server processes utilize in order to access an API. Use this endpoint to directly request an Access Token by using the Client Credentials (a Client ID and a Client Secret). - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `grant_type`
    Required | Denotes the flow you are using. For Client Credentials use `client_credentials`. | -| `client_id`
    Required | Your application's Client ID. | -| `client_secret`
    Required | Your application's Client Secret. | -| `audience`
    Required | The unique identifier of the target API you want to access. | - - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Client** field to the application you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, click **OAuth2 Client Credentials**. - - -### More Information - -- [Calling APIs from a Service](/api-auth/grant/client-credentials) -- [Setting up a Client Grant using the Management Dashboard](/api-auth/config/using-the-auth0-dashboard) -- [Asking for Access Tokens for a Client Credentials Grant](/api-auth/config/asking-for-access-tokens) - - -## Resource Owner Password - -```http -POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "grant_type": "password", - "username": "USERNAME", - "password": "PASSWORD", - "audience": "API_IDENTIFIER", - "scope": "SCOPE", - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET" -} -``` - -```shell -curl --request POST \ - --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"grant_type":"password", "username":"USERNAME", "password":"PASSWORD", "audience":"API_IDENTIFIER", "scope":"SCOPE", "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET" - }' -``` - -```javascript -var request = require("request"); - -var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { grant_type: 'password', - username: 'USERNAME', - password: 'PASSWORD', - audience: 'API_IDENTIFIER', - scope: 'SCOPE', - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET' }, - json: true }; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - console.log(body); -}); -``` - -> RESPONSE SAMPLE: - -```JSON -HTTP/1.1 200 OK -Content-Type: application/json -{ - "access_token":"eyJz93a...k4laUWw", - "token_type":"Bearer", - "expires_in":86400 -} -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-success", - "http_method": "POST", - "path": "/oauth/token", - "link": "#resource-owner-password" -}) %> - -:::warning -This flow should only be used from highly trusted applications that **cannot do redirects**. If you can use redirect-based flows from your apps we recommend using the [Authorization Code Grant](#authorization-code-grant) instead. -::: - -This is the OAuth 2.0 grant that highly trusted apps use in order to access an API. In this flow the end-user is asked to fill in credentials (username/password) typically using an interactive form in the user-agent (browser). This information is sent to the backend and from there to Auth0. It is therefore imperative that the application is absolutely trusted with this information. For [client side](/api-auth/grant/implicit) applications and [mobile apps](/api-auth/grant/authorization-code-pkce) we recommend using web flows instead. - - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `grant_type`
    Required | Denotes the flow you are using. For Resource Owner Password use `password`. To add realm support use `http://auth0.com/oauth/grant-type/password-realm`. | -| `client_id`
    Required | Your application's Client ID. | -| `client_secret` | Your application's Client Secret. **Required** when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | -| `audience` | The unique identifier of the target API you want to access. | -| `username`
    Required | Resource Owner's identifier. | -| `password`
    Required | Resource Owner's secret. | -| `scope` | String value of the different scopes the application is asking for. Multiple scopes are separated with whitespace. | -| `realm` | String value of the realm the user belongs. Set this if you want to add realm support at this grant. For more information on what realms are refer to [Realm Support](/api-auth/grant/password#realm-support). | - -### Request headers - -| Parameter | Description | -|:-----------------|:------------| -| `auth0-forwarded-for` | End-user IP as a string value. Set this if you want brute-force protection to work in server-side scenarios. For more information on how and when to use this header, refer to [Using resource owner password from server-side](/api-auth/tutorials/using-resource-owner-password-from-server-side). | - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Client** field to the application you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the **Username** and **Password**, and click **Password Grant**. - - -### Remarks - -- The scopes issued to the application may differ from the scopes requested. In this case, a `scope` parameter will be included in the response JSON. -- If you don't request specific scopes, all scopes defined for the audience will be returned due to the implied trust to the application in this grant. You can customize the scopes returned in a rule. For more information, refer to [Calling APIs from Highly Trusted Applications](/api-auth/grant/password). -- To add realm support set the `grant_type` to `http://auth0.com/oauth/grant-type/password-realm`, and the `realm` to the realm the user belongs. This maps to a connection in Auth0. For example, if you have configured a database connection for your internal employees and you have named the connection `employees`, then use this value. For more information on how to implement this refer to: [Realm Support](/api-auth/tutorials/password-grant#realm-support). -- In addition to username and password, Auth0 may also require the end-user to provide an additional factor as proof of identity before issuing the requested scopes. In this case, the request described above will return an `mfa_required` error along with an `mfa_token`. You can use these tokens to request a challenge for the possession factor and validate it accordingly. For details refer to [Resource Owner Password and MFA](#resource-owner-password-and-mfa). - -### More Information -- [Calling APIs from Highly Trusted Applications](/api-auth/grant/password) -- [Executing the Resource Owner Password Grant](/api-auth/tutorials/password-grant) -- [Multi-factor Authentication and Resource Owner Password](/api-auth/tutorials/multifactor-resource-owner-password) - -## Refresh Token - -```http -POST https://${account.namespace}/oauth/token -Content-Type: application/json -{ - "grant_type": "refresh_token", - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET", - "refresh_token": "YOUR_REFRESH_TOKEN" -} -``` - -```shell -curl --request POST \ - --url 'https://${account.namespace}/oauth/token' \ - --header 'content-type: application/json' \ - --data '{"grant_type":"refresh_token","client_id": "${account.clientId}","client_secret": "YOUR_CLIENT_SECRET","refresh_token": "YOUR_REFRESH_TOKEN"}' -``` - -```javascript -var request = require("request"); - -var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/token', - headers: { 'content-type': 'application/json' }, - body: - { grant_type: 'refresh_token', - client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET', - refresh_token: 'YOUR_REFRESH_TOKEN'}, - json: true }; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - console.log(body); -}); -``` - -> RESPONSE SAMPLE: - -```JSON -HTTP/1.1 200 OK -Content-Type: application/json -{ - "access_token": "eyJ...MoQ", - "expires_in": 86400, - "scope": "openid offline_access", - "id_token": "eyJ...0NE", - "token_type": "Bearer" -} -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-success", - "http_method": "POST", - "path": "/oauth/token", - "link": "#refresh-token" -}) %> - -Use this endpoint to refresh an Access Token using the Refresh Token you got during authorization. - - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `grant_type`
    Required | Denotes the flow you are using. To refresh a token, use `refresh_token`. | -| `client_id`
    Required | Your application's Client ID. | -| `client_secret` | Your application's Client Secret. **Required** when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | -| `refresh_token`
    Required | The Refresh Token to use. | - - -### Test this endpoint - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Client** field to the client you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the field **Refresh Token** to the Refresh Token you have. Click **OAuth2 Refresh Token Exchange**. - - -### More Information - -- [Refresh Token](/tokens/refresh-token) diff --git a/articles/api/authentication/api-authz/_highly-regulated.md b/articles/api/authentication/api-authz/_highly-regulated.md new file mode 100644 index 0000000000..0181295d99 --- /dev/null +++ b/articles/api/authentication/api-authz/_highly-regulated.md @@ -0,0 +1,233 @@ + +# Authorization Code Flow with Enhanced Privacy Protection + +## Push Authorization Requests (PAR) + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "POST", + "path": "/oauth/par", + "link": "##push-authorization-requests-par-" +}) %> + +```http +POST ${account.namespace}/oauth/par +Content-Type: 'application/x-www-form-urlencoded' + audience={https://yourApi/}& + response_type=code|code id_token& + client_id={yourClientId}& + redirect_uri={https://yourApp/callback}& + state=STATE& + scope=openid|profile|email& + code_challenge=CODE_CHALLENGE& + code_challenge_method=S256& + nonce=NONCE& + connection=CONNECTION& + prompt=login|consent|none& + organisation=ORGANIZATION +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://{yourDomain}/oauth/par, + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: { + audience: '{https://yourApi/}', + response_type: 'code|code id_token', + client_id: '{yourClientId}', + redirect_uri: '{https://yourApp/callback}', + state: 'STATE', + scope: 'openid|profile|email', + authorization_details: JSON.stringify([{ type: 'my_type' }]), + code_challenge: 'CODE_CHALLENGE', + code_challenge_method: 'S256', + nonce: 'NONCE', + connection: 'CONNECTION', + prompt: 'login|consent|none' + organisation: 'ORGANIZATION' + } +}; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); + +``` + +```shell +curl --request POST \ + --url 'https://{yourDomain}/oauth/par' \ + --header 'content-type: application/x-www-form-urlencoded' \ +--data 'audience={https://yourApi/}response_type=code|code id_token&client_id={yourClientId}&redirect_uri={https://yourApp/callback}&state=STATE&scope=openid|profile|email&authorization_details='[{"type":"my_type"}]' +&code_challenge=CODE_CHALLENGE&code_challenge_method=S256&nonce=NONCE&connection=CONNECTION&prompt=login|consent|none&organisation=ORGANIZATION' + +``` + +> RESPONSE SAMPLE: + +``` json +/** +If the request is successful, `/oauth/par` responds with a `JSON` object containing the `request_uri` property, which can be used at the authorization endpoint, and the `expires_in` value, which indicates the number of seconds the `request_uri` is valid. +*/ + +HTTP/1.1 201 Created +Content-Type: application/json + +{ + "request_uri": + "urn:ietf:params:oauth:request_uri:6esc_11ACC5bwc014ltc14eY22c", + "expires_in": 30 +} +``` + +::: note +To use Highly Regulated Identity features, you must have an Enterprise Plan with the Highly Regulated Identity add-on. Refer to [Auth0 Pricing](https://auth0.com/pricing) for details. +::: + +Authorization Code Flow with [Pushed Authorization Requests (PAR)](/get-started/authentication-and-authorization-flow/authorization-code-flow/authorization-code-flow-with-par) uses the `/oauth/par` endpoint to allow applications to send the authorization parameters usually sent in a `GET` request to `/authorize`. PAR uses a POST method from the backend to keep parameter values secure. The `/oauth/par` endpoint accepts all authorization parameters which can be proivided to `/authorize`. Assuming the call to the `/oauth/par` endpoint is valid, Auth0 will respond with a `redirect_uri` value that can be used as a parameter for the `/authorize` endpoint. + +Assuming the call to the `/oauth/par` endpoint is valid, Auth0 will respond with a `redirect_uri` value also used as a parameter for the `/authorize` endpoint. To learn more about configuring PAR, read [Configure Pushed Authorization Requests (PAR)](/get-started/applications/configure-par). + +### Request Parameters +| Parameter | Description | +|:-----------------|:------------| +|`authorization_details`| Requested permissions for each resource. Similar to scopes. To learn more, read [RAR reference documention](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow/authorization-code-flow-with-rar). | +|`audience`| The unique identifier of the target API you want to access. | +| `response_type`
    Required | Specifies the token type. We recommend you use `code` to request an authorization code, or code `id_token` to receive an authorization code and a [detached signature](https://openid.net/specs/openid-financial-api-part-2-1_0.html#id-token-as-detached-signature). | +| `client_id`
    Required | The `client_id` of your application. | +| `redirect_uri`
    Required | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. Specify the `redirect_uri` under your [Application's Settings](${manage_url}/#/applications).| +| `state`
    Recommended | An opaque value the application adds to the initial request that the authorization server includes when redirecting the back to the application. This value must be used by the application to prevent CSRF attacks. | +| `scope`
    Recommended| OIDC scopes and custom API scopes. For example: `openid read:timesheets`. Include `offline_access` to get a refresh token.| +| `code_challenge`
    Recommended | OIDC scopes and custom API scopes. For example: `openid read:timesheets`. Include `offline_access` to get a refresh token. | +| `code_challenge_method`
    Recommended | Method used to generate the challenge. The PKCE specification defines two methods, `S256` and plain, however, Auth0 supports only S256 since the latter is discouraged. [Authorization Code Flow with Proof Key for Code Exchange (PKCE)] (/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce).| +| `nonce`
    Recommended | A string value which will be included in the ID token response from Auth0, used to prevent token replay attacks. It is required for `response_type=id_token` token. | +| `connection` | The name of the connection configured to your application. If null, it will redirect to the [Auth0 Login Page](https://${account.namespace}/login) and show the Login Widget using the first database connection. | +| `prompt` | Can be used to force a particular prompt to display, e.g. `prompt=consent` will always display the consent prompt.| +| `organization` | ID of the organization to use when authenticating a user. When not provided, if your application is configured to **Display Organization Prompt**, the user will be able to enter the organization name when authenticating. | + +### Remarks +- To make a call to the PAR endpoint, you must: + - Set the request content type as `application/x-www-form-urlencoded` + - Use `strings` for all passed parameters + - Include an additional parameter for application authentication in the request (e.g. `client_secret`, or `client_assertion` and `client_assertion_type` for JSON Web Token Client Authentication, or pass a `client-certificate` and `client-certificate-ca-verified` header when using Mutual TLS). +- Use the `authorization_details` parameter to request permission for each resource. For example, you can specify an array of JSON objects to convey fine-grained information on the authorization. Each JSON object must contain a `type` attribute. The rest is up to you to define. + +## Authorize + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "GET", + "path": "/authorize", + "link": "#redirect-from-par-to-authorize" +}) %> + +```http +GET https://{yourDomain}/authorize + request_uri={yourRequestUri}& + client_id={yourClientId} +``` + +After calling the `/oauth/par` endpoint, redirect the end user to the `/authorize` endpoint using a `GET` call. + +:::note +The `/authorize` endpoint will respond based on the parameters passed to the `/oauth/par` endpoint. If you request a `response_type`, you should receive an authorization code to use at the `/oauth/token` endpoint. +::: + +### Request Parameters +| Parameter | Description | +|:-----------------|:------------| +| `client_id`
    Required | The `client_id` of your application. | +| `request_uri`
    Required | The `request_uri` value that was received from the `/oauth/par` endpoint. | + +## Exchange an Authorization Code for a Token + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "POST", + "path": "/oauth/token", + "link": "#exchange-an-authorization-code-for-a-token" +}) %> + +```http +POST https://{yourDomain}/oauth/par +Content-Type: 'application/x-www-form-urlencoded' + grant_type=code|code id_token& + client_id={yourClientId}& + code=CODE& + redirect_uri={https://yourApp/callback}& + code_verifier=CODE_VERIFIER +``` + +```javascript +curl --request POST \ + --url 'https://{yourDomain}/oauth/par' \ + --header 'content-type: application/x-www-form-urlencoded' \ +--data 'grant_type=authorization_code& client_id={yourClientId}& code=CODE&redirect_uri={https://yourApp/callback}&code_verifier=CODE_VERIFIER' +``` + +```shell +var request = require("request"); + +var options = { method: 'POST', + url: 'https://{yourDomain}/oauth/token, + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: { + grant_type: 'authorization_code', + client_id: '{yourClientId}', + code: 'CODE', + redirect_uri: '{https://yourApp/callback}', + code_verifier: 'CODE_VERIFIER' + } +}; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: +``` json +/** +The `/oauth/token` endpoint will respond with a JSON object containing an `id_token` property, and potentially also a `refresh_token` if one was requested. +*/ +HTTP/1.1 200 OK +Content-Type: application/json +{ + "refresh_token":"GEbRxBN...edjnXbL", + "access_token":"eybRxBN...edjnXZQ", + "id_token":"eyJ0XAi...4faeEoQ", + "token_type":"Bearer", + "expires_in":86400, + "authrorization_details":[ + { + "type":"my_type", + "other_attributes_of_my_type":"value"} + ] +}, + + +``` + +When users are redirected back to your callback, you need to make a `POST` call to the `oauth/token` endpoint to exchange an authorization code for an access and/or an ID token. + +### Request Parameters +| Parameter | Description | +|:-----------------|:------------| +| `grant_type`
    Required | Denotes the flow. Assuming you have an authorization code from the `/authorize` endpoint, use `authorization_code`. | +| `code` | The authorization code from the initial `/authorize` call. | +| `client_id`
    Required | The `client_id` of your application. | +| `request_uri`
    Required | This is required only if it was set at the `GET` `/oauth/par` endpoint. The values from `/authorize` must match the value you set at `/oauth/token`. | +| `code_verifier`
    Recommended | Cryptographically random key used to generate the `code_challenge` passed to `/oauth/par`. If the `code_challenge` parameter is passed in the call to `/oauth/par`, this is required. | + +### Remarks + +To make a call to `/oauth/token` endpoint, you must: +- Set the request content type as `application/x-www-form-urlencoded` +- Use `strings` for all passed parameters +- Include an additional parameter for application authentication in the request (e.g. `client_secret`, or `client_assertion` and `client_assertion_type` for JSON Web Token Client Authentication, or pass a `client-certificate` and `client-certificate-ca-verified` header when using Mutual TLS). \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_implicit.md b/articles/api/authentication/api-authz/_implicit.md new file mode 100644 index 0000000000..a6bf10fdb7 --- /dev/null +++ b/articles/api/authentication/api-authz/_implicit.md @@ -0,0 +1,60 @@ +# Implicit Flow +## Authorize + +```http +GET https://${account.namespace}/authorize? + audience=API_IDENTIFIER& + scope=SCOPE& + response_type=token|id_token|id_token token& + client_id=${account.clientId}& + redirect_uri=${account.callback}& + state=STATE& + nonce=NONCE +``` + +> RESPONSE SAMPLE + +```text +HTTP/1.1 302 Found +Location: ${account.callback}#access_token=TOKEN&state=STATE&token_type=TYPE&expires_in=SECONDS +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-primary", + "http_method": "GET", + "path": "/authorize", + "link": "#implicit-grant" +}) %> + +This is the OAuth 2.0 grant that web apps utilize in order to access an API. + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `audience`
    | The unique identifier of the target API you want to access. | +| `scope` | The scopes which you want to request authorization for. These must be separated by a space. You can request any of the [standard OpenID Connect (OIDC) scopes](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) about users, such as `profile` and `email`. Custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). | +| `response_type`
    Required | This will specify the type of token you will receive at the end of the flow. Use `token` to get only an Access Token, `id_token` to get only an ID token (if you don't plan on accessing an API), or `id_token token` to get both an ID token and an Access Token. | +| `client_id`
    Required | Your application's ID. | +| `state`
    Recommended | An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value must be used by the application to prevent CSRF attacks. | +| `redirect_uri` | The URL to which Auth0 will redirect the browser after authorization has been granted by the user. | +| `nonce`
    Recommended | A string value which will be included in the ID token response from Auth0, [used to prevent token replay attacks](/api-auth/tutorials/nonce). It is required for `response_type=id_token token`. | +| `connection` | The name of the connection configured for your application. | +| `prompt` | To initiate a [silent authentication](/api-auth/tutorials/silent-authentication) request, use `prompt=none` (To learn more, read the Remarks). | +| `organization` | ID of the [organization](/organizations) to use when authenticating a user. When not provided, if your application is configured to **Display Organization Prompt**, the user will be able to enter the organization name when authenticating. | +| `invitation` | Ticket ID of the organization invitation. When [inviting a member to an Organization](/organizations/invite-members), your application should handle invitation acceptance by forwarding the invitation and organization key-value pairs when the user accepts the invitation. | + +### Remarks + +- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). +- If `response_type=token`, after the user authenticates with the provider, this will redirect them to your application callback URL while passing the `access_token` in the address `location.hash`. This is used for Single-Page Apps and on Native Mobile SDKs. +- The Implicit Grant does not support the issuance of Refresh Tokens. Use [Silent Authentication](/api-auth/tutorials/silent-authentication) instead. +- In order to improve compatibility for applications, Auth0 will now return profile information in a [structured claim format as defined by the OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). This means that in order to add custom claims to ID tokens or Access Tokens, they must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims) to avoid possible collisions with standard OIDC claims. +- Silent Authentication lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. When an Access Token has expired, silent authentication can be used to retrieve a new one without user interaction, assuming the user's Single Sign-on (SSO) session has not expired. + +### Learn More + +- [Implicit Flow](/flows/concepts/implicit) +- [State Parameter](/protocols/oauth2/oauth-state) +- [Mitigate replay attacks when using the Implicit Grant](/api-auth/tutorials/nonce) +- [Silent Authentication](/api-auth/tutorials/silent-authentication) \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_refresh-token.md b/articles/api/authentication/api-authz/_refresh-token.md new file mode 100644 index 0000000000..ebd8bbdba7 --- /dev/null +++ b/articles/api/authentication/api-authz/_refresh-token.md @@ -0,0 +1,72 @@ +# Refresh Token + +```http +POST https://${account.namespace}/oauth/token +Content-Type: application/x-www-form-urlencoded + +grant_type=refresh_token&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&refresh_token=YOUR_REFRESH_TOKEN +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/token' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'grant_type=refresh_token&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET&refresh_token=YOUR_REFRESH_TOKEN' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/token', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: + { grant_type: 'refresh_token', + client_id: '${account.clientId}', + client_secret: 'YOUR_CLIENT_SECRET', + refresh_token: 'YOUR_REFRESH_TOKEN'} + }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "access_token": "eyJ...MoQ", + "expires_in": 86400, + "scope": "openid offline_access", + "id_token": "eyJ...0NE", + "token_type": "Bearer" +} +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/token", + "link": "#refresh-token" +}) %> + +Use this endpoint to refresh an Access Token using the Refresh Token you got during authorization. + +## Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `grant_type`
    Required | Denotes the flow you are using. To refresh a token, use `refresh_token`. | +| `client_id`
    Required | Your application's Client ID. | +| `client_secret` | Your application's Client Secret. Required when the **Token Endpoint Authentication Method** field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | +| `refresh_token`
    Required | The refresh token to use. | +| `scope` | A space-delimited list of requested scope permissions. If not sent, the original scopes will be used; otherwise you can request a reduced set of scopes. Note that this must be URL encoded. | + +## Learn More + +- [Refresh Tokens](/tokens/concepts/refresh-tokens) diff --git a/articles/api/authentication/api-authz/_resource-owner.md b/articles/api/authentication/api-authz/_resource-owner.md new file mode 100644 index 0000000000..c8ce53f4ab --- /dev/null +++ b/articles/api/authentication/api-authz/_resource-owner.md @@ -0,0 +1,96 @@ +# Resource Owner Password Flow +## Get Token + +```http +POST https://${account.namespace}/oauth/token +Content-Type: application/x-www-form-urlencoded + +grant_type=password&username=USERNAME&password=PASSWORD&audience=API_IDENTIFIER&scope=SCOPE&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/token' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'grant_type=password&username=USERNAME&password=PASSWORD&audience=API_IDENTIFIER&scope=SCOPE&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/token', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: + { grant_type: 'password', + username: 'USERNAME', + password: 'PASSWORD', + audience: 'API_IDENTIFIER', + scope: 'SCOPE', + client_id: '${account.clientId}', + client_secret: 'YOUR_CLIENT_SECRET' } + }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "access_token":"eyJz93a...k4laUWw", + "token_type":"Bearer", + "expires_in":86400 +} +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/token", + "link": "#resource-owner-password" +}) %> + +:::warning +This flow should only be used from highly-trusted applications that **cannot do redirects**. If you can use redirect-based flows from your app, we recommend using the [Authorization Code Flow](#regular-web-app-login-flow) instead. +::: + +This is the OAuth 2.0 grant that highly-trusted apps use to access an API. In this flow, the end-user is asked to fill in credentials (username/password), typically using an interactive form in the user-agent (browser). This information is sent to the backend and from there to Auth0. It is therefore imperative that the application is absolutely trusted with this information. For [single-page applications and native/mobile apps](/flows/concepts/auth-code-pkce), we recommend using web flows instead. + + +### Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `grant_type`
    Required | Denotes the flow you are using. For Resource Owner Password use `password`. To add realm support use `http://auth0.com/oauth/grant-type/password-realm`. | +| `client_id`
    Required | Your application's Client ID. | +| `client_secret` | Your application's Client Secret. Required when the Token Endpoint Authentication Method field at your [Application Settings](${manage_url}/#/applications) is `Post` or `Basic`. | +| `audience` | The unique identifier of the target API you want to access. | +| `username`
    Required | Resource Owner's identifier, such as a username or email address. | +| `password`
    Required | Resource Owner's secret. | +| `scope` | String value of the different scopes the application is asking for. Multiple scopes are separated with whitespace. | +| `realm` | String value of the realm the user belongs. Set this if you want to add realm support at this grant. For more information on what realms are refer to [Realm Support](/api-auth/grant/password#realm-support). | + +### Request headers + +| Parameter | Description | +|:-----------------|:------------| +| `auth0-forwarded-for` | End-user IP as a string value. Set this if you want brute-force protection to work in server-side scenarios. For more information on how and when to use this header, refer to [Using resource owner password from server-side](/api-auth/tutorials/using-resource-owner-password-from-server-side). | + +### Remarks + +- The scopes issued to the application may differ from the scopes requested. In this case, a `scope` parameter will be included in the response JSON. +- If you don't request specific scopes, all scopes defined for the audience will be returned due to the implied trust to the application in this grant. You can customize the scopes returned in a rule. For more information, refer to [Calling APIs from Highly Trusted Applications](/api-auth/grant/password). +- To add realm support set the `grant_type` to `http://auth0.com/oauth/grant-type/password-realm`, and the `realm` to the realm the user belongs. This maps to a connection in Auth0. For example, if you have configured a database connection for your internal employees and you have named the connection `employees`, then use this value. For more information on how to implement this refer to: [Realm Support](/api-auth/tutorials/password-grant#realm-support). +- In addition to username and password, Auth0 may also require the end-user to provide an additional factor as proof of identity before issuing the requested scopes. In this case, the request described above will return an `mfa_required` error along with an `mfa_token`. You can use these tokens to request a challenge for the possession factor and validate it accordingly. For details refer to [Resource Owner Password and MFA](#resource-owner-password-and-mfa). + +### Learn More +- [Calling APIs from Highly-Trusted Applications](/api-auth/grant/password) +- [Executing the Resource Owner Password Grant](/api-auth/tutorials/password-grant) +- [Multi-factor Authentication and Resource Owner Password](/mfa/guides/mfa-api/multifactor-resource-owner-password) \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_revoke-refersh-token.md b/articles/api/authentication/api-authz/_revoke-refersh-token.md deleted file mode 100644 index 9859b4fbf3..0000000000 --- a/articles/api/authentication/api-authz/_revoke-refersh-token.md +++ /dev/null @@ -1,75 +0,0 @@ -# Revoke Refresh Token - -```http -POST https://${account.namespace}/oauth/revoke -Content-Type: application/json -{ - "client_id": "${account.clientId}", - "client_secret": "YOUR_CLIENT_SECRET", - "token": "YOUR_REFRESH_TOKEN", -} -``` - -```shell -curl --request POST \ - --url 'https://${account.namespace}/oauth/revoke' \ - --header 'content-type: application/json' \ - --data '{ "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET", "token": "YOUR_REFRESH_TOKEN" }' -``` - -```javascript -var request = require("request"); - -var options = { method: 'POST', - url: 'https://${account.namespace}/oauth/revoke', - headers: { 'content-type': 'application/json' }, - body: - { client_id: '${account.clientId}', - client_secret: 'YOUR_CLIENT_SECRET', - token: 'YOUR_REFRESH_TOKEN' }, - json: true }; - -request(options, function (error, response, body) { - if (error) throw new Error(error); - - console.log(body); -}); -``` - -> RESPONSE SAMPLE: - -```JSON -HTTP/1.1 200 OK -(empty-response-body) -``` - -<%= include('../../../_includes/_http-method', { - "http_badge": "badge-success", - "http_method": "POST", - "path": "/oauth/revoke", - "link": "#revoke-refresh-token" -}) %> - -Use this endpoint to invalidate a Refresh Token if it has been compromised. - -Each revocation request invalidates not only the specific token, but all other tokens based on the same authorization grant. This means that **all Refresh Tokens that have been issued for the same user, application, and audience will be revoked**. - -### Request Parameters - -| Parameter | Description | -|:-----------------|:------------| -| `client_id`
    Required | Your application's Client ID. The application should match the one the Refresh Token was issued for. | -| `client_secret` | Your application's Client Secret. Required for [confidential applications](/applications/application-types#confidential-applications). | -| `token`
    Required | The Refresh Token you want to revoke. | - -### Remarks - -- For non-confidential applications that cannot keep the Client Secret safe (for example, native apps), the endpoint supports passing no Client Secret but the application itself must have the property `tokenEndpointAuthMethod` set to `none`. You can do this either from the UI ([Dashboard > Applications > Application Settings](${manage_url}/#/applications)) or using the [Management API](/api/management/v2#!/Applications/patch_applications_by_id). - -### Error Codes - -For the complete error code reference for this endpoint refer to [Errors > POST /oauth/revoke](#post-oauth-revoke). - -### More Information - -- [Refresh Token](/tokens/refresh-token) diff --git a/articles/api/authentication/api-authz/_revoke-refresh-token.md b/articles/api/authentication/api-authz/_revoke-refresh-token.md new file mode 100644 index 0000000000..5f44c585e2 --- /dev/null +++ b/articles/api/authentication/api-authz/_revoke-refresh-token.md @@ -0,0 +1,79 @@ +# Revoke Refresh Token + +```http +POST https://${account.namespace}/oauth/revoke +Content-Type: application/json +{ + "client_id": "${account.clientId}", + "client_secret": "YOUR_CLIENT_SECRET", + "token": "YOUR_REFRESH_TOKEN", +} +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/revoke' \ + --header 'content-type: application/json' \ + --data '{ "client_id": "${account.clientId}", "client_secret": "YOUR_CLIENT_SECRET", "token": "YOUR_REFRESH_TOKEN" }' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/revoke', + headers: { 'content-type': 'application/json' }, + body: + { client_id: '${account.clientId}', + client_secret: 'YOUR_CLIENT_SECRET', + token: 'YOUR_REFRESH_TOKEN' }, + json: true }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +(empty-response-body) +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/revoke", + "link": "#revoke-refresh-token" +}) %> + +Use this endpoint to invalidate a Refresh Token if it has been compromised. + +The behaviour of this endpoint depends on the state of the [Refresh Token Revocation Deletes Grant](https://auth0.com/docs/tokens/refresh-tokens/revoke-refresh-tokens#refresh-tokens-and-grants) toggle. +If this toggle is enabled, then each revocation request invalidates not only the specific token, but all other tokens based on the same authorization grant. This means that **all Refresh Tokens that have been issued for the same user, application, and audience will be revoked**. +If this toggle is disabled, then only the refresh token is revoked, while the grant is left intact. + +## Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `client_id`
    Required | The `client_id` of your application. | +| `client_assertion`| A JWT containing a signed assertion with your application credentials. Required when Private Key JWT is the application authentication method.| +| `client_assertion_type`| The value is `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`. Required when Private Key JWT is the application authentication method.| +| `client_secret` | The `client_secret` of your application. Required when Client Secret Basic or Client Secret Post is the application authentication method. Specifically required for Regular Web Applications **only**. | +| `token`
    Required | The Refresh Token you want to revoke. | + +## Remarks + +- For non-confidential applications that cannot keep the Client Secret safe (for example, native apps), the endpoint supports passing no Client Secret but the application itself must have the property `tokenEndpointAuthMethod` set to `none`. You can do this either from the UI ([Dashboard > Applications > Application Settings](${manage_url}/#/applications)) or using the [Management API](/api/management/v2#!/Applications/patch_applications_by_id). + +## Error Codes + +For the complete error code reference for this endpoint, refer to [Errors > POST /oauth/revoke](#post-oauth-revoke). + +## Learn More + +- [Refresh Tokens](/tokens/concepts/refresh-tokens) \ No newline at end of file diff --git a/articles/api/authentication/api-authz/_token-exchange-native-social.md b/articles/api/authentication/api-authz/_token-exchange-native-social.md new file mode 100644 index 0000000000..e234380215 --- /dev/null +++ b/articles/api/authentication/api-authz/_token-exchange-native-social.md @@ -0,0 +1,89 @@ +# Token Exchange for Native Social + +```http +POST https://${account.namespace}/oauth/token +Content-Type: application/x-www-form-urlencoded + +grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token=SUBJECT_TOKEN&subject_token_type=SUBJECT_TOKEN_TYPE&client_id=${account.clientId}&audience=API_IDENTIFIER&scope=SCOPE +``` + +```shell +curl --request POST \ + --url 'https://${account.namespace}/oauth/token' \ + --header 'content-type: application/x-www-form-urlencoded' \ + --data 'grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token=SUBJECT_TOKEN&subject_token_type=SUBJECT_TOKEN_TYPE&client_id=${account.clientId}&audience=API_IDENTIFIER&scope=SCOPE' + }' +``` + +```javascript +var request = require("request"); + +var options = { method: 'POST', + url: 'https://${account.namespace}/oauth/token', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + form: + { grant_type: 'urn:ietf:params:oauth:grant-type:token-exchange', + subject_token: 'SUBJECT_TOKEN', + subject_token_type: 'SUBJECT_TOKEN_TYPE', + client_id: '${account.clientId}', + audience: 'API_IDENTIFIER', + scope: 'SCOPE', + }; + +request(options, function (error, response, body) { + if (error) throw new Error(error); + + console.log(body); +}); +``` + +> RESPONSE SAMPLE: + +```JSON +HTTP/1.1 200 OK +Content-Type: application/json +{ + "access_token": "eyJz93a...k4laUWw", + "id_token": "eyJ...0NE", + "refresh_token": "eyJ...MoQ", + "expires_in":86400, + "token_type":"Bearer" +} +``` + +<%= include('../../../_includes/_http-method', { + "http_badge": "badge-success", + "http_method": "POST", + "path": "/oauth/token", + "link": "#token-exchange-native-social" +}) %> + +:::warning +This flow is intended for use with native social interactions **only**. Use of this flow outside of a native social setting is highly discouraged. +::: + +When a non-browser-based solution (such as a mobile platform's SDK) authenticates the user, the authentication will commonly result in artifacts being returned to application code. In such situations, this grant type allows for the Auth0 platform to accept artifacts from trusted sources and issue tokens in response. In this way, apps making use of non-browser-based authentication mechanisms (as are common in native apps) can still retrieve Auth0 tokens without asking for further user interaction. + +Artifacts returned by this flow (and the contents thereof) will be determined by the `subject_token_type` and the tenant's configuration settings. + +## Request Parameters + +| Parameter | Description | +|:-----------------|:------------| +| `auth0-forwarded-for` | End user IP as a string value. Set this if you want brute-force protection to work in server-side scenarios. To learn more about how and when to use this header, read [Using resource owner password from server-side](/api-auth/tutorials/using-resource-owner-password-from-server-side). | +| `grant_type`
    Required | Denotes the flow you are using. For Token Exchange for Native Social, use `urn:ietf:params:oauth:grant-type:token-exchange`. | +| `subject_token`
    Required | Externally-issued identity artifact representing the user. | +| `subject_token_type`
    Required | Identifier that indicates the type of `subject_token`. | +| `client_id`
    Required | Your application's Client ID. | +| `audience` | The unique identifier of the target API you want to access. | +| `scope` | String value of the different scopes the application is requesting. Multiple scopes are separated with whitespace. | +| `user_profile`
    Only For `apple-authz-code` | Optional element used for native iOS interactions for which profile updates can occur. Expected parameter value will be JSON in the form of: `{ name: { firstName: 'John', lastName: 'Smith }}` | + +## Remarks + +- The scopes issued to the application may differ from the requested scopes. In this case, a `scope` parameter will be included in the response JSON. +- If you don't request specific scopes, all scopes defined for the audience will be returned due to the implied trust to the application in this grant. You can customize the scopes returned in a rule. To learn more, read [Calling APIs from Highly Trusted Applications](/api-auth/grant/password). + +## Learn More +- [Add Sign In with Apple to Native iOS Apps](/connections/apple-siwa/add-siwa-to-native-app) +- [iOS Swift - Sign In with Apple Quickstart](/quickstart/native/ios-swift-siwa) \ No newline at end of file diff --git a/articles/api/authentication/errors/_errors.md b/articles/api/authentication/errors/_errors.md index 83eba927d5..3b9163d8ae 100644 --- a/articles/api/authentication/errors/_errors.md +++ b/articles/api/authentication/errors/_errors.md @@ -1,46 +1,21 @@ # Standard Error Responses The Authentication API may return the following HTTP Status Codes: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    StatusDescription
    400Bad Request
    401Unauthorized
    403Forbidden
    404Not Found
    405Method Not Allowed
    429Too Many Requests
    500Internal Server Error
    503Service Unavailable
    +| Status | JSON Response | +| :---------------- | :------------ | +| 400 Bad Request|`{"error": "invalid_request", "error_description": "..."}`| +| 400 Bad Request| `{"error": "invalid_request", "error_description": "..."}`| +| 400 Bad Request| `{"error": "invalid_scope", "error_description": "Scope must be an array or a string"}`| +| 401 Unauthorized| `{"error": "invalid_client", "error_description": "..."}`| +| 401 Unauthorized| `{"error": "requires_validation", "error_description": "Suspicious request requires verification"}`| +| 403 Forbidden| `{"error": "unauthorized_client", "error_description": "..."}`| +| 403 Forbidden| `{"error": "access_denied", "error_description": "..."}`| +| 403 Forbidden| `{"error": "access_denied", "error_description": "Unknown or invalid refresh token"}`| +| 403 Forbidden| `{"error": "invalid_grant", "error_description": "..."}`| +| 404 Not Found| `{"error": "endpoint_disabled", "error_description": "..."}`| +| 405 Method Not Allowed| `{"error": "method_not_allowed", "error_description": "..."}`| +| 429 Too Many Requests| `{"error": "too_many_requests", "error_description": "..."}`| +| 500 Internal Server Error | | +| 501 Not Implemented| `{"error": "unsupported_response_type", "error_description": "..."}`| +| 501 Not Implemented| `{"error": "unsupported_grant_type", "error_description": "..."}`| +| 503 Service Unavailable| `{"error": "temporarily_unavailable", "error_description": "..."}`| \ No newline at end of file diff --git a/articles/api/authentication/errors/_oauth-access_token.md b/articles/api/authentication/errors/_oauth-access_token.md index 6572e237b4..44b0f7541e 100644 --- a/articles/api/authentication/errors/_oauth-access_token.md +++ b/articles/api/authentication/errors/_oauth-access_token.md @@ -1,36 +1,10 @@ # POST /oauth/access_token - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    StatusResponse
    400{"error": "invalid_request", "error_description": "the connection was disabled"}
    The connection is not active or not enabled for your client_id
    400{"error": "invalid_request", "error_description": "the connection was not found"}
    400{"error": "invalid_request", "error_description": "missing client_id parameter"}
    400{"error": "invalid_request", "error_description": "missing access_token parameter"}
    401{"error": "invalid_request", "error_description": "invalid access_token: invalid_token"}
    The access_token is invalid or does not contain the scope you set
    403{"error": "unauthorized_client", "error_description": "invalid client"}
    +| Status | JSON Response | +| :--------------- |:------------- | +| 400 Bad Request | `{"error": "invalid_request", "error_description": "the connection was disabled"}`
    The connection is not active or not enabled for your `client_id`.| +| 400 Bad Request | `{"error": "invalid_request", "error_description": "the connection was not found"}` | +| 400 Bad Request | `{"error": "invalid_request", "error_description": "missing client_id parameter"}` | +| 400 Bad Request | `{"error": "invalid_request", "error_description": "missing access_token parameter"}` | +| 401 Unauthorized | `{"error": "invalid_request", "error_description": "invalid access_token: invalid_token"}`
    The `access_token` is invalid or does not contain the set `scope`| +| 403 Forbidden | `{"error": "unauthorized_client", "error_description": "invalid client"}` | \ No newline at end of file diff --git a/articles/api/authentication/errors/_oauth-revoke.md b/articles/api/authentication/errors/_oauth-revoke.md index 4f5ce06019..cbca1e2779 100644 --- a/articles/api/authentication/errors/_oauth-revoke.md +++ b/articles/api/authentication/errors/_oauth-revoke.md @@ -1,24 +1,7 @@ # POST /oauth/revoke - - - - - - - - - - - - - - - - - - - - - -
    StatusDescription
    200{"error": "invalid_request", "error_description": "..."}
    The Refresh Token is revoked, does not exist, or was not issued to the client making the revocation request.
    400{"error": "invalid_request", "error_description": "..."}
    The required parameters were not sent in the request.
    401<{"error": "invalid_client", "error_description": "..."}
    The request is not authorized. Check that the client credentials (client_id and client_secret) are present in the request and hold valid values.
    +| Status | JSON Response | +| :--------------- | :------------ | +|200 Success | `{"error": "invalid_request", "error_description": "..."}`
    The Refresh Token is revoked, does not exist, or was not issued to the client making the revocation request| +|400 Bad Request | `{"error": "invalid_request", "error_description": "..."}` The required parameters were not sent in the request.| +|401 Unauthorized | `{"error": "invalid_client", "error_description": "..."}`
    The request is not authorized. Check that the client credentials `client_id` and client_secret` are present in the request and hold valid values. | \ No newline at end of file diff --git a/articles/api/authentication/errors/_oauth-ro.md b/articles/api/authentication/errors/_oauth-ro.md index dc893be0d5..e552af873a 100644 --- a/articles/api/authentication/errors/_oauth-ro.md +++ b/articles/api/authentication/errors/_oauth-ro.md @@ -2,123 +2,33 @@ ## Grant type: jwt-bearer - - - - - - - - - - - - - - - - - - - - - -
    StatusDescription
    400{"error": "invalid_request", "error_description": "missing device parameter"}
    You need to provide a device name for the caller device (like a browser, app, and so on)
    400{"error": "invalid_request", "error_description": "missing id_token parameter"}
    For this grant type you need to provide a JWT ID Token
    400{"error": "invalid_grant", "error_description": "..."}
    Errors related to an invalid ID Token or user
    +| Status | JSON Response | +| :----------------| :------------ | +|400 Bad Request|`{"error": "invalid_request", "error_description": "missing device parameter"}`
    You need to provide a device name for the caller device (like a browser, app, and so on) | +|400 Bad Request|`{"error": "invalid_request", "error_description": "missing id_token parameter"}`
    For this grant type you need to provide a JWT ID Token | +|400 Bad Request|`{"error": "invalid_grant", "error_description": "..."}`
    Errors related to an invalid ID Token or user | ## Grant type: password - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    StatusDescription
    400{"error": "invalid_request", "error_description": "missing username parameter"}
    400{"error": "invalid_request", "error_description": "missing password parameter"}
    400{"error": "invalid_request", "error_description": "missing connection parameter"}
    400{"error": "invalid_request", "error_description": "scope parameter must be a string"}
    Incorrect scope formatting; each scope must be separated by whitespace
    400{"error": "invalid_request", "error_description": "specified strategy does not support requested operation"}
    The connection/provider does not implement username/password authentication
    401{"error": "invalid_user_password", "error_description": "Wrong email or password."}
    401{"error": "unauthorized", "error_description": "user is blocked"}
    401{ "error": "password_leaked", "error_description": "This login has been blocked because your password has been leaked in another website. We’ve sent you an email with instructions on how to unblock it."}
    429{"error": "too_many_attempts", "error_description": "..."}
    Some anomaly detections will return this error
    429{"error": "too_many_logins", "error_description": "..."}
    Some anomaly detections will return this error
    +| Status | JSON Response | +| :----------------| :------------ | +| 400 Bad Request|`{"error": "invalid_request", "error_description": "scope parameter must be a string"}`
    Incorrect scope formatting; each scope must be separated by whitespace| +| 400 Bad Request|`{"error": "invalid_request", "error_description": "specified strategy does not support requested operation"}`
    The connection/provider does not implement username/password authentication | +| 401 Unauthorized|`{"error": "invalid_user_password", "error_description": "Wrong email or password."}`| +| 401 Unauthorized|`{"error": "unauthorized", "error_description": "user is blocked"}`| +| 401 Unauthorized|`{ "error": "password_leaked", "error_description": "This login has been blocked because your password has been leaked in another website. We’ve sent you an email with instructions on how to unblock it."}`| +| 401 Unauthorized|`{ "error": "requires_verification", "error_description": "Suspicious request requires verification" }`| +| 429 Too Many Requests|`{"error": "too_many_attempts", "error_description": "..."}`
    Some attack protection features will return this error| +| 429 Too Many Requests|`{"error": "too_many_logins", "error_description": "..."}`
    Some attack protection features will return this error| ## All grant types - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    StatusDescription
    400{"error": "invalid_request", "error_description": "missing client_id parameter"}
    400{"error": "invalid_request", "error_description": "the connection was not found"}
    400{"error": "invalid_request", "error_description": "the connection was disabled"}
    Check the connection in the dashboard, you may have turned it off for the provided client_id
    400{"error": "invalid_request", "error_description": "The connection is not yet configured..."}
    The connection is not properly configured with custom scripts
    400{"error": "invalid_request", "error_description": "the connection was not found for tenant..."}
    The connection does not belong to the tenant; check your base url
    400{"error": "invalid_request", "error_description": "Fields with "." are not allowed, please remove all dotted fields..."}
    If you are using rules, some field name contains dots
    403{"error": "unauthorized_client", "error_description": "invalid client"}
    The provided client_id is not valid
    403{"error": "access_denied", "error_description": "..."}
    Validation of specific points raised an access issue
    +| Status | JSON Response | +| :--------------- | :----------- | +| 400 Bad Request |`{"error": "invalid_request", "error_description": "missing client_id parameter"}<`| +| 400 Bad Request |`{"error": "invalid_request", "error_description": "the connection was disabled"}`
    Check the connection in the dashboard, you may have turned it off for the provided `client_id` | +| 400 Bad Request |`{"error": "invalid_request", "error_description": "The connection is not yet configured..."}`
    The connection is not properly configured with custom scripts| +| 400 Bad Request |`{"error": "invalid_request", "error_description": "the connection was not found for tenant..."}`
    The connection does not belong to the tenant; check your base url | +| 400 Bad Request |`{"error": "invalid_request", "error_description": "Fields with "." are not allowed, please remove all dotted fields..."}`
    If you are using rules, some field name contains dots | +| 403 Forbidden |`{"error": "unauthorized_client", "error_description": "invalid client"}`
    The provided `client_id` is not valid | +| 403 Forbidden |`{"error": "access_denied", "error_description": "..."}`
    Validation of specific points raised an access issue | \ No newline at end of file diff --git a/articles/api/authentication/errors/_passwordless-start.md b/articles/api/authentication/errors/_passwordless-start.md index 15814aa9ac..348b707a16 100644 --- a/articles/api/authentication/errors/_passwordless-start.md +++ b/articles/api/authentication/errors/_passwordless-start.md @@ -1,56 +1,25 @@ + # POST /passwordless/start - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    StatusResponse
    400{"error": "bad.tenant","error_description": "error in tenant - tenant validation failed: invalid_tenant"}
    400{"error": "bad.client_id", "error_description": "Missing required property: client_id"}
    400{"error": "bad.connection", "error_description": "Missing required property: connection"}
    400{"error": "bad.connection", "error_description": "Connection does not exist"}
    400{"error": "bad.connection", "error_description": "Connection is disabled"}
    400{"error": "bad.connection", "error_description": "Invalid connection strategy. It must either be a passwordless connection"}
    400{"error": "bad.authParams", "error_description": "error in authParams - invalid type: string (expected object)"}
    400{"error": "bad.request", "error_description": "the following properties are not allowed: "}
    400{"error": "bad.phone_number", "error_description": "Missing required property: phone_number"}
    400{"error": "bad.phone_number", "error_description": "String does not match pattern: ^\\+[0-9]{1,15}$"}
    400{"error": "sms_provider_error", "error_description": " (Code: )"}
    +| Status | JSON Response | +| :----------------| :------------ | +|400 Bad Request|`{"error": "bad.tenant","error_description": "error in tenant - tenant validation failed: invalid_tenant"}`| +|400 Bad Request|`{"error": "bad.client_id", "error_description": "Missing required property: client_id"}`| +|400 Bad Request|`{"error": "bad.connection", "error_description": "Missing required property: connection"}`| +|400 Bad Request|`{"error": "bad.connection", "error_description": "Connection does not exist"}`| +|400 Bad Request|`{"error": "bad.connection", "error_description": "Connection is disabled"}`| +|400 Bad Request|`{"error": "bad.connection", "error_description": "Invalid connection strategy. It must either be a passwordless connection"}`| +|400 Bad Request|`{"error": "bad.authParams", "error_description": "error in authParams - invalid type: string (expected object)"}`| +|400 Bad Request|`{"error": "bad.request", "error_description": "the following properties are not allowed: "}`| +|400 Bad Request|`{"error": "bad.phone_number", "error_description": "Missing required property: phone_number"}`| +|400 Bad Request|`{"error": "bad.phone_number", "error_description": "String does not match pattern: ^\\+[0-9]{1,15}$"}`| +|400 Bad Request|`{"error": "sms_provider_error", "error_description": " (Code: )"}`| +|400 Bad Request|`{"error": "invalid_request","error_description": "Expected `auth0-forwarded-for` header to be a valid IP address."}`| +|400 Bad Request|`{"error": "bad.tenant","error_description": "error in tenant - could not find tenant in params"}`| +|400 Bad Request|`{"error": "server_error","error_description": "error resolving client"}`| +|400 Bad Request|`{"error": "invalid_request","error_description": "The client_id in the authentication header does not match the client_id in the payload"}`| +|400 Bad Request|`{"error": "bad.connection","error_description": "Public signup is disabled"}`| +|400 Bad Request|`{"error": "bad.connection","error_description": "Unknown error"}`| +|401 Unauthorized|`{"error": "server_error","error_description": "user is blocked"}`| +|403 Forbidden|`{"error": "unauthorized_client","error_description": "Client authentication is required"}`| +|500 Internal Server Error|`{"error": "server_error","error_description": "IdP Error"}`| \ No newline at end of file diff --git a/articles/api/authentication/errors/_passwordless-verify.md b/articles/api/authentication/errors/_passwordless-verify.md new file mode 100644 index 0000000000..1ea71461b4 --- /dev/null +++ b/articles/api/authentication/errors/_passwordless-verify.md @@ -0,0 +1,22 @@ +# POST /passwordless/verify + +| Status | JSON Response | +| :----------------| :------------ | +|400 Bad Request|`{"error": "invalid_request", "error_description": "missing username parameter"}`| +|400 Bad Request|`{"error": "invalid_request", "error_description": "scope parameter must be a string"}`
    Incorrect scope formatting; each scope must be separated by whitespace| +|400 Bad Request|`{"error": "invalid_request", "error_description": "missing client_id parameter"}`| +|400 Bad Request|`{"error": "invalid_request", "error_description": "the connection was not found"}`| +|400 Bad Request|`{"error": "invalid_request", "error_description": "the connection was disabled"}`
    Check the connection in the dashboard, you may have turned it off for the provided `client_id`| +|400 Bad Request|`{"error": "invalid_request", "error_description": "the connection was not found for tenant..."}`
    The connection does not belong to the tenant; check your base url| +|400 Bad Request|`{"error": "invalid_request", "error_description": "Fields with "." are not allowed, please remove all dotted fields..."}`
    If you are using rules, some field name contains dots| +|400 Bad Request|`"error": "bad.tenant","error_description": "error in tenant - could not find tenant in params"`| +|400 Bad Request|`{"error": "bad.tenant","error_description": "error in tenant - tenant validation failed: "}`| +|400 Bad Request|`{"error": "bad.connection","error_description": "Connection does not exist"}`| +|400 Bad Request|`{"error": "bad.connection","error_description": "Invalid connection strategy. It must either be a passwordless connection"}`| +|400 Bad Request|`{"error": "bad.connection","error_description": "The connection is disabled"}`| +|401 Unauthorized|`{"error": "invalid_user_password", "error_description": "Wrong email or password."}`| +|401 Unauthorized|`{"error": "unauthorized", "error_description": "user is blocked"}`| +|403 Forbidden|`{"error": "unauthorized_client", "error_description": "invalid client"}`
    The provided `client_id` is not valid| +|403 Forbidden|`{"error": "access_denied", "error_description": "..."}`
    Validation of specific points raised an access issue| +|429 Too Many Requests|`{"error": "too_many_attempts", "error_description": "..."}`
    Some attack protection features will return this error| +|500 Bad Request|`{"error": "server_error","error_description": "..."}`| \ No newline at end of file diff --git a/articles/api/authentication/index.md b/articles/api/authentication/index.md index c8a0688ee1..3edd4a539a 100644 --- a/articles/api/authentication/index.md +++ b/articles/api/authentication/index.md @@ -55,10 +55,34 @@ contentType: <%= include('./api-authz/_authz-client') %>
    - <%= include('./api-authz/_get-token') %> + <%= include('./api-authz/_auth-code-flow') %>
    - <%= include('./api-authz/_revoke-refersh-token') %> + <%= include('./api-authz/_auth-code-pkce') %>> +
    +
    + <%= include('./api-authz/_highly-regulated') %>> +
    +
    + <%= include('./api-authz/_client-credential') %>> +
    +
    + <%= include('./api-authz/_implicit') %>> +
    +
    + <%= include('./api-authz/_resource-owner.md') %>> +
    +
    + <%= include('./api-authz/_device-code') %> +
    +
    + <%= include('./api-authz/_refresh-token') %> +
    +
    +<%= include('./api-authz/_revoke-refresh-token') %> +
    +
    +<%= include('./api-authz/_token-exchange-native-social') %>
    Legacy @@ -92,8 +116,13 @@ contentType: <%= include('./errors/_oauth-access_token') %>
    - <%= include('./errors/_oauth-ro') %> +<%= include('./errors/_oauth-ro') %>
    <%= include('./errors/_passwordless-start') %>
    +
    + <%= include('./errors/_passwordless-verify') %> +
    + + diff --git a/articles/api/authentication/legacy/_delegation.md b/articles/api/authentication/legacy/_delegation.md index bd76622a13..a173755d24 100644 --- a/articles/api/authentication/legacy/_delegation.md +++ b/articles/api/authentication/legacy/_delegation.md @@ -1,5 +1,3 @@ - - # Delegation ```http @@ -35,7 +33,7 @@ curl --request POST \ }) %> ::: warning -This feature is disabled by default for new tenants as of 8 June 2017. See the [migration notice](/migrations#api-authorization-with-third-party-vendor-apis) for more information. +By default, this feature is disabled for tenants without an add-on in use as of 8 June 2017. Legacy tenants who currently use an add-on that requires delegation may continue to use this feature. If delegation functionality is changed or removed from service at some point, customers who currently use it will be notified beforehand and given ample time to migrate. ::: A delegation token can be obtained and used when an application needs to call the API of an Application Addon, such as Firebase or SAP, registered and configured in Auth0, in the same tenant as the calling program. @@ -49,25 +47,10 @@ Given an existing token, this endpoint will generate a new token signed with the | `client_id`
    Required | Τhe `client_id` of your app | | `grant_type`
    Required | Use `urn:ietf:params:oauth:grant-type:jwt-bearer`| | `id_token` or `refresh_token`
    Required | The existing token of the user. | -| `target ` | The target `client_id` | -| `scope ` | Use `openid` or `openid profile email` | +| `target` | The target `client_id` | +| `scope` | Use `openid` or `openid profile email` | | `api_type` | The API to be called. | -### Test with Postman - -<%= include('../../../_includes/_test-with-postman') %> - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Application** field to the app you want to use for the test. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the fields **ID Token**, **Refresh Token** and **Target Client ID**. Click **Delegation**. - - ### Remarks - The `profile` scope value requests access to the End-User's default profile Claims, which are: `name`, `family_name`, `given_name`, `middle_name`, `nickname`, `preferred_username`, `profile`, `picture`, `website`, `gender`, `birthdate`, `zoneinfo`, `locale`, and `updated_at`. @@ -84,8 +67,7 @@ Given an existing token, this endpoint will generate a new token signed with the - `X-RateLimit-Reset`: Remaining time until the rate limit (`X-RateLimit-Limit`) resets. The value is in [UTC epoch seconds](https://en.wikipedia.org/wiki/Unix_time). -### More Information +### Learn More - [Delegation Tokens](/tokens/delegation) - -- [Auth0 API Rate Limit Policy](/policies/rate-limits) +- [Auth0 API Rate Limit Policy](/policies/rate-limits) \ No newline at end of file diff --git a/articles/api/authentication/legacy/_impersonation.md b/articles/api/authentication/legacy/_impersonation.md index 20cda3b7df..6fd286a04f 100644 --- a/articles/api/authentication/legacy/_impersonation.md +++ b/articles/api/authentication/legacy/_impersonation.md @@ -78,9 +78,4 @@ Use this endpoint to obtain an impersonation URL to login as another user. Usefu - To distinguish between real logins and impersonation logins, the profile of the impersonated user will contain additional impersonated and impersonator properties. For example: `"impersonated": true, "impersonator": {"user_id": "auth0|...", "email": "admin@example.com"}`. -- For a regular web app, you should set the `additionalParameters`: set the `response_type` to be `code`, the `callback_url` to be the callback url to which Auth0 will redirect with the authorization code, and the `scope` to be the JWT claims that you want included in the JWT. - - -### More Information - -- [Impersonation](/user-profile/user-impersonation) +- For a regular web app, you should set the `additionalParameters`: set the `response_type` to be `code`, the `callback_url` to be the callback URL to which Auth0 will redirect with the authorization code, and the `scope` to be the JWT claims that you want included in the JWT. diff --git a/articles/api/authentication/legacy/_linking.md b/articles/api/authentication/legacy/_linking.md index 5362ebf5ed..0e4b6657ce 100644 --- a/articles/api/authentication/legacy/_linking.md +++ b/articles/api/authentication/legacy/_linking.md @@ -1,7 +1,10 @@ # Account Linking - ## Link +::: warning +This endpoint is **deprecated** for account linking. The [POST /api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities) should be used instead. For more information refer to the [Migration Notice](/migrations/past-migrations#account-linking-removal). +::: + ```http GET https://${account.namespace}/authorize? response_type=code|token& @@ -18,13 +21,9 @@ GET https://${account.namespace}/authorize? "link": "#link" }) %> -::: warning -This endpoint is **deprecated** for account linking. The [POST /api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities) should be used instead. For more information refer to the [Migration Notice](/migrations/past-migrations#account-linking-removal). -::: - Call this endpoint when a user wants to link a second authentication method (for example, a user/password database connection, with Facebook). -This endpoint will trigger the login flow to link an existing account with a new one. This will return a 302 redirect to the `connection` that the current user wants to add. The user is identified by the Access Token that was returned on login success. +This endpoint will trigger the login flow to link an existing account with a new one. This will return a 302 redirect to the `connection` that the current user wants to add. The user is identified by the Access Token that was returned on login success. ### Request Parameters @@ -40,14 +39,14 @@ This endpoint will trigger the login flow to link an existing account with a new ### Remarks -- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). +- The `redirect_uri` value must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). -### More Information +### Learn More -- [Linking Accounts](/link-accounts) -- [User Initiated Account Linking](/link-accounts/user-initiated-linking) -- [Account Linking from Server Side Code](/link-accounts/suggested-linking) +- [Link User Accounts](/users/guides/link-user-accounts) +- [Link User Accounts Initiated by Users Scenario](/users/references/link-accounts-user-initiated-scenario) +- [Link User Accounts Server-Side Scenario](/users/references/link-accounts-server-side-scenario) ## Unlink @@ -95,7 +94,7 @@ xhr.send(params); }) %> ::: warning -This endpoint is **deprecated**. The [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_provider_by_user_id) should be used instead. +This endpoint is **deprecated**. The [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_user_identity_by_user_id) should be used instead. ::: Given a logged-in user's `access_token` and `user_id`, this endpoint will unlink a user's account from the identity provider. @@ -105,15 +104,10 @@ Given a logged-in user's `access_token` and `user_id`, this endpoint will unlink | Parameter | Description | |:-----------------|:------------| -| `access_token`
    Required | The logged-in user's Access Token | +| `access_token`
    Required | The logged-in user's Access Token | | `user_id`
    Required | The logged-in user's `user_id` | -### Test with Postman - -<%= include('../../../_includes/_test-with-postman') %> - - -### More Information +### Learn More -- [Unlinking Accounts](/link-accounts#unlinking-accounts) +- [Unlink User Accounts](/users/guides/unlink-user-accounts) diff --git a/articles/api/authentication/legacy/_login.md b/articles/api/authentication/legacy/_login.md index c82b992fed..4c197080e9 100644 --- a/articles/api/authentication/legacy/_login.md +++ b/articles/api/authentication/legacy/_login.md @@ -1,7 +1,5 @@ - # Login - ## Social with Provider's Access Token ```http @@ -62,11 +60,11 @@ xhr.send(params); ::: warning This endpoint is part of the legacy authentication pipeline. We recommend that you open the browser to do social authentication instead, which is what [Google and Facebook are recommending](https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html). For more information on the latest authentication pipeline refer to [Introducing OIDC Conformant Authentication](/api-auth/intro). -This feature is disabled by default for new tenants as of 8 June 2017. Please see [Application Grant Types](/applications/application-grant-types) for more information. +This feature is disabled by default for new tenants as of 8 June 2017. Please see [Application Grant Types](/applications/concepts/application-grant-types) for more information. ::: -Given the social provider's Access Token and the `connection`, this endpoint will authenticate the user with the provider and return a JSON with the Access Token and, optionally, an ID Token. This endpoint only works for Facebook, Google, Twitter, and Weibo. +Given the social provider's Access Token and the `connection`, this endpoint will authenticate the user with the provider and return a JSON with the Access Token and, optionally, an ID Token. This endpoint only works for Facebook, Google, Twitter, and Weibo. ### Request Parameters @@ -75,11 +73,8 @@ Given the social provider's Access Token and the `connection`, this endpoint wil | `client_id`
    Required | The `client_id` of your application. | | `access_token`
    Required | The social provider's Access Token. | | `connection`
    Required | The name of an identity provider configured to your app. | -| `scope` | Use `openid` to get an ID Token, or `openid profile email` to include user information in the ID Token. If null, only an Access Token will be returned. | +| `scope` | Use `openid` to get an ID Token, or `openid profile email` to include user information in the ID Token. If null, only an Access Token will be returned. | -### Test with Postman - -<%= include('../../../_includes/_test-with-postman') %> ### Remarks @@ -91,13 +86,11 @@ Given the social provider's Access Token and the `connection`, this endpoint wil For the complete error code reference for this endpoint refer to [Errors > POST /oauth/access_token](#post-oauth-access_token). -### More Information +### Learn More - [Call an Identity Provider API](/tutorials/calling-an-external-idp-api) - -- [Identity Provider Access Tokens](/tokens/idp) - -- [Add scopes/permissions to call Identity Provider's APIs](/tutorials/adding-scopes-for-an-external-idp) +- [Identity Provider Access Tokens](/tokens/overview-idp-access-tokens) +- [Add scopes/permissions to call Identity Provider's APIs](/connections/adding-scopes-for-an-external-idp) ## Database/AD/LDAP (Active) @@ -169,7 +162,7 @@ curl --request POST \ This endpoint is part of the legacy authentication pipeline and has been replaced in favor of the [Password Grant](#resource-owner-password). For more information on the latest authentication pipeline refer to [Introducing OIDC Conformant Authentication](/api-auth/intro). ::: -Use this endpoint for API-based (active) authentication. Given the user credentials and the `connection` specified, it will do the authentication on the provider and return a JSON with the Access Token and ID Token. +Use this endpoint for API-based (active) authentication. Given the user credentials and the `connection` specified, it will do the authentication on the provider and return a JSON with the Access Token and ID Token. ### Request Parameters @@ -179,29 +172,14 @@ Use this endpoint for API-based (active) authentication. Given the user credenti | `username`
    Required | Username/email of the user to login | | `password`
    Required | Password of the user to login | | `connection`
    Required | The name of the connection to use for login | -| `scope` | Set to `openid` to retrieve also an ID Token, leave null to get only an Access Token | -| `grant_type`
    Required | Set to `password` to authenticate using username/password or `urn:ietf:params:oauth:grant-type:jwt-bearer` to authenticate using an ID Token (used to [Authenticate users with Touch ID](/connections/passwordless/ios-touch-id-swift)) | +| `scope` | Set to `openid` to retrieve also an ID Token, leave null to get only an Access Token | +| `grant_type`
    Required | Set to `password` to authenticate using username/password or `urn:ietf:params:oauth:grant-type:jwt-bearer` to authenticate using an ID Token instead of username/password, in [Touch ID](/libraries/lock-ios/touchid-authentication) scenarios. | | `device` | String value. Required when `grant_type` is `urn:ietf:params:oauth:grant-type:jwt-bearer` | | `id_token` | Used to authenticate using a token instead of username/password, in [Touch ID](/libraries/lock-ios/touchid-authentication) scenarios. Required when `grant_type` is `urn:ietf:params:oauth:grant-type:jwt-bearer` | -### Test with Postman - -<%= include('../../../_includes/_test-with-postman') %> - -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the fields **Application** (select the application you want to use for the test) and **Connection** (the name of the social connection to use). - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set **Username** and **Password**. Click **Resource Owner Endpoint**. - - ### Remarks -- This endpoint only works for database connections, passwordless connections, Active Directory/LDAP, Windows Azure AD and ADFS. +- This endpoint only works for database connections, passwordless connections, Active Directory/LDAP, Windows Azure AD and ADFS. - The main difference between passive and active authentication is that the former happens in the browser through the [Auth0 Login Page](https://${account.namespace}/login) and the latter can be invoked from anywhere (a script, server to server, and so forth). @@ -210,14 +188,10 @@ Use this endpoint for API-based (active) authentication. Given the user credenti ### Error Codes -For the complete error code reference for this endpoint refer to [Errors > POST /oauth/ro](#post-oauth-ro). +For the complete error code reference for this endpoint, refer to [Errors > POST /oauth/ro](#post-oauth-ro). -### More Information +### Learn More - [Database Identity Providers](/connections/database) - -- [Rate Limits on User/Password Authentication](/connections/database/rate-limits) - -- [Active Directory/LDAP Connector](/connector) - -- [Authenticate users with Touch ID](/connections/passwordless/ios-touch-id-swift) +- [Rate Limits on User/Password Authentication](/policies/rate-limit-policy/database-connections-rate-limits) +- [Active Directory/LDAP Connector](/connector) \ No newline at end of file diff --git a/articles/api/authentication/legacy/_resource-owner.md b/articles/api/authentication/legacy/_resource-owner.md index 10de163e0e..d191536587 100644 --- a/articles/api/authentication/legacy/_resource-owner.md +++ b/articles/api/authentication/legacy/_resource-owner.md @@ -65,10 +65,10 @@ request(options, function (error, response, body) { }) %> ::: warning -This endpoint is part of the legacy authentication pipeline and has been replaced in favor of the [Password Grant](#resource-owner-password). For more information on the latest authentication pipeline refer to [Introducing OIDC Conformant Authentication](/api-auth/intro). +This endpoint is part of the legacy authentication pipeline and has been replaced in favor of the [Password Grant](#resource-owner-password-flow). For more information on the latest authentication pipeline refer to [Introducing OIDC Conformant Authentication](/api-auth/intro). ::: -Given the user's credentials, this endpoint will authenticate the user with the provider and return a JSON object with the Access Token and an ID Token. +Given the user's credentials, this endpoint will authenticate the user with the provider and return a JSON object with the Access Token and an ID Token. ### Request Parameters @@ -79,23 +79,13 @@ Given the user's credentials, this endpoint will authenticate the user with the | `grant_type`
    Required | Use the value `password` | | `username`
    Required | The user's username | | `password`
    Required | The user's password | -| `scope` | Use `openid` to get an ID Token, `openid profile email` to get an ID Token and the user profile, or `openid offline_access` to get an ID Token and a Refresh Token. | +| `scope` | Use `openid` to get an ID Token, `openid profile email` to get an ID Token and the user profile, or `openid offline_access` to get an ID Token and a Refresh Token. | | `id_token` | Used to authenticate using a token instead of username/password, in [Touch ID](/libraries/lock-ios/touchid-authentication) scenarios. | | `device` | You should set this to a string, if you are requesting a Refresh Token (`scope=offline_access`). | -### Test with Authentication API Debugger - -<%= include('../../../_includes/_test-this-endpoint') %> - -1. At the *Configuration* tab, set the **Application** field to the application you want to use for the test, and **Connection** to the name of the connection to use. - -1. Copy the **Callback URL** and set it as part of the **Allowed Callback URLs** of your [Application Settings](${manage_url}/#/applications). - -1. At the *OAuth2 / OIDC* tab, set the **Username** and **Password**, and click **Resource Owner Endpoint**. - ### Remarks -- This endpoint only works for database connections, passwordless connections, Active Directory/LDAP, Windows Azure AD and ADFS. +- This endpoint only works for database connections, passwordless connections, Active Directory/LDAP, Windows Azure AD and ADFS. - The `profile` scope value requests access to the End-User's default profile Claims, which are: `name`, `family_name`, `given_name`, `middle_name`, `nickname`, `preferred_username`, `profile`, `picture`, `website`, `gender`, `birthdate`, `zoneinfo`, `locale`, and `updated_at`. @@ -105,6 +95,6 @@ Given the user's credentials, this endpoint will authenticate the user with the For the complete error code reference for this endpoint refer to [Errors > POST /oauth/ro](#post-oauth-ro). -### More Information +### Learn More - [Calling APIs from Highly Trusted Applications](/api-auth/grant/password) diff --git a/articles/api/authentication/legacy/_userinfo.md b/articles/api/authentication/legacy/_userinfo.md index 0f7b8d23d7..d35e12a99e 100644 --- a/articles/api/authentication/legacy/_userinfo.md +++ b/articles/api/authentication/legacy/_userinfo.md @@ -1,5 +1,6 @@ -# User Profile + +# User Profile ## Get Token Info ```http @@ -73,7 +74,7 @@ webAuth.parseHash(window.location.hash, function(err, authResult) { This endpoint is part of the legacy authentication pipeline and will be disabled for those who use our latest, OIDC conformant, pipeline. We encourage using the [/userinfo endpoint](#get-user-info) instead. For more information on the latest authentication pipeline refer to [Introducing OIDC Conformant Authentication](/api-auth/intro). ::: -This endpoint validates a JSON Web Token (signature and expiration) and returns the user information associated with the user id `sub` property of the token. +This endpoint validates a JSON Web Token (JWT) (signature and expiration) and returns the user information associated with the user id `sub` property of the token. ### Request Parameters @@ -81,9 +82,6 @@ This endpoint validates a JSON Web Token (signature and expiration) and returns |:-----------------|:------------| | `id_token`
    Required | The ID Token to use. | -### Test with Postman - -<%= include('../../../_includes/_test-with-postman') %> ### Remarks @@ -92,8 +90,8 @@ This endpoint validates a JSON Web Token (signature and expiration) and returns - `X-RateLimit-Remaining`: Number of requests available. Each new request reduces this number by 1. For each minute that passes, requests are added back, so this number increases by 1 each time. - `X-RateLimit-Reset`: Remaining time until the rate limit (`X-RateLimit-Limit`) resets. The value is in [UTC epoch seconds](https://en.wikipedia.org/wiki/Unix_time). -### More Information +### Learn More -- [User Profile: In-Depth Details - API](/user-profile/user-profile-details#api) +- [User Profile Struture](/users/references/user-profile-structure) - [Auth0 API Rate Limit Policy](/policies/rate-limits) diff --git a/articles/api/authorization-extension/_groups.md b/articles/api/authorization-extension/_groups.md index b797a346fc..17bc41355c 100644 --- a/articles/api/authorization-extension/_groups.md +++ b/articles/api/authorization-extension/_groups.md @@ -69,7 +69,7 @@ Use this endpoint to retrieve all groups. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -107,11 +107,11 @@ include('../../_includes/_http-method', { "link": "#get-single-group" }) %> -Use this endpoint to get a single group based on its unique identifier. Add "?expand" to also load all roles and permissions for this group. +Use this endpoint to get a single group based on its unique identifier. Add "?expand" to also load all roles and permissions for this group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -161,7 +161,7 @@ Use this endpoint to create a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: create:groups @@ -209,7 +209,7 @@ Use this endpoint to delete a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: delete:groups @@ -264,7 +264,7 @@ Use this endpoint to update the name or the description of a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -309,7 +309,7 @@ Use this endpoint to retrieve the mappings of a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -336,10 +336,11 @@ Authorization: 'Bearer {access_token}' ``` ```shell -curl --request PUT \ - --url 'https://{extension_url}/groups/{group_id}/mappings' \ +curl -v -X PATCH \ + --url 'https://{extension_url}/api/groups/{group_id}/mappings' \ + --header 'Content-Type: application/json' \ --header 'Authorization: Bearer {access_token}' \ - --data '{"groupName": "Test", "connectionName": "google-oauth2"}' + --data '[{"groupName": "Test", "connectionName": "google-oauth2"}]' ``` > RESPONSE SAMPLE: @@ -349,17 +350,17 @@ curl --request PUT \ ```
    - PUT + PATCH /groups/{group_id}/mappings
    Use this endpoint to create one or more mappings in a group. -Group Mappings allow you to dynamically "add" users to different Groups based on the users' Connections. Essentially, using the Connection and the Groups information provided by the Identity Provider, you can dynamically make the user a member of the group in which you've created the appropriate mapping. For more information, refer to [Group Mappings](/extensions/authorization-extension/v2#group-mappings). +Group Mappings allow you to dynamically "add" users to different Groups based on the users' Connections. Essentially, using the Connection and the Groups information provided by the Identity Provider, you can dynamically make the user a member of the group in which you've created the appropriate mapping. For more information, refer to [Group Mappings](/extensions/authorization-extension/v2/implementation/setup#group-mappings). ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -414,7 +415,7 @@ Use this endpoint to delete one or more group mappings from a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -423,7 +424,7 @@ The [Access Token](#get-an-access-token) should have the following scopes: | Parameter | Description | |:-----------------|:------------| | `{extension_url}`
    Required | The URL of your Authorization Extension. For more info, see [Find your extension URL](#find-your-extension-url) | -| `{access_token}`
    Required | The token your application retrieved from Auth0 in order to access the API. For more information on how to implement this, refer to our [Client Credentials implementation guide](/api-auth/tutorials/client-credentials) | +| `{access_token}`
    Required | The token your application retrieved from Auth0 in order to access the API. For more information on how to implement this, refer to our [machine-to-machine flow implementation guide](/flows/guides/client-credentials/call-api-client-credentials) | | `{group_id}`
    Required | The id of the group whose mappings you want to delete | ## Get Group Members @@ -488,7 +489,7 @@ Use this endpoint to get the members for a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -540,7 +541,7 @@ Use this endpoint to add one or more members in a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -590,7 +591,7 @@ Use this endpoint to remove one or more members from a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -646,7 +647,7 @@ Use this endpoint to get the nested members for a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -696,7 +697,7 @@ Use this endpoint to get the nested groups for a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -746,7 +747,7 @@ Use this endpoint to add nested groups. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -796,7 +797,7 @@ Use this endpoint to remove one or more nested groups. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -847,7 +848,7 @@ Use this endpoint to get the roles for a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -896,7 +897,7 @@ Use this endpoint to add roles to a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -946,7 +947,7 @@ Use this endpoint to remove one or more groups roles. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -1024,7 +1025,7 @@ Use this endpoint to get the nested roles for a group. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups diff --git a/articles/api/authorization-extension/_introduction.md b/articles/api/authorization-extension/_introduction.md index a4e3d3f5e0..973481dac2 100644 --- a/articles/api/authorization-extension/_introduction.md +++ b/articles/api/authorization-extension/_introduction.md @@ -2,12 +2,12 @@ The Authorization Extension API enables you to: -- automate provisioning for your users, roles, groups, and permissions +- automate provisioning for your users, roles, groups, and permissions - query the authorization context of your users in real time In order to use it, you first have to [enable API access](/extensions/authorization-extension/v2#enable-api-access) from your Authorization Dashboard. -For more information on the Authorization Extension and how to configure it refer to [Auth0 Authorization Extension](/extensions/authorization-extension). +For more information on the Authorization Extension and how to configure it, refer to [Auth0 Authorization Extension](/extensions/authorization-extension). For each endpoint in this explorer, you will find sample snippets you can use, in three available formats: @@ -19,7 +19,7 @@ Each request should be sent with a Content-Type of `application/json`. ## Find your extension URL -All endpoints in this explorer, start with `https://{extension_url}`. This is the URL of your Authorization Dashboard. It differs based on you tenant's region: +All endpoints in this explorer start with `https://{extension_url}`. This is the URL of your Authorization Dashboard. It differs based on you tenant's region: <% var urlUS = 'https://' + account.tenant + '.us.webtask.io/adf6e2f2b84784b57522e3b19dfc9201/api'; @@ -37,15 +37,15 @@ All endpoints in this explorer, start with `https://{extension_url}`. This is th When you [enabled API access for your tenant](/extensions/authorization-extension/v2#enable-api-access), an API was created at your [dashboard](${manage_url}), which you can use to access the Authorization Extension API. -To do so you will have to configure a machine to machine application which will have access to this API and which you will use to get an [Access Token](/tokens/access-token). +To do so you will have to configure a machine to machine application which will have access to this API and which you will use to get an Access Token. -Follow these steps to setup your application (you will have to do this only once): +Follow these steps to set up your application (you will have to do this only once): 1. Go to [Dashboard > Applications](${manage_url}/#/applications) and create a new application of type `Machine to Machine`. 2. Go to the [Dashboard > APIs](${manage_url}/#/apis) and select the `auth0-authorization-extension-api`. 3. Go to the `Machine to Machine Applications` tab, find the application you created at the first step, and toggle the `Unauthorized` to `Authorized`. -4. Select the [scopes](/scopes#api-scopes) that should be granted to your application, based on the endpoints you want to access. For example, `read:users` to [get all users](#get-all-users). +4. Select the [scopes](/scopes/current/api-scopes) that should be granted to your application, based on the endpoints you want to access. For example, `read:users` to [get all users](#get-all-users). -In order to get an Access Token you need to `POST` to the `/oauth/token` endpoint. You can find detailed instructions [here](/api-auth/tutorials/client-credentials#ask-for-a-token). +To get an Access Token, you need to `POST` to the `/oauth/token` endpoint. You can find detailed instructions [here](/flows/guides/client-credentials/call-api-client-credentials#request-token). Use this Access Token to access the Authorization Extension API. diff --git a/articles/api/authorization-extension/_permissions.md b/articles/api/authorization-extension/_permissions.md index d09449bd42..8c1c151fcf 100644 --- a/articles/api/authorization-extension/_permissions.md +++ b/articles/api/authorization-extension/_permissions.md @@ -1,6 +1,6 @@ # Permissions -Permissions are actions or functions that a user, or group of user, is allowed to do. For example, let's say that you have an application that allows employees to enter in company expenses. You want all employees to be able to submit expenses, but want certain Finance users to have more admin type of actions such as being able to approve or delete expenses. These actions can be mapped to [permissions](/extensions/authorization-extension#permissions) (which later on can be grouped in [roles](/extensions/authorization-extension#roles)): +Permissions are actions or functions that a user, or group of user, is allowed to do. For example, let's say that you have an application that allows employees to enter in company expenses. You want all employees to be able to submit expenses, but want certain Finance users to have more admin type of actions such as being able to approve or delete expenses. These actions can be mapped to [permissions](/extensions/authorization-extension#permissions) (which later on can be grouped in [roles](/extensions/authorization-extension#roles)): For more information, refer to [Auth0 Authorization Extension](/extensions/authorization-extension#permissions). @@ -41,7 +41,7 @@ Use this endpoint to retrieve all permissions. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:permissions @@ -83,7 +83,7 @@ Use this endpoint to get a single permission based on its unique identifier. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:permissions @@ -134,7 +134,7 @@ Use this endpoint to create a permission. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: create:permissions @@ -193,7 +193,7 @@ Use this endpoint to update the details of a permission. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:permissions @@ -243,7 +243,7 @@ Use this endpoint to remove a permission. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: delete:permissions diff --git a/articles/api/authorization-extension/_roles.md b/articles/api/authorization-extension/_roles.md index 172a23447d..45ca6b2d8c 100644 --- a/articles/api/authorization-extension/_roles.md +++ b/articles/api/authorization-extension/_roles.md @@ -1,6 +1,6 @@ # Roles -Roles are collections of permissions. For example, let's say that you have an application that allows employees to enter in company expenses. You want all employees to be able to submit expenses, but want certain Finance users to have more admin type of actions such as being able to approve or delete expenses. These actions can be mapped to [Permissions](/extensions/authorization-extension#permissions) and then assigned to a certain role. +Roles are collections of permissions. For example, let's say that you have an application that allows employees to enter in company expenses. You want all employees to be able to submit expenses, but want certain Finance users to have more admin type of actions such as being able to approve or delete expenses. These actions can be mapped to [Permissions](/extensions/authorization-extension#permissions) and then assigned to a certain role. For more information, refer to [Auth0 Authorization Extension](/extensions/authorization-extension#roles). @@ -54,7 +54,7 @@ Use this endpoint to retrieve all roles. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:roles @@ -96,7 +96,7 @@ Use this endpoint to get a single role based on its unique identifier. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:roles @@ -150,7 +150,7 @@ Use this endpoint to create a role. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: create:roles @@ -217,7 +217,7 @@ Use this endpoint to update the details of a role. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:roles @@ -268,7 +268,7 @@ Use this endpoint to remove a role. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: delete:roles diff --git a/articles/api/authorization-extension/_users.md b/articles/api/authorization-extension/_users.md index f3c2c7b28f..a2337dd9f2 100644 --- a/articles/api/authorization-extension/_users.md +++ b/articles/api/authorization-extension/_users.md @@ -1,6 +1,6 @@ # Users -These endpoints enable you to manage all the current users of your applications. You can retrieve their profile and edit or view their groups and their roles. +These endpoints enable you to manage all the current users of your applications. You can retrieve their profile and edit or view their groups and their roles. For more information, refer to [Auth0 Authorization Extension](/extensions/authorization-extension/v2#users). @@ -32,7 +32,7 @@ GET https://{extension_url}/users ], "user_id":"auth0|59091da1b3c34a15589c780d", "last_login":"2017-06-25T07:28:54.719Z", - "name":"dummy.user@example.com", + "name":"placeholder.user@example.com", "picture":"https://s.gravatar.com/avatar/your-gravatar.png", "email":"richard.dowinton@auth0.com" } @@ -53,7 +53,7 @@ Use this endpoint to retrieve all users. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:users @@ -78,11 +78,11 @@ GET https://{extension_url}/users/{user_id} ```text { - "email":"dummy.user@example.com", + "email":"placeholder.user@example.com", "email_verified":true, "user_id":"auth0|59091da1b3c34a15589c780d", "picture":"https://s.gravatar.com/avatar/your-gravatar.png", - "nickname":"dummy.user", + "nickname":"placeholder.user", "identities":[ { "user_id":"59091da1b3c34a15589c780d", @@ -93,7 +93,7 @@ GET https://{extension_url}/users/{user_id} ], "updated_at":"2017-06-25T07:28:54.719Z", "created_at":"2017-06-08T15:30:41.237Z", - "name":"dummy.user@example.com", + "name":"placeholder.user@example.com", "app_metadata":{ "authorization":{ "roles":[ @@ -123,7 +123,7 @@ Use this endpoint to get a single user based on its unique identifier. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:users @@ -173,7 +173,7 @@ Use this endpoint to get the groups of a single user, based on its unique identi ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:users @@ -219,11 +219,11 @@ include('../../_includes/_http-method', { "link": "#add-user-to-groups" }) %> -Use this endpoint to add one or more users in a group. +Use this endpoint to add a user to one or more groups. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:groups @@ -274,7 +274,7 @@ Use this endpoint to calculate the group memberships for a user (including neste ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:groups @@ -326,7 +326,7 @@ Use this endpoint to get the roles of a single user, based on its unique identif ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:users @@ -376,7 +376,7 @@ Use this endpoint to assign a role to a user. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:users @@ -414,7 +414,7 @@ curl --request DELETE \ (empty response body) ``` -<% var path = '/users/{role_id}/roles'; %> +<% var path = '/users/{user_id}/roles'; %> <%= include('../../_includes/_http-method', { "http_badge": "badge-danger", @@ -427,7 +427,7 @@ Use this endpoint to remove one or more user from a role. ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: update:roles @@ -438,7 +438,7 @@ The [Access Token](#get-an-access-token) should have the following scopes: | `{extension_url}`
    Required | The URL of your Authorization Extension. For more info, see [Find your extension URL](#find-your-extension-url) | | `{access_token}`
    Required | The token your client retrieved from Auth0 in order to access the API. For more info, see [Get an Access Token](#get-an-access-token) | | `{user_id}`
    Required | The id of the user you want to remove from roles | -| `{role_id}`
    Required | The id of the role(s) you want to remove users from | +| `body`
    Required | The id of the role(s) you want to remove users from (i.e. `[ "{role_id}" ]`) | ## Calculate Roles @@ -480,7 +480,7 @@ Use this endpoint to calculate the roles assigned to the user (including through ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:roles @@ -539,7 +539,7 @@ Use this endpoint to execute the authorization policy for a user in the context ### Scopes -The [Access Token](#get-an-access-token) should have the following scopes: +The [Access Token](#get-an-access-token) should have the following scopes: read:users @@ -548,8 +548,8 @@ The [Access Token](#get-an-access-token) should have the following scopes: | Parameter | Description | |:-----------------|:------------| | `{extension_url}`
    Required | The URL of your Authorization Extension. For more info, see [Find your extension URL](#find-your-extension-url) | -| `{access_token}`
    Required | The token your client retrieved from Auth0 in order to access the API. For more info, see [Get an Access Token](#get-an-access-token) | +| `{access_token}`
    Required | The token your client retrieved from Auth0 to access the API. For more info, see [Get an Access Token](#get-an-access-token) | | `{user_id}`
    Required | | | `{client_id}`
    Required | | -| `connectionName` | The connection name the user logged in with | +| `connectionName`
    Required | The name of the connection with which the user logged in | | `groups` | List of group names received from the IdP (AD, ADFS, and so on) | diff --git a/articles/api/info.md b/articles/api/info.md index 887674b880..44920523b6 100644 --- a/articles/api/info.md +++ b/articles/api/info.md @@ -1,5 +1,6 @@ --- -description: This page explains the basics of Auth0's Management and Authentication APIs. +title: Auth0 APIs +description: Learn about Auth0's Management and Authentication APIs. section: apis crews: crew-2 topics: @@ -9,22 +10,22 @@ topics: contentType: reference useCase: invoke-api --- - # Auth0 APIs -Auth0 exposes two APIs for developers to consume in their applications: +Auth0 exposes the following APIs for developers to consume in their applications. + +## Authentication API -* **Authentication**: Handles identity-related tasks; -* **Management**: Handles management of your Auth0 account, including functions related to (but not limited to): +The Authentication API exposes identity functionality for Auth0 and supported identity protocols (including OpenID Connect, OAuth, and SAML). - * Applications; - * Connections; - * Emails; - * Users. +Typically, you should consume this API through one of the Auth0 SDKs, such as [Auth0.js](/libraries/auth0js), or a library like [Lock](/libraries/lock). However, if you are building your authentication UI manually, you will need to call the Authentication API directly. -## Authentication API +Some example tasks include: -The Authentication API exposes Auth0 identity functionality, as well as those of supported identity protocols (such as OpenID Connect, OAuth, and SAML). Typically, you would consume this API through one of the Auth0 SDKs, such as [Auth0.js](/libraries/auth0js), or a library, like [Lock](/libraries/lock). If you are building your authentication UI manually, you would need to interface directly with the Authentication API. +* Get [tokens](/tokens) during authentication +* Request a user's profile using an [Access Token](/tokens/concepts/access-tokens) +* Exchange [Refresh Tokens](/tokens/concepts/refresh-tokens) for new Access Tokens +* Request a challenge for [multi-factor authentication (MFA)](/mfa)
    @@ -43,7 +44,7 @@ The Authentication API exposes Auth0 identity functionality, as well as those of

    Postman

    Try the Auth0 Authentication API in Postman.

    -

    Run in Postman

    +

    Run in Postman

    How to use our Postman Collections

    @@ -52,9 +53,16 @@ The Authentication API exposes Auth0 identity functionality, as well as those of -## Management API v2 +## Management API -The Management API allows you to manage every aspect of your Auth0 account. For example, you can use the Management API to automate the configuration of your user environments or for runtime tasks such as user creation. +The Management API allows you to manage your Auth0 account programmatically, so you can automate configuration of your environment. Most of the tasks you can perform in the Auth0 Management Dashboard can also be performed programmatically by using this API. + +Some example tasks include: + +* Register your applications and APIs with Auth0 +* Set up [connections](/connections) with which your users can authenticate +* [Manage users](/users) +* [Link user accounts](/users/guides/link-user-accounts)
    @@ -82,6 +90,10 @@ The Management API allows you to manage every aspect of your Auth0 account. For -### Management API v1 - DEPRECATED +### Management API v1 has been deprecated + +The Management API v1 is deprecated and should not be used for new projects. + +Management API v1 will reach its End of Life on **July 13, 2020**. You may be required to take action before that date to ensure no interruption to your service. See [Migrate from Management API v1 to v2](/migrations/guides/management-api-v1-v2) for details. Notifications have been and will continue to be sent to customers that need to complete this migration. -The Management API v1 is deprecated and **should not** be used for new projects. If your existing application uses Management API v1, you can reference its API explorer [here](/api/v1). +If your existing application still uses Management API v1, see [Management API v1](/api/management/v1) noting that some endpoints may have limited functionality. \ No newline at end of file diff --git a/articles/api/management/guides/apis/enable-rbac.md b/articles/api/management/guides/apis/enable-rbac.md new file mode 100644 index 0000000000..3c9258dbe9 --- /dev/null +++ b/articles/api/management/guides/apis/enable-rbac.md @@ -0,0 +1,58 @@ +--- +title: Enable Role-Based Access Control for APIs +description: Learn how to enable role-based access control (RBAC) for an API using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - roles + - rbac + - apis +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Enable Role-Based Access Control for APIs + +This guide will show you how to enable [role-based access control (RBAC)](/authorization/concepts/rbac) using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/apis/enable-rbac). This effectively enables the API Authorization Core feature set. + +1. Make a `PATCH` call to the [Update Resource Server endpoint](/api/management/v2#!/resource_servers/patch_resource_server). Be sure to replace `API_ID`, `MGMT_API_ACCESS_TOKEN`, `PERMISSION_NAME`, and `PERMISSION_DESC` placeholder values with your API ID, Management API Access Token, permission name(s), and permission description(s), respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/resource-servers/API_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"enforce_policies\": \"true\", \"token_dialect\": \"TOKEN_DIALECT\" }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `API_ID` | Τhe ID of the API for which you want to enable RBAC. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:resource_servers`. | +| `TOKEN_DIALECT` | Dialect of the Access Token for the specified API.| + +## Token Dialect Options + +Available options include: + +| Value | Description | +|-------|-------------| +| `access_token` | In the `scope` claim of the Access Token, includes an intersection of the requested permissions and the permissions assigned to the user. No `permissions` claim is passed. | +| `access_token_authz` | In the `scope` claim of the Access Token, includes an intersection of the requested permissions and the permissions assigned to the user. In the `permissions` claim of the Access Token, includes all permissions assigned to the user. Allows you to make minimal calls to retrieve permissions, but increases token size. | + +When RBAC is _disabled_, default behavior is observed; an application can request any permission defined for the API, and the `scope` claim will include all requested permissions. + +::: warning +Remember that any configured [rules](/authorization/concepts/authz-rules) run _after_ the RBAC-based authorization decisions are made, so they may override default behavior. +::: diff --git a/articles/api/management/guides/apis/update-permissions-apis.md b/articles/api/management/guides/apis/update-permissions-apis.md new file mode 100644 index 0000000000..7d39e4ca0c --- /dev/null +++ b/articles/api/management/guides/apis/update-permissions-apis.md @@ -0,0 +1,52 @@ +--- +title: Update API Permissions +description: Learn how to update permissions for APIs using the Auth0 Management API. +topics: + - authorization + - mgmt-api + - RBAC + - scopes + - permissions +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Update API Permissions + +This guide will show you how to update permissions for an API using Auth0's Management API. This task can also be performed using the Dashboard, but first you will need to [delete the permission](/dashboard/guides/apis/delete-permissions-apis) and then [add the permission](/dashboard/guides/roles/apis/add-permissions-apis) again. + +::: warning +By default, any user of any application can ask for any permission defined here. You can implement access policies to limit this behavior via [Rules](/rules). +::: + +::: note +Patching the permissions with an empty object removes the permissions completely. +::: + +1. Make a `PATCH` call to the [Update Resource Server endpoint](/api/management/v2#!/resource_servers/patch_resource_server). Be sure to replace `API_ID`, `MGMT_API_ACCESS_TOKEN`, `PERMISSION_NAME`, and `PERMISSION_DESC` placeholder values with your API ID, Management API Access Token, permission name(s), and permission description(s), respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/resource-servers/API_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"scopes\": [ { \"value\": \"PERMISSION_NAME\", \"description\": \"PERMISSION_DESC\" }, { \"value\": \"PERMISSION_NAME\", \"description\": \"PERMISSION_DESC\" } ] }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `API_ID` | Τhe ID of the API for which you want to add permissions. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:resource_servers`. | +| `PERMISSION_NAME` | Name(s) of the permission(s) you would like to add for the specified API. | +| `PERMISSION_DESC` | User-friendly description(s) of the permission(s) you would like to add for the specified API. | \ No newline at end of file diff --git a/articles/api/management/guides/applications/remove-app.md b/articles/api/management/guides/applications/remove-app.md new file mode 100644 index 0000000000..9e10014666 --- /dev/null +++ b/articles/api/management/guides/applications/remove-app.md @@ -0,0 +1,34 @@ +--- +title: Remove Application +description: Learn how to remove an Auth0-registered application using the Auth0 Management API. +toc: false +topics: + - applications + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app + - add-login + - call-api +--- +# Remove Application + +This guide will show you how to remove an application using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/applications/remove-app). + +1. Make a `DELETE` call to the [Delete a Client endpoint](/api/management/v2#!/Clients/delete_clients_by_id). Be sure to replace `YOUR_CLIENT_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your client ID and Management API Access Token, respectively. + +```har +{ + "method": "DELETE", + "url": "https://${account.namespace}/api/v2/clients/YOUR_CLIENT_ID", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| Value | Description | +| - | - | +| `YOUR_CLIENT_ID` | Τhe ID of the application to be deleted. | +| `MGMT_API_ACCESS_TOKEN` | [Access Tokens for the Management API](/api/management/v2/tokens) with the scope `delete:clients`. | diff --git a/articles/api/management/guides/applications/rotate-client-secret.md b/articles/api/management/guides/applications/rotate-client-secret.md new file mode 100644 index 0000000000..464308df41 --- /dev/null +++ b/articles/api/management/guides/applications/rotate-client-secret.md @@ -0,0 +1,42 @@ +--- +title: Rotate Client Secret +description: Learn how to change your application's client secret using the Auth0 Management API. +topics: + - applications + - client-secrets + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app +--- +# Rotate Client Secret + +This guide will show you how to change your application's client secret using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/applications/rotate-client-secret). + +::: warning +New secrets may be delayed while rotating. To minimize downtime, we suggest you store the new client secret in your application's code as a fallback to the previous secret. This way, if the connection doesn't work with the old secret, your app will use the new secret. + +Secrets can be stored in a list (or similar structure) until they're no longer needed. Once you're sure that an old secret is obsolete, you can remove its value from your app's code. +::: + +1. Make a `POST` call to the [Rotate a Client Secret endpoint](/api/management/v2#!/Clients/post_rotate_secret). Be sure to replace `YOUR_CLIENT_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your client ID and Management API Access Token, respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/clients/YOUR_CLIENT_ID/rotate-secret", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| Value | Description | +| - | - | +| `YOUR_CLIENT_ID` | Τhe ID of the application to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Tokens for the Management API](/api/management/v2/tokens) with the scope `update:client_keys`. | + +2. Update authorized applications + +When you rotate a client secret, you must update any authorized applications with the new value. diff --git a/articles/api/management/guides/applications/update-grant-types.md b/articles/api/management/guides/applications/update-grant-types.md new file mode 100644 index 0000000000..febf502d5a --- /dev/null +++ b/articles/api/management/guides/applications/update-grant-types.md @@ -0,0 +1,51 @@ +--- +title: Update Grant Types +description: Learn how to update an application's grant types using Auth0's Management API. +topics: + - applications + - grant-types + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app +--- +# Update Grant Types + +This guide will show you how to change your application's grant types using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/applications/update-grant-types). + +::: warning +As of 8 June 2017, new Auth0 customers **cannot** add legacy grant types to their Applications. Customers as of 8 June 2017 can add legacy grant types to only their existing Applications. +::: + +::: warning +Attempting to use a flow with an Application lacking the appropriate `grant_types` for that flow (or with the field empty) will result in the following error: + +```text +Grant type `grant_type` not allowed for the client. +``` +::: + +1. Make a `PATCH` call to the [Update a Client endpoint](/api/management/v2#!/Clients/patch_clients_by_id). Be sure to replace `YOUR_CLIENT_ID`, `MGMT_API_ACCESS_TOKEN`, and `GRANT_TYPE` placeholder values with your client ID, Management API Access Token, and desired grant type, respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/clients/YOUR_CLIENT_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"grant_types\": \"GRANT_TYPES\" }" + } +} +``` + +| Value | Description | +| - | - | +| `YOUR_CLIENT_ID` | Τhe ID of the application to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Tokens for the Management API](/api/management/v2/tokens) with the scope `update:clients`. | +| `GRANT_TYPES` | The grant types you would like to enable for the specified application. | diff --git a/articles/api/management/guides/applications/update-ownership.md b/articles/api/management/guides/applications/update-ownership.md new file mode 100644 index 0000000000..bbe9d019bf --- /dev/null +++ b/articles/api/management/guides/applications/update-ownership.md @@ -0,0 +1,40 @@ +--- +title: Update Application Ownership +description: Learn how to update application ownership using the Auth0 Management API. This will let you specify whether an application is registered with Auth0 as a first-party or third-party application. +toc: true +topics: + - applications + - application-types + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app +--- +# Update Application Ownership + +This guide will show you how to use Auth0's Management API to update application ownership, which allows you to specify whether an application is registered with Auth0 as a first-party or third-party application. + +Make a `PATCH` call to the [Update a Client endpoint](/api/management/v2#!/Clients/patch_clients_by_id). Be sure to replace `YOUR_CLIENT_ID`,`MGMT_API_ACCESS_TOKEN`, and `OWNERSHIP_BOOLEAN` placeholder values with your client ID, Management API Access Token, and boolean representing the application's ownership, respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/clients/YOUR_CLIENT_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"is_first_party\": \"OWNERSHIP_BOOLEAN\" }" + } +} +``` + +| Value | Description | +| - | - | +| `YOUR_CLIENT_ID` | Τhe ID of the application to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Tokens for the Management API](/api/management/v2/tokens) with the scope `update:clients`. | +| `OWNERSHIP_BOOLEAN` | The ownership you would like to specify for the application. If the application is first-party, `is_first_party` should have a value of `true`. If the application is third-party, `is_first_party` should have a value of `false`. | diff --git a/articles/api/management/guides/applications/view-ownership.md b/articles/api/management/guides/applications/view-ownership.md new file mode 100644 index 0000000000..58d736a93a --- /dev/null +++ b/articles/api/management/guides/applications/view-ownership.md @@ -0,0 +1,35 @@ +--- +title: View Application Ownership +description: Learn how to check whether an application is registered with Auth0 as a first-party or third-party app using the Auth0 Management API. +toc: true +topics: + - applications + - application-types + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app +--- +# View Application Ownership + +This guide will show you how to use Auth0's Management API to check whether an application is registered with Auth0 as a first-party or third-party application. + +1. Make a `GET` call to the [Get a Client endpoint](/api/management/v2#!/Clients/get_clients_by_id). Be sure to replace `YOUR_CLIENT_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your client ID and Management API Access Token, respectively. + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/api/v2/clients/YOUR_CLIENT_ID?fields=is_first_party&include_fields=true", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| Value | Description | +| - | - | +| `YOUR_CLIENT_ID` | Τhe ID of the application to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Tokens for the Management API](/api/management/v2/tokens) with the scope `read:clients`. | + +If the application is first-party, the `is_first_party` field will have a value of `true`. If the application is third-party, the `is_first_party` field will have a value of `false`. diff --git a/articles/api/management/guides/connections/configure-connection-sync.md b/articles/api/management/guides/connections/configure-connection-sync.md new file mode 100644 index 0000000000..c3343c830c --- /dev/null +++ b/articles/api/management/guides/connections/configure-connection-sync.md @@ -0,0 +1,46 @@ +--- +title: Configure Connection Sync with Auth0 +description: Learn how to update connection preferences for an upstream identity provider to control when updates to user profile root attributes will be allowed using the Auth0 Management API. +topics: + - connections + - identity-providers + - user-profile + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app + - customize-connections + - manage-users +--- +# Configure Connection Sync with Auth0 + +This guide will show you how to update connection preferences for an upstream [Identity Provider](/connections) to control when updates to user profile root attributes will be allowed using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/connections/configure-connection-sync). + +::: warning +Before completing this step, you should first [retrieve the existing values of the connection's `options` object](/api/management/guides/connections/retrieve-connection-options) to avoid overriding the current values. If you do not, any missing parameters from the original object will be lost after you update. +::: + +1. Make a `PATCH` call to the [Update a Connection endpoint](/api/management/v2#!/Connections/patch_connections_by_id). Make sure you include the original options values in the call to avoid overriding the current values. Also, be sure to replace `CONNECTION_ID`, `MGMT_API_ACCESS_TOKEN`, and `ATTRIBUTE_UPDATE_VALUE` placeholder values with your connection ID, Management API Access Token, and attribute update value, respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/connections/CONNECTION_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text": "{\"options\":{\"set_user_root_attributes\": \"ATTRIBUTE_UPDATE_VALUE\"}}" + } +} +``` + +| Value | Description | +| - | - | +| `CONNECTION_ID` | ID of the connection for which you want to allow updates to root attributes. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:connections`. | +| `ATTRIBUTE_UPDATE_VALUE` | Indicates when you want to allow updates to user profile root attributes. Valid values are `on_first_login` and `on_each_login`. Defaults to `on_each_login` for new connections. | \ No newline at end of file diff --git a/articles/api/management/guides/connections/promote-connection-domain-level.md b/articles/api/management/guides/connections/promote-connection-domain-level.md new file mode 100644 index 0000000000..50c1c6f4bc --- /dev/null +++ b/articles/api/management/guides/connections/promote-connection-domain-level.md @@ -0,0 +1,39 @@ +--- +title: Promote Connection to Domain Level +description: Learn how to promote a connection to domain level using the Auth0 Management API. +topics: + - connections + - third-party-app + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app + - customize-connections +--- +# Promote Connection to Domain Level + +This guide will show you how to promote connections to domain level using Auth0's Management API. + +1. Make a `PATCH` call to the [Update a Connection endpoint](/api/management/v2#!/Connections/patch_connections_by_id). Be sure to replace `CONNECTION_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your connection ID and Management API Access Token, respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/connections/CONNECTION_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"is_domain_connection\": true }" + } +} +``` + +| Value | Description | +| - | - | +| `CONNECTION_ID` | Τhe ID of the connection to be promoted. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:connections`. | \ No newline at end of file diff --git a/articles/api/management/guides/connections/retrieve-connection-options.md b/articles/api/management/guides/connections/retrieve-connection-options.md new file mode 100644 index 0000000000..1d62b08e31 --- /dev/null +++ b/articles/api/management/guides/connections/retrieve-connection-options.md @@ -0,0 +1,32 @@ +--- +title: Retrieve Connection Options +description: Learn how to retrieve the options object for a connection using the Auth0 Management API. +topics: + - connections + - mgmt-api +contentType: + - how-to +useCase: + - build-an-app + - customize-connections +--- +# Retrieve Connection Options + +This guide will show you how to retrieve the options object for a [connection](/connections) using Auth0's Management API. + +1. Make a `GET` call to the [Get Connection endpoint](/api/management/v2#!/Connections/get_connections_by_id). Be sure to replace `CONNECTION_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your connection ID and Management API Access Token, respectively. + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/api/v2/connections/CONNECTION-ID?fields=options", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| Value | Description | +| - | - | +| `CONNECTION_ID` | Τhe ID of the connection for which you want to retrieve the `options` object. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `read:connections`. | diff --git a/articles/api/management/guides/roles/add-permissions-roles.md b/articles/api/management/guides/roles/add-permissions-roles.md new file mode 100644 index 0000000000..5c9ce675be --- /dev/null +++ b/articles/api/management/guides/roles/add-permissions-roles.md @@ -0,0 +1,45 @@ +--- +title: Add Permissions to Roles +description: Learn how to add permissions to roles for Auth0's API Authorization Core feature using the Auth0 Management API. +topics: + - authorization + - mgmt-api + - roles + - permissions +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Add Permissions to Roles + +This guide will show you how to add permissions to [roles](/authorization/concepts/rbac) using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/roles/add-permissions-roles). The roles and their permissions can be used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `POST` call to the [Add Role Permissions endpoint](/api/management/v2#!/Roles/post_role_permission_assignment). Be sure to replace `ROLE_ID`, `MGMT_API_ACCESS_TOKEN`, `API_IDENTIFIER`, and `PERMISSION_NAME` placeholder values with your role ID, Management API Access Token, API identifier (audience), and permission name(s), respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/roles/ROLE_ID/permissions", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text": "{ \"permissions\": [ { \"resource_server_identifier\": \"API_IDENTIFIER\", \"permission_name\": \"PERMISSION_NAME\" }, { \"resource_server_identifier\": \"API_IDENTIFIER\", \"permission_name\": \"PERMISSION_NAME\" } ] }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `ROLE_ID` | Τhe ID of the role for which you want to add permissions. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:roles`. | +| `API_IDENTIFIER` | This is the identifier of the API associated with the permission(s) you would like to add for the specified role, otherwise known as the audience. This is not the API ID. | +| `PERMISSION_NAME` | Name(s) of the permission(s) you would like to add for the specified role. | diff --git a/articles/api/management/guides/roles/create-roles.md b/articles/api/management/guides/roles/create-roles.md new file mode 100644 index 0000000000..3208506c22 --- /dev/null +++ b/articles/api/management/guides/roles/create-roles.md @@ -0,0 +1,44 @@ +--- +title: Create Roles +description: Learn how to create a role using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - roles + - rbac +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Create Roles + +This guide will show you how to create [roles](/authorization/concepts/rbac) using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/roles/create-roles). The roles can be used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `POST` call to the [Create Role endpoint](/api/management/v2#!/Roles/post_roles). Be sure to replace `MGMT_API_ACCESS_TOKEN`, `ROLE_NAME`, and `ROLE_DESC` placeholder values with your Management API Access Token, role name, and role description, respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/roles", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"name\": \"ROLE_NAME\", \"description\": \"ROLE_DESC\" }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `create:roles`. | +| `ROLE_NAME` | Name of the role you would like to create. | +| `ROLE_DESC` | User-friendly description of the role. | \ No newline at end of file diff --git a/articles/api/management/guides/roles/delete-roles.md b/articles/api/management/guides/roles/delete-roles.md new file mode 100644 index 0000000000..28396f3025 --- /dev/null +++ b/articles/api/management/guides/roles/delete-roles.md @@ -0,0 +1,37 @@ +--- +title: Delete Roles +description: Learn how to delete a role using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - roles +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Delete Roles + +This guide will show you how to delete a [role](/authorization/concepts/rbac) using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/roles/delete-roles). Roles are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `DELETE` call to the [Delete Role endpoint](/api/management/v2#!/Roles/delete_roles_by_id). Be sure to replace `ROLE_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your role ID and Management API Access Token, respectively. + +```har +{ + "method": "DELETE", + "url": "https://${account.namespace}/api/v2/roles/ROLE_ID", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| **Value** | **Description** | +| - | - | +| `ROLE_ID` | Τhe ID of the role you want to delete. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `delete:roles`. | \ No newline at end of file diff --git a/articles/api/management/guides/roles/edit-role-definitions.md b/articles/api/management/guides/roles/edit-role-definitions.md new file mode 100644 index 0000000000..676490c389 --- /dev/null +++ b/articles/api/management/guides/roles/edit-role-definitions.md @@ -0,0 +1,45 @@ +--- +title: Edit Role Definitions +description: Learn how to edit a role definition using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - roles +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Edit Role Definitions + +This guide will show you how to edit a [role](/authorization/concepts/rbac) definition using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/roles/edit-role-definitions). Roles are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `PATCH` call to the [Update Role endpoint](/api/management/v2#!/Roles/patch_roles_by_id). Be sure to replace `ROLE_ID`, `MGMT_API_ACCESS_TOKEN`, `ROLE_NAME`, and `ROLE_DESC` placeholder values with your role ID, Management API Access Token, role name, and role description, respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/roles/ROLE_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"name\": \"ROLE_NAME\", \"description\": \"ROLE_DESC\" }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `ROLE_ID` | Τhe ID of the role for which you want to edit the definition. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:roles`. | +| `ROLE_NAME` | Name of the role. | +| `ROLE_DESC` | User-friendly description of the role. | \ No newline at end of file diff --git a/articles/api/management/guides/roles/remove-role-permissions.md b/articles/api/management/guides/roles/remove-role-permissions.md new file mode 100644 index 0000000000..1bb761e434 --- /dev/null +++ b/articles/api/management/guides/roles/remove-role-permissions.md @@ -0,0 +1,45 @@ +--- +title: Remove Permissions from Roles +description: Learn how to remove permissions added to a role using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - roles +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Remove Permissions from Roles + +This guide will show you how to remove the [permissions](/authorization/concepts/rbac) assigned to a role using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/roles/remove-role-permissions). The assigned permissions and roles are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `DELETE` call to the [Delete Role Permissions endpoint](/api/management/v2#!/Roles/delete_role_permission_assignment). Be sure to replace `ROLE_ID`, `MGMT_API_ACCESS_TOKEN`, `API_ID`, and `PERMISSION_NAME` placeholder values with your role ID, Management API Access Token, API ID(s), and permission name(s), respectively. + +```har +{ + "method": "DELETE", + "url": "https://${account.namespace}/api/v2/roles/ROLE_ID/permissions", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text": "{ \"permissions\": [ { \"resource_server_identifier\": \"API_ID\", \"permission_name\": \"PERMISSION_NAME\" }, { \"resource_server_identifier\": \"API_ID\", \"permission_name\": \"PERMISSION_NAME\" } ] }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `ROLE_ID` | Τhe ID of the role for which you want to remove permissions. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:roles`. | +| `API_ID` | ID(s) of the API(s) associated with the permission(s) you would like to remove for the specified role. | +| `PERMISSION_NAME` | Name(s) of the permission(s) you would like to remove for the specified role. | \ No newline at end of file diff --git a/articles/api/management/guides/roles/view-role-permissions.md b/articles/api/management/guides/roles/view-role-permissions.md new file mode 100644 index 0000000000..86a3aec456 --- /dev/null +++ b/articles/api/management/guides/roles/view-role-permissions.md @@ -0,0 +1,37 @@ +--- +Title: View Role Permissions +description: Learn how to view permissions added to a role using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - roles +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# View Role Permissions + +This guide will show you how to view the [permissions](/authorization/concepts/rbac) added to a role using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/roles/view-role-permissions). The added permissions and roles are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `GET` call to the [Get Role Permissions endpoint](/api/management/v2#!/Roles/get_role_permission). Be sure to replace `ROLE_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your role ID and Management API Access Token, respectively. + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/api/v2/roles/ROLE_ID/permissions", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| **Value** | **Description** | +| - | - | +| `ROLE_ID` | Τhe ID of the role for which you want to get permissions. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `read:roles`. | \ No newline at end of file diff --git a/articles/api/management/guides/roles/view-role-users.md b/articles/api/management/guides/roles/view-role-users.md new file mode 100644 index 0000000000..8c68a6c5e4 --- /dev/null +++ b/articles/api/management/guides/roles/view-role-users.md @@ -0,0 +1,38 @@ +--- +title: View Role Users +description: Learn how to view users assigned to a role using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - dashboard + - permissions + - roles + - users +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# View Role Users + +This guide will show you how to view the users assigned to a role using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/roles/view-role-users). Roles are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `GET` call to the [Get Role Users endpoint](/api/management/v2#!/Roles/get_role_user). Be sure to replace `ROLE_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your role ID and Management API Access Token, respectively. + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/api/v2/roles/ROLE_ID/users", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| **Value** | **Description** | +| - | - | +| `ROLE_ID` | Τhe ID of the role for which you want to get users. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scopes `read:users` and `read:roles`. | diff --git a/articles/api/management/guides/rules/create-rules.md b/articles/api/management/guides/rules/create-rules.md new file mode 100644 index 0000000000..0e102f32c0 --- /dev/null +++ b/articles/api/management/guides/rules/create-rules.md @@ -0,0 +1,43 @@ +--- +title: Create Rules +description: Learn how to create a rule using the Auth0 Management API. You can use rules to customize and extend Auth0's capabilities. +topics: + - mgmt-api + - rules + - extensibility +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Create Rules + +This guide will show you how to create [rules](/rules) using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/rules/create-rules). + +1. Make a `POST` call to the [Create Rule endpoint](/api/management/v2#!/Rules/post_rules). Be sure to replace `MGMT_API_ACCESS_TOKEN`, `RULE_NAME`, `RULE_SCRIPT`, `RULE_ORDER`, and `RULE_ENABLED` placeholder values with your Management API Access Token, rule name, rule script, rule order number, and rule enabled value, respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/rules", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"name\": \"RULE_NAME\", \"script\": \"RULE_SCRIPT\" }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `create:rules`. | +| `RULE_NAME` | Name of the rule you would like to create. The rule name can only contain alphanumeric characters, spaces, and hyphens; it may not start or end with spaces or hyphens. | +| `RULE_SCRIPT` | Script that contains the code for the rule. Should match what you would enter if you were [creating a new rule using the Dashboard](/dashboard/guides/rules/create-rules). | +| `RULE_ORDER` (optional) | Integer that represents the order in which the rule should be executed in relation to other rules. Rules with lower numbers are executed before rules with higher numbers. If no order number is provided, the rule will execute last. +| `RULE_ENABLED` (optional) | Boolean that represents whether the rules is enabled (`true`) or disabled (`false`). | \ No newline at end of file diff --git a/articles/api/management/guides/tenants/configure-session-lifetime-settings.md b/articles/api/management/guides/tenants/configure-session-lifetime-settings.md new file mode 100644 index 0000000000..2e4421e585 --- /dev/null +++ b/articles/api/management/guides/tenants/configure-session-lifetime-settings.md @@ -0,0 +1,42 @@ +--- +title: Configure Session Lifetime Settings +description: Learn how to configure session lengths and limits for a tenant using the Auth0 Management API. +topics: + - idle-timeout + - absolute-timeout + - session-lifetime-limits + - dashboard +contentType: + - how-to +useCase: + - integrate-saas-sso + - configure-sso + - build-an-app +--- +# Configure Session Lifetime Settings + +This guide will show you how to configure session settings for your tenant using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/tenants/configure-session-lifetime-settings). + +1. Make a `PATCH` call to the [Tenant Settings endpoint](/api/management/v2#!/tenants/patch_settings). Be sure to replace `MGMT_API_ACCESS_TOKEN`, `SESSION_LIFETIME`, and `IDLE_SESSION_LIFETIME` placeholder values with your Management API Access Token, session lifetime value, and idle session lifetime value, respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/tenants/settings", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"session_lifetime\": SESSION_LIFETIME_VALUE, \"idle_session_lifetime\": IDLE_SESSION_LIFETIME_VALUE }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:tenant_settings`. | +| `IDLE_SESSION_LIFETIME_VALUE` | Timeframe (in hours) after which a user's session will expire if they haven’t interacted with the Authorization Server. Will be superseded by system limits if over 72 hours (3 days) for Developer or Developer Pro or 2,400 hours (100 days) for enterprise plans. | +| `SESSION_LIFETIME_VALUE` | Timeframe (in hours) after which a user will be required to log in again, regardless of their activity. Will be superseded by system limits if over 720 hours (30 days) for Developer or Developer Pro or 8,760 hours (365 days) for enterprise plans. | diff --git a/articles/api/management/guides/users/assign-permissions-users.md b/articles/api/management/guides/users/assign-permissions-users.md new file mode 100644 index 0000000000..1bca553a35 --- /dev/null +++ b/articles/api/management/guides/users/assign-permissions-users.md @@ -0,0 +1,50 @@ +--- +title: Assign Permissions to Users +description: Learn how to assign permissions to a user using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - users + - user-profile +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Assign Permissions to Users + +This guide will show you how to assign [permissions](/authorization/concepts/rbac) to a user using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/users/assign-permissions-users). The assigned permissions can be used with the API Authorization Core feature set. + +::: note +Adding permissions directly to a user circumvents the benefits of [role-based access control (RBAC)](/authorization/concepts/rbac) and is not typically recommended. +::: + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `POST` call to the [Assign User Permissions endpoint](/api/management/v2#!/Users/post_permissions). Be sure to replace `USER_ID`, `MGMT_API_ACCESS_TOKEN`, `API_IDENTIFIER`, and `PERMISSION_NAME` placeholder values with your user ID, Management API Access Token, API Identifier(s), and permission name(s), respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/users/USER_ID/permissions", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text": "{ \"permissions\": [ { \"resource_server_identifier\": \"API_IDENTIFIER\", \"permission_name\": \"PERMISSION_NAME\" }, { \"resource_server_identifier\": \"API_IDENTIFIER\", \"permission_name\": \"PERMISSION_NAME\" } ] }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `USER_ID` | Τhe ID of the user for whom you want to assign permissions. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:users`. | +| `API_IDENTIFIER` | Identifier(s) of the API(s) associated with the permission(s) you would like to assign for the specified user. | +| `PERMISSION_NAME` | Name(s) of the permission(s) you would like to assign for the specified user. | diff --git a/articles/api/management/guides/users/assign-roles-users.md b/articles/api/management/guides/users/assign-roles-users.md new file mode 100644 index 0000000000..12b652a0d7 --- /dev/null +++ b/articles/api/management/guides/users/assign-roles-users.md @@ -0,0 +1,45 @@ +--- +title: Assign Roles to Users +description: Learn how to assign roles to a user using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - roles + - users + - user-profile +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Assign Roles to Users + +This guide will show you how to assign [roles](/authorization/concepts/rbac) to a user using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/users/assign-roles-users). The assigned roles can be used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `POST` call to the [Assign User Roles endpoint](/api/management/v2#!/Users/post_user_roles). Be sure to replace `USER_ID`, `MGMT_API_ACCESS_TOKEN`, and `ROLE_ID` placeholder values with your user ID, Management API Access Token, and role ID(s), respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/users/USER_ID/roles", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"roles\": [ \"ROLE_ID\", \"ROLE_ID\" ] }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `USER_ID` | Τhe ID of the user to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scopes `read:roles` and `update:users`. | +| `ROLE_ID` | ID(s) of the role(s) you would like to add for the specified user. | \ No newline at end of file diff --git a/articles/api/management/guides/users/remove-user-permissions.md b/articles/api/management/guides/users/remove-user-permissions.md new file mode 100644 index 0000000000..1cdf1f4c6d --- /dev/null +++ b/articles/api/management/guides/users/remove-user-permissions.md @@ -0,0 +1,46 @@ +--- +title: Remove Permissions from Users +description: Learn how to remove permissions directly assigned to a user using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - users + - user-profile +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Remove Permissions from Users + +This guide will show you how to remove the [permissions](/authorization/concepts/rbac) directly assigned to a user using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/users/remove-user-permissions). The assigned permissions are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `DELETE` call to the [Delete User Permissions endpoint](/api/management/v2#!/Users/delete_permissions). Be sure to replace `USER_ID`, `MGMT_API_ACCESS_TOKEN`, `API_ID`, and `PERMISSION_NAME` placeholder values with your user ID, Management API Access Token, API ID(s), and permission name(s), respectively. + +```har +{ + "method": "DELETE", + "url": "https://${account.namespace}/api/v2/users/USER_ID/permissions", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text": "{ \"permissions\": [ { \"resource_server_identifier\": \"API_ID\", \"permission_name\": \"PERMISSION_NAME\" }, { \"resource_server_identifier\": \"API_ID\", \"permission_name\": \"PERMISSION_NAME\" } ] }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `USER_ID` | Τhe ID of the user to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:users`. | +| `API_ID` | ID(s) of the API(s) associated with the permission(s) you would like to remove for the specified user. | +| `PERMISSION_NAME` | Name(s) of the permission(s) you would like to remove for the specified user. | \ No newline at end of file diff --git a/articles/api/management/guides/users/remove-user-roles.md b/articles/api/management/guides/users/remove-user-roles.md new file mode 100644 index 0000000000..10e60f99fe --- /dev/null +++ b/articles/api/management/guides/users/remove-user-roles.md @@ -0,0 +1,45 @@ +--- +title: Remove Roles from Users +description: Learn how to remove the roles assigned to a user using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - roles + - users +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# Remove Roles from Users + +This guide will show you how to remove the [roles](/authorization/concepts/rbac) assigned to a user using Auth0's Management API. This task can also be performed using the Dashboard by either [removing users from a role](/dashboard/guides/users/remove-role-users) or [removing roles from a user](/dashboard/guides/users/remove-user-roles). Roles are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `DELETE` call to the [Delete User Roles endpoint](/api/management/v2#!/Users/delete_user_roles). Be sure to replace `USER_ID`, `MGMT_API_ACCESS_TOKEN`, and `ROLE_ID` placeholder values with your user ID, Management API Access Token, and role ID(s), respectively. + +```har +{ + "method": "DELETE", + "url": "https://${account.namespace}/api/v2/users/USER_ID/roles", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"roles\": [ \"ROLE_ID\", \"ROLE_ID\" ] }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `USER_ID` | Τhe ID of the user to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:users`. | +| `ROLE_ID` | ID(s) of the role(s) you would like to remove for the specified user. | \ No newline at end of file diff --git a/articles/api/management/guides/users/set-root-attributes-user-import.md b/articles/api/management/guides/users/set-root-attributes-user-import.md new file mode 100644 index 0000000000..ac6df80bdd --- /dev/null +++ b/articles/api/management/guides/users/set-root-attributes-user-import.md @@ -0,0 +1,40 @@ +--- +title: Set Root Attributes During User Import +description: Learn how to set root attributes for users during import using the Auth0 Management API. +topics: + - mgmt-api + - root-attributes + - users + - user-profile + - user-import +contentType: + - how-to +useCase: + - manage-users +--- +# Set Root Attributes During User Import + +This guide will show you how to set root attributes for a user during import using Auth0's Management API. This allows you to minimize the number of API calls required to set root attributes when importing users. To see which attributes you can import, visit [Normalized User Profile Structure](/users/references/user-profile-structure). + +1. Make a `POST` call to the [Create Job to Import Users endpoint](/api/management/v2#!/Jobs/post_users_imports). Be sure to replace `MGMT_API_ACCESS_TOKEN`, `CONNECTION_ID`, and `JSON_USER_FILE_PATH` placeholder values with your Management API Access Token, connection ID, and users filename, respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/jobs/usersimports", + "headers": [ + { "name": "Content-Type", "value": "multipart/form-data " }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ], + "postData": { + "mimetype": "multipart/form-data", + "text": "{ \"connection_id\": \"CONNECTION_ID\", \"users\": \"JSON_USER_FILE_PATH\" }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `create:users`. | +| `CONNECTION_ID` | ID of the connection to which the users will be inserted. You can retrieve this info using the [Get All Connections endpoint](/api/management/v2#!/Connections/get_connections). | +| `JSON_USER_FILE_PATH` | Filename of the file that contains the users to be imported. File should be in JSON format and include root attributes for users. For a list of available attributes, see [User Profile Attributes](/users/references/user-profile-structure#attributes). For an example of the file format, see [Bulk User Import Database Schema and Examples](/users/references/bulk-import-database-schema-examples). | \ No newline at end of file diff --git a/articles/api/management/guides/users/set-root-attributes-user-signup.md b/articles/api/management/guides/users/set-root-attributes-user-signup.md new file mode 100644 index 0000000000..7eebeb41e9 --- /dev/null +++ b/articles/api/management/guides/users/set-root-attributes-user-signup.md @@ -0,0 +1,53 @@ +--- +title: Set Root Attributes During User Sign-Up +description: Learn how to set root attributes for users during sign-up using the Auth0 Management API. +topics: + - mgmt-api + - root-attributes + - users + - user-profile + - user-signup +contentType: + - how-to +useCase: + - build-an-app + - add-login + - manage-users +--- +# Set Root Attributes During User Sign-Up + +This guide will show you how to set root attributes for a user during sign-up using Auth0's Management API. This allows you to minimize the number of API calls required to set root attributes when creating users. + +1. Make a `POST` call to the [Create a User endpoint](/api/management/v2#!/Users/post_users). Be sure to replace `MGMT_API_ACCESS_TOKEN`, `CONNECTION_NAME`, `EMAIL_VALUE`, `PASSWORD_VALUE`, `GIVEN_NAME_VALUE`, `FAMILY_NAME_VALUE`, `NAME_VALUE`, `NICKNAME_VALUE`, and `PICTURE` placeholder values with your Management API Access Token, initial connection name, email address, password, given name, family name, name, nickname, and picture URL, respectively. + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/api/v2/users", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text": "{ \"connection\": CONNECTION_NAME, \"email\": EMAIL_VALUE, \"password\": PASSWORD_VALUE, \"given_name\": GIVEN_NAME_VALUE, \"family_name\": FAMILY_NAME_VALUE,\"name\": NAME_VALUE, \"nickname\": NICKNAME_VALUE,\"picture\": PICTURE_VALUE }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `create:users`. | +| `CONNECTION_NAME` | Name of the connection through which the initial user information was received. | +| `EMAIL_VALUE` | Email address of the user to be created. | +| `PASSWORD_VALUE` | Password of the user to be created. | +| `GIVEN_NAME_VALUE` | Given name of the user to be created. | +| `FAMILY_NAME_VALUE` | Family name of the user to be created. | +| `NAME_VALUE` | Full name of the user to be created. | +| `NICKNAME_VALUE` | Nickname of the user to be created. | +| `PICTURE_VALUE` | URL of the picture for the user to be created. | + +::: note +If you are using Lock or the [public signup endpoint](/api/authentication#signup) for user sign-up, you can set root attributes using the same method. +::: diff --git a/articles/api/management/guides/users/update-root-attributes-users.md b/articles/api/management/guides/users/update-root-attributes-users.md new file mode 100644 index 0000000000..97be3eabfd --- /dev/null +++ b/articles/api/management/guides/users/update-root-attributes-users.md @@ -0,0 +1,52 @@ +--- +title: Update Root Attributes for Users +description: Learn how to update root attributes in existing user profiles using the Auth0 Management API. +topics: + - mgmt-api + - root-attributes + - users + - user-profile +contentType: + - how-to +useCase: + - build-an-app + - add-login + - manage-users +--- +# Update Root Attributes for Users + +This guide will show you how to update root attributes for an existing user profile using Auth0's Management API. + +Auth0's [Normalized User Profile](/users/references/user-profile-structure) features [root attributes](/users/references/user-profile-structure#user-profile-attributes) that you can update. The specific root attributes that you can update depend on the [connection](/identityproviders) type you're using. For details relevant to the connection you are using, see [Updating User Profile Root Attributes](/users/normalized/auth0/update-root-attributes). + +1. Make a `PATCH` call to the [Update a User endpoint](/api/management/v2#!/Users/patch_users_by_id). Be sure to replace `USER_ID`, `MGMT_API_ACCESS_TOKEN`, `GIVEN_NAME_VALUE`, `FAMILY_NAME_VALUE`, `NAME_VALUE`, `NICKNAME_VALUE`, and `PICTURE` placeholder values with your user ID, Management API Access Token, given name, family name, name, nickname, and picture URL, respectively. + +```har +{ + "method": "PATCH", + "url": "https://${account.namespace}/api/v2/users/USER_ID", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" }, + { "name": "Cache-Control", "value": "no-cache" } + ], + "postData": { + "mimeType": "application/json", + "text" : "{ \"given_name\": GIVEN_NAME_VALUE, \"family_name\": FAMILY_NAME_VALUE,\"name\": NAME_VALUE, \"nickname\": NICKNAME_VALUE,\"picture\": PICTURE_VALUE }" + } +} +``` + +| **Value** | **Description** | +| - | - | +| `USER_ID` | Τhe ID of the user to be updated. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `update:users`. | +| `GIVEN_NAME_VALUE` | Given name of the user to be updated. | +| `FAMILY_NAME_VALUE` | Family name of the user to be updated. | +| `NAME_VALUE` | Full name of the user to be updated. | +| `NICKNAME_VALUE` | Nickname of the user to be updated. | +| `PICTURE_VALUE` | URL of the picture for the user to be updated. | + +## Removing attributes + +Setting any value to `null` will remove the attribute for the user. diff --git a/articles/api/management/guides/users/view-user-permissions.md b/articles/api/management/guides/users/view-user-permissions.md new file mode 100644 index 0000000000..f24b5c02d7 --- /dev/null +++ b/articles/api/management/guides/users/view-user-permissions.md @@ -0,0 +1,38 @@ +--- +title: View Permissions Assigned to Users +description: Learn how to view permissions assigned to a user using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - users + - user-profile +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# View Permissions Assigned to Users + +This guide will show you how to view the [permissions](/authorization/concepts/rbac) assigned to a user using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/users/view-user-permissions). The assigned permissions are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `GET` call to the [Get User Permissions endpoint](/api/management/v2#!/Users/get_permissions). Be sure to replace `USER_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your user ID and Management API Access Token, respectively. + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/api/v2/users/USER_ID/permissions", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| **Value** | **Description** | +| - | - | +| `USER_ID` | Τhe ID of the user for whom you want to get permissions. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scope `read:users`. | \ No newline at end of file diff --git a/articles/api/management/guides/users/view-user-roles.md b/articles/api/management/guides/users/view-user-roles.md new file mode 100644 index 0000000000..af6fb61d60 --- /dev/null +++ b/articles/api/management/guides/users/view-user-roles.md @@ -0,0 +1,39 @@ +--- +title: View Roles Assigned to Users +description: Learn how to view roles assigned to a user using the Auth0 Management API. For use with Auth0's API Authorization Core feature set. +topics: + - authorization + - mgmt-api + - permissions + - roles + - users + - user-profile +contentType: + - how-to +useCase: + - build-an-app + - call-api + - secure-api +--- +# View Roles Assigned to Users + +This guide will show you how to view the [roles](/authorization/concepts/rbac) assigned to a user using Auth0's Management API. This task can also be performed [using the Dashboard](/dashboard/guides/users/view-user-roles). The assigned roles are used with the API Authorization Core feature set. + +<%= include('../../../../authorization/_includes/_enable-authz-core') %> + +1. Make a `GET` call to the [Get User Roles endpoint](/api/management/v2#!/Users/get_user_roles). Be sure to replace `USER_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your user ID and Management API Access Token, respectively. + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/api/v2/users/USER_ID/roles", + "headers": [ + { "name": "Authorization", "value": "Bearer MGMT_API_ACCESS_TOKEN" } + ] +} +``` + +| **Value** | **Description** | +| - | - | +| `USER_ID` | Τhe ID of the user for whom you want to get roles. | +| `MGMT_API_ACCESS_TOKEN` | [Access Token for the Management API](/api/management/v2/tokens) with the scopes `read:users` and `read:roles`. | \ No newline at end of file diff --git a/articles/api/management/v1/index.md b/articles/api/management/v1/index.md index 187a55d946..e0673851e7 100644 --- a/articles/api/management/v1/index.md +++ b/articles/api/management/v1/index.md @@ -20,19 +20,16 @@ useCase: invoke-api
    Obtain a token to call the API
    -Auth0 API requires an Access Token. You can get one by authenticating with your `client_id` and `client_secret` (It will be valid for 24 hours). To obtain the global client ID and global client secret see the **Advanced** tab under [Tenant Settings](${manage_url}/#/tenant/advanced) in the Auth0 dashboard. +Auth0 API requires an Access Token. You can get one by authenticating with your `client_id` and `client_secret` (It will be valid for 24 hours). To obtain the global client ID and global client secret see the **Advanced** tab under [Tenant Settings](${manage_url}/#/tenant/advanced) in the Auth0 dashboard. ```text POST /oauth/token -Content-Type: application/json -{ - "client_id": "", - "client_secret": "", - "grant_type": "client_credentials" -} +Content-Type: application/x-www-form-urlencoded + +grant_type=client_credentials&client_id=${account.clientId}&client_secret=YOUR_CLIENT_SECRET ``` -Once authenticated, the Access Token can be included in the request as part of the querystring ( `?access_token=...`) or in an HTTP header (`Authorization: Bearer ...access_token...`). +Once authenticated, the Access Token can be included in the request as part of the query string ( `?access_token=...`) or in an HTTP header (`Authorization: Bearer ...access_token...`). ## Users @@ -65,25 +62,13 @@ Authorization: Bearer {token}
    Gets an user by id
    -Gets an user who have logged in through any of your connections that has a given id. +Gets a user who has logged in through any of your connections that has a given id. ```text GET /api/users/{user_id} Authorization: Bearer {token} ``` -
    -
    GET /api/users/{user_id}/devices
    -
    Gets all user's devices
    -
    - -Gets all devices/Refresh Tokens being used by the user. - -```text -GET /api/users/{user_id}/devices -Authorization: Bearer {token} -``` -
    GET /api/connections/{connection}/users
    Gets all users from an enterprise directory
    @@ -102,9 +87,9 @@ Authorization: Bearer {token}
    **Search** remarks: Depending on the connection's type the search will be done in different fields: -* Active Directory/LDAP: by default uses Ambigous name resolution ([ANR](http://technet.microsoft.com/en-us/library/cc755809(v=ws.10).aspx)) which expands to givenName (first name), sn (surname, or last name), displayName, RDN, legacyExchangeDN, physicalDeliveryOfficeName (for example, Building A, Suite 1234), proxyAddresses (the collection of e-mail addresses over all e-mail address spaces that the Exchange server knows about). +* Active Directory/LDAP: by default uses ambiguous name resolution ([ANR](http://technet.microsoft.com/en-us/library/cc755809(v=ws.10).aspx)) which expands to givenName (first name), sn (surname, or last name), displayName, RDN, legacyExchangeDN, physicalDeliveryOfficeName (for example, Building A, Suite 1234), proxyAddresses (the collection of email addresses over all email address spaces that the Exchange server knows about). * Database Connections (not custom): Name/Email case insensitive. -* Google Apps: Email/username case insensitive. +* G Suite: Email/username case insensitive. * WAAD/WAAD2: Name/Email case insensitive. * Windows Azure Active Directory or Office365: name/email case insensitive Heads up! If the connection does not support querying for users (for instance ADFS, SAMLP), it will return the users who have logged in through that connection. @@ -121,9 +106,9 @@ Authorization: Bearer {token} Search users from all enterprise directories based on the specified `criteria`. The parameter is mandatory. **Search** remarks: Depending on the connection's type the search will be done in different fields: -* Active Directory/LDAP: by default uses Ambigous name resolution ([ANR](http://technet.microsoft.com/en-us/library/cc755809(v=ws.10).aspx)) which expands to givenName (first name), sn (surname, or last name), displayName, RDN, legacyExchangeDN, physicalDeliveryOfficeName (for example, Building A, Suite 1234), proxyAddresses (the collection of e-mail addresses over all e-mail address spaces that the Exchange server knows about). +* Active Directory/LDAP: by default uses ambiguous name resolution ([ANR](http://technet.microsoft.com/en-us/library/cc755809(v=ws.10).aspx)) which expands to givenName (first name), sn (surname, or last name), displayName, RDN, legacyExchangeDN, physicalDeliveryOfficeName (for example, Building A, Suite 1234), proxyAddresses (the collection of email addresses over all email address spaces that the Exchange server knows about). * Database Connections (not custom): Name/Email case insensitive. -* Google Apps: Email/username case insensitive. +* G Suite: Email/username case insensitive. * WAAD/WAAD2: Name/Email case insensitive. * Windows Azure Active Directory or Office365: name/email case insensitive Heads up! If the connection does not support querying for users (for instance ADFS, SAMLP), it will return the users who have logged in through that connection. @@ -345,7 +330,7 @@ Authorization: Bearer {token}
    Revokes a Refresh Token
    -Revokes a user's Refresh Token +Revokes a user's Refresh Token ```text DELETE /api/users/{user_id}/refresh_tokens/{refresh_token} @@ -416,7 +401,7 @@ Authorization: Bearer {token} Content-Type: application/json { "name": "" - "strategy": "waad|google-apps|adfs|PingFederate|samlp|auth0", + "strategy": "waad|g-suite|adfs|PingFederate|samlp|auth0", "options": { "tenant_domain": "domain_aliases": @@ -443,7 +428,7 @@ Content-Type: application/json Updates a connection. The body of the request must include the `options` object with the connection parameters and the `status`. -The request's body depends on the strategy that was used to create the connection. Select a strategy: waad google-apps adfs PingFederate samlp auth0 +The request's body depends on the strategy that was used to create the connection. Select a strategy: waad g-suite adfs PingFederate samlp auth0 ```text PUT /api/connections/{connection-name} @@ -485,7 +470,7 @@ Authorization: Bearer {token}
    Creates a new applications/APIs
    -Create an application. The body of the request can include the `name` and `callbacks` parameters. +Create an application. The body of the request can include the `name` and `callbacks` parameters. ```text POST /api/clients @@ -700,13 +685,13 @@ The following is a description of the values returned by the request: * `total`: The amount of entries in the page. * `limit`: The maximum amount of items in a page. * `logs`: A collection of log entries. - * `date`: The moment when the event occured. + * `date`: The moment when the event occurred. * `connection`: The connection related to the event. * `client_id`: The id of the application related to the event. * `client_name`: The name of the application related to the event. * `ip`: The IP address from where the request that caused the log entry originated. - * `user_id`: The user id releated to the event. - * `user_name`: The user name releated to the event. + * `user_id`: The user id related to the event. + * `user_name`: The user name related to the event. * `description`: The event's description. * `user_agent`: The user agent that was used to cause the creation of the log entry. * `type`: An abbreviation of the event type. Refer to the event acronym mappings below for the mapping between abbreviations and their meaning. @@ -747,10 +732,10 @@ Retrieves data about log entries based on the specified parameters. Log entries * `fields`: Can be used to either include or exclude the specified fields by providing a comma (,) separated list of fields, for example `at,c,cn,un`. If no list is provided all fields are included in the response. * `exclude_fields`: To exclude the fields `exclude_fields=true` must be used (if not specified it defaults to false). Possible values for `field` are: -* `date`: The moment when the event occured. +* `date`: The moment when the event occurred. * `connection`: The connection related to the event. * `client_name`: The name of the application related to the event. -* `user_name`: The user name releated to the event. +* `user_name`: The user name related to the event. ```text GET /api/logs?page={number}&per_page={items}&sort={field}:{-1|1}&fields={fields}&exclude_fields{true|false} @@ -764,13 +749,13 @@ The following is a description of the values returned by the request: * `total`: The amount of entries in the page. * `limit`: The maximum amount of items in a page. * `logs`: A collection of log entries. - * `date`: The moment when the event occured. + * `date`: The moment when the event occurred. * `connection`: The connection related to the event. * `client_id`: The id of the application related to the event. * `client_name`: The name of the application related to the event. * `ip`: The IP address from where the request that caused the log entry originated. - * `user_id`: The user id releated to the event. - * `user_name`: The user name releated to the event. + * `user_id`: The user id related to the event. + * `user_name`: The user name related to the event. * `description`: The event's description. * `user_agent`: The user agent that was used to cause the creation of the log entry. * `type`: An abbreviation of the event type. Refer to the event acronym mappings below for the mapping between abbreviations and their meaning. @@ -811,7 +796,7 @@ If no fields are provided a case insensitive 'starts with' search is performed o * `user_name` Otherwise, you can specify multiple fields and specify the search using the `%field%:%search%`, for example: `application:node user:"John@contoso.com"`. -Values specified without quotes are matched using a case insensitive 'starts with' search. If quotes are used a case insensitve exact search is used. If multiple fields are used, the AND operator is used to join the clauses. +Values specified without quotes are matched using a case insensitive 'starts with' search. If quotes are used a case insensitive exact search is used. If multiple fields are used, the AND operator is used to join the clauses. ##### Available Fields * `application`: Maps to the `client_name` field. @@ -830,13 +815,13 @@ The following is a description of the values returned by the request: * `total`: The amount of entries in the page. * `limit`: The maximum amount of items in a page. * `logs`: A collection of log entries. - * `date`: The moment when the event occured. + * `date`: The moment when the event occurred. * `connection`: The connection related to the event. * `client_id`: The id of the application related to the event. * `client_name`: The name of the application related to the event. * `ip`: The IP address from where the request that caused the log entry originated. - * `user_id`: The user id releated to the event. - * `user_name`: The user name releated to the event. + * `user_id`: The user id related to the event. + * `user_name`: The user name related to the event. * `description`: The event's description. * `user_agent`: The user agent that was used to cause the creation of the log entry. * `type`: An abbreviation of the event type. Refer to the event acronym mappings below for the mapping between abbreviations and their meaning. @@ -887,13 +872,13 @@ The following is a description of the values returned by the request: * `total`: The amount of entries in the page. * `limit`: The maximum amount of items in a page. * `logs`: A collection of log entries. - * `date`: The moment when the event occured. + * `date`: The moment when the event occurred. * `connection`: The connection related to the event. * `client_id`: The id of the application related to the event. * `client_name`: The name of the application related to the event. * `ip`: The IP address from where the request that caused the log entry originated. - * `user_id`: The user id releated to the event. - * `user_name`: The user name releated to the event. + * `user_id`: The user id related to the event. + * `user_name`: The user name related to the event. * `description`: The event's description. * `user_agent`: The user agent that was used to cause the creation of the log entry. * `type`: An abbreviation of the event type. Refer to the event acronym mappings below for the mapping between abbreviations and their meaning. diff --git a/articles/api/management/v1/reference.md b/articles/api/management/v1/reference.md index 99d3d3a6b4..3d0af562df 100644 --- a/articles/api/management/v1/reference.md +++ b/articles/api/management/v1/reference.md @@ -20,7 +20,7 @@ https://${account.namespace}/api ``` ### Authentication -Each API request must include an Access Token, either inside the query string: +Each API request must include an Access Token, either inside the query string: ```text https://${account.namespace}/api/connections/?access_token={ACCESS-TOKEN} @@ -112,12 +112,12 @@ The body of the response is a `connection` object formatted as follows: | Strategy | For Customers Using | |:---------|:--------------------| | `adfs` | On Premises Active Directory or any WS-Federation server | -| `google-apps` | Google Apps | +| `g-suite` | G Suite | | `google-oauth2` |Google (through the OAuth2 protocol) | | `office365` | Office 365 and Microsoft Azure Active Directory | | `windowslive` | Microsoft Account (formerly LiveID) | -When implementing the `office365`, `google-apps` or `adfs` strategies, the following properties are added to the connection object: +When implementing the `office365`, `g-suite` or `adfs` strategies, the following properties are added to the connection object: ```text provisioning_ticket: TICKET @@ -169,7 +169,7 @@ The `options` object returned in the `connection` will be different for each str | `adfs_server` | (for example: `the-adfs-server.domain.com/FederationMetadata/2007-06/FederationMetadata.xml`). | | `signInEndpoint`| The URL of the ADFS server where Auth0 will redirect users for login. (for example: `the-adfs-server.company.com/adfs/ls`). | -###### Google Apps Strategy +###### G Suite Strategy ```text { @@ -188,7 +188,7 @@ The `options` object returned in the `connection` will be different for each str } ``` -To obtain the `client_id` and `client_secret` for Google Apps connections, see [Google connections](/connections/social/google). +To obtain the `client_id` and `client_secret` for G Suite connections, see [Google connections](/connections/social/google). ###### Google OAuth2 Strategy @@ -317,7 +317,7 @@ POST https://${account.namespace}/connections Content-Type: application/json ``` -The body of the request is formatted as a `connection` object. For example, the following will create a new connection to Google Apps, initially inactive (`status=0`): +The body of the request is formatted as a `connection` object. For example, the following will create a new connection to G Suite, initially inactive (`status=0`): ```text { @@ -330,7 +330,7 @@ The body of the request is formatted as a `connection` object. For example, the "tenant_domain": GOOG-APP-DOMAIN, "ext_groups":true //Optional }, - "strategy": "google-apps" + "strategy": "g-suite" }; ``` @@ -346,7 +346,7 @@ For updates, use the PUT method. A PUT works on a specific `connection`, therefo | Verb | URL | Description | |:-----|:----|:------------| |`GET` |https://${account.namespace}/api/users |Gets all users who have logged in through any of your connections. | -|`GET` |https://${account.namespace}/api/connections/{connection}/users|Gets all users from an enterprise directory like Office365 / Microsoft Azure Active Directory or a Google Apps domain.| +|`GET` |https://${account.namespace}/api/connections/{connection}/users|Gets all users from an enterprise directory like Office365 / Microsoft Azure Active Directory or a G Suite domain.| |`GET` |https://${account.namespace}/api/socialconnections/users |Gets all users who have logged in through any of the enabled social connections. | ::: note @@ -379,7 +379,7 @@ Most attributes in the `user` object are self-explanatory. Some comments are bel |`issuer` | The name of the authentication server. In the example above it is the URL of Fabrikam's ADFS server used.| |`user_id` | (for example: _the-adfs-server.domain.com/FederationMetadata/2007-06/FederationMetadata.xml_). | |`picture` | The URL of the user's gravatar, if available. | -|`user_id` | A "friendly" unique identifier composed of the strategy plus a unique identifier from the `issuer` (for example: e-mail, and so on). | +|`user_id` | A "friendly" unique identifier composed of the strategy plus a unique identifier from the `issuer` (for example: email, and so on). | #### Other resources diff --git a/articles/api/management/v1/use-cases.md b/articles/api/management/v1/use-cases.md deleted file mode 100644 index 639521daee..0000000000 --- a/articles/api/management/v1/use-cases.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -description: This page lists the API features that are only available in Management API v1. -section: apis -topics: - - apis - - management-api -contentType: reference -useCase: invoke-api ---- - -# Management API v1 Use Cases - -Currently, there are API features and functionality that are only available in the [Management API v1](/api/v1). If your business process or configuration requires these features, please continue to use the API v1. Otherwise, we recommend that you use the [new version](/api/v2) instead. - -The features only available in Management API v1 include: - -* [Active Directory Connector Monitoring](#active-directory-connector-monitoring) -* [Application Users](#application-users) -* [Email](#email) -* [Enterprise Users/Directory Searching](#enterprise-users/directory-searching) -* [Rules Configuration](#rules-configuration) -* [Searching via the PSaaS Appliance](#searching-via-the-auth0-appliance) - -## Active Directory Connector Monitoring - -In Management API v1, there is a `GET` endpoint that allows you to monitor the status of your Active Directory Connector: - -GET `/api/connections/{AUTH0_CONNECTION}/socket` - -## Application Users - -With Management API v1, after authenticating with the `client_id` and `client_secret` of an application, you can make a `GET` call to the appropriate Users endpoint to return only those users that belong to any specified application connection that is enabled for that application. - -[`/api/clients/{client-id}/users`](/api/v1#!#get--api-clients--client-id--users) - -## Email - -With Management API v1, you can use the `PATCH` email endpoint to update email templates as part of your automation process. - -[`/api/emails/{email-template-name}`](/api/v1#put--api-emails--email-template-name-) - -## Enterprise Users/Directory Searching - -Management API v1 allows you to search directly for users authenticated using enterprise connections, such as Active Directory or Azure Active Directory. - -* All users from a specific directory: -[`/api/connections/{connection}/users`](/api/v1#get--api-connections--connection--users) - -* Specific users from a given directory: -[`/api/connections/{connection}/users?search={criteria}`](/api/v1#get--api-connections--connection--users-search--criteria-) - -* All users from all enterprise directories: -GET `/api/enterpriseconnections/users?search={criteria}` - -## Rules Configuration - -Management API v1 allows you to add values to a global `configuration` object that is accessible to **all** Rules. - -* To return all key/value pairs on the global `configuration` object: `GET /api/rules-configs` -* To create or update a global `configuration` object: `POST /api/rules-configs` - -## Searching via the PSaaS Appliance - -In Management API v1, you can perform a "starts with" search for users by name or email: - -[`/api/users?search={criteria}`](/api/v1#!#get--api-users-search--criteria-). - -This functionality works for both cloud instances and the PSaaS Appliance. - -In Management API v2, the search operates with reduced functionality and does not currently support the Lucene query syntax. diff --git a/articles/api/management/v2/changes.md b/articles/api/management/v2/changes.md index d3fbb0eda8..b81792b5c1 100644 --- a/articles/api/management/v2/changes.md +++ b/articles/api/management/v2/changes.md @@ -16,7 +16,6 @@ This document describes the major differences between Auth0's Management API v1 ## tl;dr * v2 uses JWTs instead of opaque tokens. -* v2 allows you to send an ID Token to perform operations on the user to which the ID Token refers. * v2 includes `user_metadata` for trivial data about users and `app_metadata` for data that affects how your application functions. Unlike `metadata` in API v1, these fields are not merged into the root `user` object. * Fewer endpoints on existing features make development easier. * All endpoints work with ids. Strings (such as `connection_name`) are no longer used. @@ -30,15 +29,14 @@ This document describes the major differences between Auth0's Management API v1 | v1 Endpoint | Change | v2 Endpoint | | ----------- | ------ | ----------- | | [GET /api/users](/api/v1#!#get--api-users) | None. | [GET /api/v2/users](/api/v2#!/Users/get_users) | -| [GET /api/users?search={criteria}](/api/v1#!#get--api-users-search--criteria-) | Changed parameter and syntax. | Implemented using Elastic Search. See the [get_users](/api/v2#!/Users/get_users) documentation. | +| [GET /api/users?search={criteria}](/api/v1#!#get--api-users-search--criteria-) | Changed parameter and syntax. | See the [get_users](/api/v2#!/Users/get_users) documentation. | | [GET /api/users/{user\_id}](/api/v1#!#get--api-users--user_id-) | None. | [GET /api/v2/users/{id}](/api/v2#!/Users/get_users_by_id) also accepts `v2\_id` | -| [GET /api/connections/{connection}/users](/api/v1#!#get--api-connections--connection--users) | Not available. | TBD. | -| [GET /api/connections/{connection}/users?search={criteria}](/api/v1#!#get--api-connections--connection--users-search--criteria-) | Not available. | TBD. | -| [GET /api/enterpriseconnections/users?search={criteria}](/api/v1#!#get--api-enterpriseconnections-users-search--criteria-) | Changed to use search. | Available using `q=identities.isSocial:false AND NOT identities.provider:'auth0'` and `search_engine=v2` in the query string. Other conditions may be added to the search. See the [get_users](/api/v2#!/Users/get_users) documentation. | -| [GET /api/socialconnections/users?search={criteria}](/api/v1#!#get--api-socialconnections-users-search--criteria-) | Changed to use search. | Available using `q=identities.isSocial:true` and `search_engine=v2` in the query string. Other conditions may be added to the search. See the [get_users](/api/v2#!/Users/get_users) documentation. | -| [GET /api/clients/{client-id}/users](/api/v1#!#get--api-socialconnections-users-search--criteria-) | Not available. | Not available. | +| [GET /api/connections/{connection}/users](/api/v1#!#get--api-connections--connection--users) | Changed to use search. | Available using `q=identities.connection:"{connection}"` and `search_engine=v3` in the query string. Other conditions may be added to the search. See the [get_users](/api/v2#!/Users/get_users) documentation. | +| [GET /api/connections/{connection}/users?search={criteria}](/api/v1#!#get--api-connections--connection--users-search--criteria-) | Changed to use search. | Available using `q=identities.connection:"{connection}"` and `search_engine=v3` in the query string. Other conditions and criteria may be added to the search. See the [get_users](/api/v2#!/Users/get_users) documentation. **For enterprise connections**, only supports searching users that have previously logged in; **external user search is no longer supported.** | +| [GET /api/enterpriseconnections/users?search={criteria}](/api/v1#!#get--api-enterpriseconnections-users-search--criteria-) | Changed to use search. | Available using `q=identities.isSocial:false AND NOT identities.provider:auth0` and `search_engine=v3` in the query string. Other conditions may be added to the search. See the [get_users](/api/v2#!/Users/get_users) documentation. Only supports searching users that have previously logged in; **external user search is no longer supported.** | +| [GET /api/socialconnections/users?search={criteria}](/api/v1#!#get--api-socialconnections-users-search--criteria-) | Changed to use search. | Available using `q=identities.isSocial:true` and `search_engine=v3` in the query string. Other conditions may be added to the search. See the [get_users](/api/v2#!/Users/get_users) documentation. | +| [GET /api/clients/{client-id}/users](/api/v1#!#get--api-socialconnections-users-search--criteria-) | Removed. | Removed. | | [POST /api/users](/api/v1#!#post--api-users) | None. | [POST /api/v2/users](/api/v2#!/Users/post_users) | -| [POST /api/users/{user\_id}/send\_verification\_email](/api/v1#!#post--api-users--user_id--send_verification_email) | Not available. | TBD. | | [POST /api/users/{user\_id}/change\_password\_ticket](/api/v1#!#post--api-users--user_id--change_password_ticket) | None. | [POST /api/v2/tickets/password-change](/api/v2#!/tickets/post_password_change) | | [POST /api/users/{user\_id}/verification\_ticket](/api/v1#!#post--api-users--user_id--verification_ticket) | None. | [POST /api/v2/tickets/email-verification](/api/v2#!/tickets/post_email_verification) | | [POST /api/users/{user\_id}/publickey](/api/v1#!#post--api-users--user_id--publickey) | Keys are created per device, not per user. | [POST /api/v2/device-credentials](/api/v2#!/Device_Credentials/post_device_credentials) | @@ -60,7 +58,7 @@ This document describes the major differences between Auth0's Management API v1 | ----------- | ------ | ----------- | | [GET /api/clients](/api/v1#!#get--api-clients) | None. | [GET /api/v2/clients](/api/v2#!/Clients/get_clients) | | [POST /api/clients](/api/v1#!#post--api-clients) | None. | [POST /api/v2/clients](/api/v2#!/Clients/post_clients) | -| [PUT /api/clients/{client-id}](/api/v1#!#put--api-clients--client-id-) | Not available. | [PUT /api/v2/clients/{id}](/api/v2#!/Clients/patch_clients_by_id) | +| [PUT /api/clients/{client-id}](/api/v1#!#put--api-clients--client-id-) | Removed. | [PUT /api/v2/clients/{id}](/api/v2#!/Clients/patch_clients_by_id) | | [PATCH /api/clients/{client-id}](/api/v1#!#patch--api-clients--client-id-) | None. | [PATCH /api/v2/clients/{id}](/api/v2#!/Clients/patch_clients_by_id) | | [DELETE /api/clients/{client-id}](/api/v1#!#delete--api-clients--client-id-) | None. | [DELETE /api/v2/clients/{id}](/api/v2#!/Clients/delete_clients_by_id) | @@ -69,15 +67,15 @@ This document describes the major differences between Auth0's Management API v1 | v1 Endpoint | Change | v2 Endpoint | | ----------- | ------ | ----------- | | [GET /api/connections](/api/v1#!#get--api-connections) | None. | [GET /api/v2/connections](/api/v2#!/Connections/get_connections) | -| [GET /api/connections/{connection-name}](/api/v1#!#get--api-connections--connection-name-) | Changed `connection-name` to `id`. | [GET /api/connections/{id}](/api/v2#!/Connections/get_connections_by_id) | +| [GET /api/connections/{connection-name}](/api/v1#!#get--api-connections--connection-name-) | Use `id` instead of `connection-name`. | [GET /api/connections/{id}](/api/v2#!/Connections/get_connections_by_id) | | [POST /api/connections](/api/v1#!#post--api-connections) | Added `enabled_clients` property. | [POST /api/v2/connections](/api/v2#!/Connections/post_connections) | -| [PUT /api/connections/{connection-name}](/api/v1#!#put--api-connections--connection-name-) | Not available. Changed `connection-name` to `id`. | [PATCH /api/v2/connections/{id}](/api/v2#!/Connections/patch_connections_by_id) | -| [DELETE /api/connections/{connection-name}](/api/v1#!#delete--api-connections--connection-name-) | Changed `connection-name` to `id`. | [DELETE /api/v2/clients/{id}](/api/v2#!/Connections/delete_connections_by_id) | -| [GET /api/connections/{connection}/users](/api/v1) | None. | [GET /api/v2/users](/api/v2#!/Users/get_users) (see note) | -| [GET /api/connections/{connection}/users?search={criteria}](/api/v1) | None. | [GET /api/v2/users](/api/v2#!/Users/get_users) (see note) | +| [PUT /api/connections/{connection-name}](/api/v1#!#put--api-connections--connection-name-) | Removed; use `id` instead of `connection-name`. | [PATCH /api/v2/connections/{id}](/api/v2#!/Connections/patch_connections_by_id) | +| [DELETE /api/connections/{connection-name}](/api/v1#!#delete--api-connections--connection-name-) | Use `id` instead of `connection-name`. | [DELETE /api/v2/clients/{id}](/api/v2#!/Connections/delete_connections_by_id) | +| [GET /api/connections/{connection}/users](/api/v1) | None. | [GET /api/v2/users](/api/v2#!/Users/get_users) (see note) | +| [GET /api/connections/{connection}/socket](/api/v1) | None. | [GET /api/v2/connections/{id}/status](/api/v2#!/Connections/get_status) | ::: note -For PSaaS Appliance (search_engine:v1), use `connection` field; for cloud (search_engine:v2), use `q=identities.connection:"connection_name"` +For Private Cloud (search_engine:v2), use `q=identities.connection:"connection_name"` ::: ### Rules endpoints @@ -86,20 +84,35 @@ For PSaaS Appliance (search_engine:v1), use `connection` field; for cloud (searc | ----------- | ------ | ----------- | | [GET /api/rules](/api/v1#!#get--api-rules-) | None. | [GET /api/v2/rules](/api/v2#!/Rules/get_rules) | | [POST /api/rules](/api/v1#!#post--api-rules) | None. | [POST /api/v2/rules](/api/v2#!/Rules/post_rules-) | -| [PUT /api/rules/{rule-name}](/api/v1#!#put--api-rules--rule-name-) | Uses `{id}` instead of `rule-name`. | [PATCH /api/v2/rules/{id}](/api/v2#!/Rules/patch_rules_by_id) | -| [DELETE /api/rules/{rule-name}](/api/v1#!#delete--api-rules--rule-name-) | Uses `{id}` instead of `rule-name`. | [DELETE /api/v2/rules/{id}](/api/v2#!/Rules/delete_rules_by_id) | +| [PUT /api/rules/{rule-name}](/api/v1#!#put--api-rules--rule-name-) | Removed; use `id` instead of `rule-name`. | [PATCH /api/v2/rules/{id}](/api/v2#!/Rules/patch_rules_by_id) | +| [DELETE /api/rules/{rule-name}](/api/v1#!#delete--api-rules--rule-name-) | Use `id` instead of `rule-name`. | [DELETE /api/v2/rules/{id}](/api/v2#!/Rules/delete_rules_by_id) | +| [GET /api/rules-configs](/api/v1) | None. | [GET /api/v2/rules-configs](/api/v2#!/Rules_Configs/get_rules_configs) | +| [POST /api/rules-configs](/api/v1) | Removed; perform one call per variable to update. | [PUT /api/v2/rules-configs/{key}](/api/v2#!/Rules_Configs/put_rules_configs_by_key) | ### Logs endpoints -Logs endpoints have not been implemented in Management API v2. Logs must first be indexed in Elastic Search. +Logs endpoints in Management API v2 are described at [Search Log Events](https://auth0.com/docs/api/management/v2#!/Logs/get_logs) + +| v1 Endpoint | Change | v2 Endpoint | +| ----------- | ------ | ----------- | +| [GET /logs](/api/v1#logs) | Syntax Changes, described at [Breaking Changes](https://auth0.com/docs/logs/query-syntax#search-engine-v3-breaking-changes) | [GET /api/v2/logs](/api/v2#!/Logs/get_logs) | +| [GET /logs/{id}](/api/v1#logs) | None. | [GET /api/v2/logs/{id}](/api/v2#!/Logs/get_logs_by_id) | + +### Email Templates endpoints + +| v1 Endpoint | Change | v2 Endpoint | +| ----------- | ------ | ----------- | +| [GET /api/emails/{email-template-name}](/api/v1#email-templates) | `disabled` renamed to `enabled`. | [GET /api/v2/email-templates/{templateName}](/api/v2#!/Email_Templates/get_email_templates_by_templateName) | +| [POST /api/emails](/api/v1#email-templates) | `disabled` renamed to `enabled`. | [POST /api/v2/email-templates](https://auth0.com/docs/api/management/v2#!/Email_Templates/post_email_templates) | +| [PUT /api/emails/{email-template-name}](/api/v1#email-templates) | `disabled` renamed to `enabled`. | [PUT /api/v2/email-templates/{templateName}](https://auth0.com/docs/api/management/v2#!/Email_Templates/put_email_templates_by_templateName) | ## Authentication mechanism -Auth0's API v1 requires sending an Access Token obtained by performing a [`POST /oauth/token`](/api/v1#!#post--oauth-token) request along with the `clientId` and `clientSecret`. All subsequent requests must include the Access Token in the `Authorization` header: `Authorization: Bearer {access_token}`. +Auth0's API v1 requires sending an Access Token obtained by performing a [`POST /oauth/token`](/api/v1#!#post--oauth-token) request along with the `clientId` and `clientSecret`. All subsequent requests must include the Access Token in the `Authorization` header: `Authorization: Bearer {access_token}`. -Auth0's API v2 requires sending an Access Token with specific scope(s). To perform requests with API v2, use the `Authorization` header: `Authorization: Bearer YOUR_ACCESS_TOKEN`. +Auth0's API v2 requires sending an Access Token with specific scope(s). To perform requests with API v2, use the `Authorization` header: `Authorization: Bearer YOUR_ACCESS_TOKEN`. -To use an endpoint, at least one of its available scopes (as listed in [Management API v2 explorer](/api/v2)) must be specified for the JWT. The actions available on an endpoint depend on the JWT scope. For example, if a JWT has the `update:users_app_metadata` scope, the [PATCH users `app_metadata`](/api/v2#!/users/patch_users_by_id) action is available, but not other properties. +To use an endpoint, at least one of its available scopes (as listed in [Management API v2 explorer](/api/v2)) must be specified for the JWT. The actions available on an endpoint depend on the JWT scope. For example, if a JWT has the `update:users_app_metadata` scope, the [PATCH users `app_metadata`](/api/v2#!/Users/patch_users_by_id) action is available, but not other properties. There is a subset of scopes that your application can use in order to perform a subset of operations on behalf of the currently logged-in user. These are: @@ -115,7 +128,7 @@ So, for example, if the Access Token contains the scope `update:current_user_met ## User metadata -In the Management API v1, [`user.metadata`](/api/v1#!#patch--api-users--user_id--metadata) provides additional information about a user which is not part of the default user claims. When working with rules and other API endpoints, `metadata` is merged into the root user. For example, if the following data is stored for a user with `email` "jane.doe@gmail.com": +In the Management API v1, [`user.metadata`](/api/v1#!#patch--api-users--user_id--metadata) provides additional user information that is not part of the default user claims. When working with rules and other API endpoints, `metadata` is merged into the root user. For example, if the following data is stored for a user with `email` "jane.doe@gmail.com": ```javascript { @@ -125,7 +138,7 @@ In the Management API v1, [`user.metadata`](/api/v1#!#patch--api-users--user_id- } ``` -when working with rules or retrieving the user from the API you would get: +when working with rules or retrieving the user from the API, you would get: ```javascript console.log(user.email); // "jane.doe@gmail.com" @@ -204,7 +217,7 @@ In Management API v1, different endpoints are used to update the various user pr * [`PUT /api/users/{user_id}/metadata`](/api/v1#!#put--api-users--user_id--metadata) * [`PUT /api/users/{user_id}/password`](/api/v1#!#put--api-users--user_id--password) -In API v2, these are simplified into the single endpoint [`PATCH /api/v2/users/{id}`](/api/v2#!/users/patch_users_by_id) which allows you to modify these (and other) user properties. +In API v2, these are simplified into the single endpoint [`PATCH /api/v2/users/{id}`](/api/v2#!/Users/patch_users_by_id) which allows you to modify these (and other) user properties. ### All endpoints require ids diff --git a/articles/api/management/v2/create-m2m-app.md b/articles/api/management/v2/create-m2m-app.md new file mode 100644 index 0000000000..ef3cf0d79c --- /dev/null +++ b/articles/api/management/v2/create-m2m-app.md @@ -0,0 +1,44 @@ +--- +description: How to create and authorize a machine-to-machine application for calling Management API endpoints using Access Tokens. +section: apis +toc: true +topics: + - apis + - management-api + - tokens +contentType: + - how-to +useCase: invoke-api +--- + +# Create and Authorize a Machine-to-Machine Application + +The first time you get a token for the Management API is when you complete the configuration in the Auth0 [Dashboard](${manage_url}). You won't have to do this again unless you create a new tenant. We recommend that you create a token exclusively for authorizing access to the Management API instead of reusing another one you might have. + +To create and authorize a Machine-to-Machine Application for the Management API: + +1. Go to [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer) +2. Click the button __Create & Authorize a Test Application__. A new application has been created and it's authorized to access the Management API. + +![Create and Authorize Application](/media/articles/api/tokens/create-authorize-client.png) + +The application created in the steps above has been granted __all__ the Management API scopes. This means that it can access all endpoints. + +::: panel How can I find out which scopes/permissions are required? +Each machine-to-machine application that accesses an API must be granted a set of scopes. Scopes are permissions that should be granted by the owner. Each [Auth0 Management API v2](/api/management/v2) endpoint requires specific scopes. To see the required scopes/permissions for each endpoint, go to the [Management API Explorer](/api/management/v2#!) and find the endpoint you want to call. Each endpoint has a section called **Scopes** listing all the scopes that the endpoint requires. For example, the [Get all clients](/api/management/v2#!/Clients/get_clients) endpoint requires the scopes `read:clients` and `read:client_keys`. +::: + +## Example: Get All Clients Endpoint + +The [Get all clients](/api/management/v2#!/Clients/get_clients) endpoint requires the scopes `read:clients` and `read:client_keys`, while the [Create an application](/api/management/v2#!/Clients/post_clients) endpoint requires the scope `create:clients`. From that we can deduce that if we need to read _and_ create applications, then our token should include three scopes: `read:clients`, `read:client_keys` and `create:clients`. + +If you have multiple applications that should access the Management API, and you need different sets of scopes per app, we recommend creating a new machine-to-machine application for each one. For example, if one application is to read and create users (`create:users`, `read:users`) and another to read and create applications (`create:clients`, `read:clients`) create two applications (one for user scopes, one for applications) instead of one. + +## Keep reading + +* [Get Access Tokens for Testing](/api/management/v2/get-access-tokens-for-test) +* [Get Access Tokens for Production](/api/management/v2/get-access-tokens-for-production) +* [Get Management API Tokens for Single-page Applications](/api/management/v2/get-access-tokens-for-spas) +* [Applications](/applications) +* [Management API Explorer](/api/management/v2#!) +* [Management API Access Tokens FAQs](/api/management/v2/faq-management-api-access-tokens) diff --git a/articles/api/management/v2/faq-management-api-access-tokens.md b/articles/api/management/v2/faq-management-api-access-tokens.md new file mode 100644 index 0000000000..28600870ec --- /dev/null +++ b/articles/api/management/v2/faq-management-api-access-tokens.md @@ -0,0 +1,33 @@ +--- +description: FAQs for Management API Access Tokens +section: apis +toc: true +topics: + - apis + - management-api + - tokens +contentType: + - reference +useCase: invoke-api +--- + +# Management API Access Token FAQs + +__How long is the token valid for?__
    +The Management API token has by default a validity of __24 hours__. After that the token will expire and you will have to get a new one. If you get one manually from [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer) though, you can change the expiration time. However, having non-expiring tokens is not secure. + +__The old way of generating tokens was better, since the token never expired. Why was this changed?__
    +The old way of generating tokens was insecure since the tokens had an infinite lifespan. The new implementation allows tokens to be generated with specific scopes and expirations. We decided to move to the most secure implementation because your security, and that of your users, is priority number one for us. + +__Can I change my token's validity period?__
    +You cannot change the default validity period, which is set to 24 hours. However, if you get a token manually from [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer) you can change the expiration time for the specific token. Note though, that your applications should use short-lived tokens to minimize security risks. + +__Can I refresh my token?__
    +You cannot renew a Management API token. A [new token](#2-get-the-token) should be created when the old one expires. + +__My token was compromised! Can I revoke it?__
    +You cannot directly revoke a Management API token, thus we recommend a short validity period. +Note that deleting the application grant will prevent *new tokens* from being issued to the application. You can do this either by [using our API](/api/management/v2#!/Client_Grants/delete_client_grants_by_id), or manually [deauthorize the API application using the dashboard](${manage_url}/#/apis/management/authorized-applications). + +__My Client Secret was compromised! What should I do?__
    +You need to change the secret immediately. Go to your [Application's Settings](${manage_url}/#/applications/${account.clientId}/settings) and click the __Rotate__ icon , or use the [Rotate a client secret](/api/management/v2#!/Clients/post_rotate_secret) endpoint. Note that previously issued tokens will continue to be valid until their expiration time. diff --git a/articles/api/management/v2/get-access-tokens-for-production.md b/articles/api/management/v2/get-access-tokens-for-production.md new file mode 100644 index 0000000000..fdb44e1706 --- /dev/null +++ b/articles/api/management/v2/get-access-tokens-for-production.md @@ -0,0 +1,180 @@ +--- +description: How to get Access Tokens to make scheduled frequent calls to the Management API. +section: apis +toc: true +topics: + - apis + - management-api + - tokens +contentType: + - how-to +useCase: invoke-api +--- + +# Get Access Tokens for Production + +To make scheduled frequent calls for a production environment, you have to build a process at your backend that will provide you with a token automatically (and thus simulate a non-expiring token). + +## Prerequisite + +* [Create and Authorize a Machine-to-Machine Application](/api/management/v2/create-m2m-app). + +## Get Access Tokens + +To ask Auth0 for a Management API v2 token, perform a `POST` operation to the `https://${account.namespace}/oauth/token` endpoint, using the credentials of the Machine-to-Machine Application you created in the prerequisite step. + +The payload should be in the following format: + +```har +{ + "method": "POST", + "url": "https://${account.namespace}/oauth/token", + "headers": [ + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } + ], + "postData": { + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "client_credentials" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "audience", + "value": "https://${account.namespace}/api/v2/" + } + ] + } +} +``` + +The request parameters are: + +| __Request Parameter__ | __Description__ | +| ------ | ----------- | +| __grant_type__ | Denotes which [OAuth 2.0 flow](/protocols/oauth2#authorization-grant-types) you want to run. For machine to machine communication use the value `client_credentials`. | +| __client_id__ | This is the value of the __Client ID__ field of the Machine-to-Machine Application you created. You can find it on the [Settings tab of your Application](${manage_url}/#/applications/${account.clientId}/settings). | +| __client_secret__ | This is the value of the __Client Secret__ field of the Machine-to-Machine Application you created. You can find it at the [Settings tab of your Application](${manage_url}/#/applications/${account.clientId}/settings). | +| __audience__ | This is the value of the __Identifier__ field of the `Auth0 Management API`. You can find it at the [Settings tab of the API](${manage_url}/#/apis). | + +The response will contain a [signed JWT](/tokens/concepts/jwts), when it expires, the scopes granted, and the token type. + +```json +{ + "access_token": "eyJ...Ggg", + "expires_in": 86400, + "scope": "read:clients create:clients read:client_keys", + "token_type": "Bearer" +} +``` + +From the above we can see that our Access Token is a [Bearer Access Token](https://tools.ietf.org/html/rfc6750), it will expire in 24 hours (86400 seconds), and it has been authorized to read and create applications. + +### Use Auth0's Node.js Client Library + +As an alternative to making HTTP calls, you can use the [node-auth0](https://www.npmjs.com/package/auth0) library to automatically [obtain tokens for the Management API](https://www.npmjs.com/package/auth0#user-content-management-api-client). + +## Use Access Tokens + +To use this token, include it in the `Authorization` header of your request. + +```har +{ + "method": "POST", + "url": "http://PATH_TO_THE_ENDPOINT/", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer YOUR_ACCESS_TOKEN"} + ] +} +``` + +For example, in order to [Get all applications](/api/management/v2#!/Clients/get_clients) use the following: + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/api/v2/clients", + "headers": [ + { "name": "Content-Type", "value": "application/json" }, + { "name": "Authorization", "value": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5ESTFNa05DTVRGQlJrVTRORVF6UXpFMk1qZEVNVVEzT1VORk5ESTVSVU5GUXpnM1FrRTFNdyJ9.eyJpc3MiOiJodHRwczovL2RlbW8tYWNjb3VudC5hdXRoMC5jb20vIiwic3ViIjoib9O7eVBnMmd4VGdMNjkxTnNXY2RUOEJ1SmMwS2NZSEVAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZGVtby1hY2NvdW50LmF1dGgwLmNvbS9hcGkvdjIvIiwiZXhwIjoxNDg3MDg2Mjg5LCJpYXQiOjE5ODY5OTk4ODksInNjb3BlIjoicmVhZDpjbGllbnRzIGNyZWF0ZTpjbGllbnRzIHJlYWQ6Y2xpZW50X2tleXMifQ.oKTT_cEA_U6hVzNYPCl_4-SnEXXvFSOMJbZyFydQDPml2KqBxVw_UPAXhjgtW8Kifc_b2HQ4jFh7nH0KC_j1XjfEJPvwFZgqfI_ILzO3DPfpEIK_n_aX-Tz4okbZe6nj2aT_qLpHimLxK50jOGaMuzp4a1djHJTj5q-NbIiPW8AJowS2-gveP4T3dyyegUsZkmTNwrreqppPApmpWWE-wVsxnVsI_FZFrHnq0rn7lmY_Iz6vyiZjaKrd2C3hFm0zFGTn8FslBfHUldTcDNzOKOpCq7HFMeU0urXBXDetrzkW1afxIqED3G2C51JEV-4nTRYUinnWgXJfLJ87G3ge_A"} + ] +} +``` + +::: note +You can get the curl command for each endpoint from the Management API v2 Explorer. Go to the endpoint you want to call, and click the __get curl command__ link at the __Test this endpoint__ section. +::: + +## Example: Python Implementation + +This python script gets a Management API v2 Access Token, uses it to call the [Get all applications](/api/management/v2#!/Clients/get_clients) endpoint, and prints the response in the console. + +Before you run it make sure that the following variables hold valid values: +- `audience`: The __Identifier__ of the `Auth0 Management API`. You can find it at the [Settings tab of the API](${manage_url}/#/apis). +- `domain`: The __Domain__ of the Machine-to-Machine Application you created. +- `client_id`: The __Client ID__ of the Machine to Machine Application you created. +- `client_secret`: The __Client Secret__ of the Machine-to-Machine Application you created. + +```python +def main(): + import json, requests + from requests.exceptions import RequestException, HTTPError, URLRequired + + # Configuration Values + audience = f"https://${account.namespace}/api/v2/" + domain = "${account.namespace}" + client_id = "${account.clientId}" + client_secret = "YOUR_CLIENT_SECRET" + grant_type = "client_credentials" # OAuth 2.0 flow to use + + # Get an Access Token from Auth0 + base_url = f"https://{domain}" + payload = {'grant_type': 'client_credentials', + 'client_id': client_id, + 'client_secret': client_secret, + 'audience': audience} + res = requests.get(base_url, data=payload) + oauth = json.loads(response.json()) + access_token = oauth.get('access_token') + + # Get all Applications using the token + res = requests.get(base_url + "/api/v2/clients") + header = { + 'Authorization', 'Bearer ' + access_token, + 'Content-Type', 'application/json' + } + + try: + res = request.get(req, header = header) + output = json.loads(res.json()) + print(output) + except HTTPError as e: + print('HTTPError = ' + str(e.code) + ' ' + str(e.reason)) + except URLRequired as e: + print(f'URLRequired = str(e.reason)') + except RequestException as e: + print('RequestException: {e}') + except Exception as e: + print(f'Generic Exception: {e}') + +# Standard boilerplate to call the main() function. +if __name__ == '__main__': + main() +``` + +## Keep reading + +- [Applications](/applications) +* [Management API Explorer](/api/management/v2#!) +* [Management API Access Tokens FAQs](/api/management/v2/faq-management-api-access-tokens) + + diff --git a/articles/api/management/v2/get-access-tokens-for-spas.md b/articles/api/management/v2/get-access-tokens-for-spas.md new file mode 100644 index 0000000000..49f58e6168 --- /dev/null +++ b/articles/api/management/v2/get-access-tokens-for-spas.md @@ -0,0 +1,60 @@ +--- +description: Describes available scopes and endpoints for Management API tokens for Single-page Applications (SPAs). +section: apis +topics: + - apis + - management-api + - tokens +contentType: + - how-to +useCase: invoke-api +--- + +# Get Management API Tokens for Single-page Applications + +In certain cases, you may want to use Auth0's [Management API](/api/management/v2#!) to manage your applications and APIs rather than the Auth0 Management Dashboard. + +To call any Management API endpoints, you must authenticate using a specialized [Access Token](/tokens/overview-access-tokens) called the Management API Token. Management API Tokens are [JSON Web Tokens (JWTs)](/tokens/concepts/jwts) that contain specific granted permissions (also known as scopes) for the Management API endpoints you want to call. + +## Limitations + +Since single-page applications (SPAs) are public clients and cannot securely store sensitive information (such as a **Client Secret**), they must retrieve Management API Tokens from the frontend, unlike other [application types](/applications). This means that Management API Tokens for SPAs have certain limitations. Specifically, they are issued in the context of the user who is currently signed in to Auth0 which limits updates to only the logged-in user's data. Although this restricts use of the Management API, it can still be used to perform actions related to updating the logged-in user's user profile. + +::: warning +Auth0 does not recommend putting Management API Tokens on the frontend that allow users to change user metadata. This can allow users to manipulate their own metadata in a way that could be detrimental to the functioning of the applications. It also allows a customer to do a DoS attack against someone's management API by just spamming it and hitting rate limits. +::: + +## Available scopes and endpoints + +With a Management API Token issued for a SPA, you can access the following scopes (and hence endpoints). + +::: note +Password changes through the [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) endpoint are **not possible** with a Management API Token issued for a SPA. +::: + +| **Scope for Current User** | **Endpoint** | +| -------------------------- | ------------ | +| `read:current_user` | [GET /api/v2/users/{id}](/api/management/v2#!/Users/get_users_by_id)
    [GET /api/v2/users/{id}/enrollments](/api/management/v2#!/Users/get_enrollments) | +| `update:current_user_identities` | [POST/api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities)
    [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_user_identity_by_user_id) | +| `update:current_user_metadata` | [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | +| `create:current_user_metadata` | [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | +| `delete:current_user_metadata` | [DELETE /api/v2/users/{id}/multifactor/{provider}](/api/management/v2#!/Users/delete_multifactor_by_provider) | +| `create:current_user_device_credentials` | [POST /api/v2/device-credentials](/api/management/v2#!/Device_Credentials/post_device_credentials) | +| `delete:current_user_device_credentials` | [DELETE /api/v2/device-credentials/{id}](/api/management/v2#!/Device_Credentials/delete_device_credentials_by_id) | + +::: note +The above scopes and endpoints are subject to [rate limits](/policies/rate-limits#access-tokens-for-spas). +::: + +## Use Management API Token to call Management API from a SPA + +You can retrieve a Management API Token from a SPA and use the token to call the Management API to retrieve the full user profile of the currently logged-in user. + +1. Retrieve a Management API token. Authenticate the user by redirecting them to the Authorization endpoint, which is where users are directed upon login or sign-up. When you receive the Management API Token, it will be in [JSON Web Token format](/tokens/references/jwt-structure). Decode it and review its contents. + +2. Call the Management API to retrieve the logged-in user's user profile from the [Get User by ID](/api/management/v2#!/Users/get_users_by_id) endpoint. To call the endpoint, include the encoded Management API Token you retrieved in the `Authorization` header of the request. Be sure to replace the `USER_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with the logged-in user's user ID (`sub` value from the decoded Management API Token) and the Management API Access Token, respectively. + +## Keep reading + +* [Management API Explorer](/api/management/v2#!) +* [Management API Access Tokens FAQs](/api/management/v2/faq-management-api-access-tokens) diff --git a/articles/api/management/v2/get-access-tokens-for-test.md b/articles/api/management/v2/get-access-tokens-for-test.md new file mode 100644 index 0000000000..ad6a3e6b1b --- /dev/null +++ b/articles/api/management/v2/get-access-tokens-for-test.md @@ -0,0 +1,58 @@ +--- +description: How to get an Access Token manually for testing purposes. +section: apis +toc: true +topics: + - apis + - management-api + - tokens +contentType: + - How-to +useCase: invoke-api +--- + +# Get Access Tokens for Testing + +::: warning +This method for obtaining Access Tokens is **only for test purposes**. Do not get manually long-lived tokens and use them in your applications, because that nullifies the security advantages that tokens offer. +::: + +## Prerequisite + +* [Create and Authorize a Machine-to-Machine Application](/api/management/v2/create-m2m-app). + +## Get Access Tokens Manually + +1. Go to [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer). +A token is automatically generated and displayed there. + +2. Click __Copy Token__. +You can now make authorized calls to the [Management API](/api/management/v2) using this token. + +![Test Application](/media/articles/api/tokens/copy-token.png) + +3. Set expiration time. +This token has, by default, an expiration time of __24 hours__ (86400 seconds). After that period, the token expires and you will need to get a new one. To change the expiration time, update the __Token Expiration (Seconds)__ field and click __Update & Regenerate Token__. + +:::warning +These tokens **cannot be revoked** so long expiration times are not recommended. Instead we recommend that you use short expiration times and issue a new one every time you need it. +::: + +## Use Access Tokens for Testing + +To use the Access Token you just created for testing purposes, use the [Management API v2 explorer page](/api/management/v2) to manually call an endpoint with the token. + +1. Go to the [Management API v2 explorer page](/api/management/v2#!). +1. Click the __Set API Token__ button at the top left. +1. Set the __API Token__ field, and click __Set Token__. +1. Under the __Set API Token__ button at the top left, some new information is now displayed: the domain and token set, and the scopes that have been granted to this application. +1. Go to the endpoint you want to call, fill any parameters that might be required and click __Try__. + +![Set the Token](/media/articles/api/tokens/set-token.png) + +## Keep reading + +* [Get Access Tokens for Production](/api/management/v2/get-access-tokens-for-production) +- [Applications](/applications) +* [Management API Explorer](/api/management/v2#!) +* [Management API Access Tokens FAQs](/api/management/v2/faq-management-api-access-tokens) diff --git a/articles/api/management/v2/tokens-flows.md b/articles/api/management/v2/tokens-flows.md index 04840f3d5f..18ddec7612 100644 --- a/articles/api/management/v2/tokens-flows.md +++ b/articles/api/management/v2/tokens-flows.md @@ -12,128 +12,38 @@ useCase: invoke-api --- # Changes in Auth0 Management APIv2 Tokens -Some time ago we changed the process to get a Management APIv2 Token. This article explains what changed, why this was done and how you can work around it (not recommended). +Some time ago, we changed the process of getting a Management APIv2 Token. This article explains what changed, why this was done, and how you can work around it (not recommended). ## What changed and why ### The User Experience -Until recently you could generate a Management APIv2 Token directly from the Management API explorer. You selected the scopes, according to the endpoint you wanted to invoke, and got a token from that same page. +Until recently, you could generate a Management APIv2 Token directly from the Management API explorer. You selected the scopes, according to the endpoint you wanted to invoke, and got a token from that same page. That way was very easy but it was also __very insecure__. So we changed it. -The new way uses the [OAuth 2.0 Client Credentials grant](/api-auth/grant/client-credentials). +The new way uses the [Client Credentials Flow](/flows/concepts/client-credentials). ::: note -For details on how to follow this new process refer to [How to Get an Access Token for the Management API](/api/management/v2/tokens). +For details on how to follow this new process, see [Access Tokens for the Management API](/api/management/v2/tokens). ::: #### Why this changed -In order to generate the token, the Management API required access to your __Global Client Secret__ (used to sign the token). This is information that should __not__ be exposed to web browsers. +To generate the token, the Management API required access to your __Global Client Secret__ (used to sign the token). This is information that should __not__ be exposed to web browsers. -Furthermore, the API Explorer has no way to do authorization. This means that if you could login and access the API explorer, you could generate a token with __any__ scope, even if you as the logged in user were not allowed to have that scope. +Furthermore, the API Explorer has no way to do authorization. This means that if a user could login and access the API explorer, they could generate a token with __any__ scope, even if they were not allowed to have that scope. The new OAuth 2.0 Client Credentials grant implementation does not pose such risks. Once you do the initial configuration, you can get a token either by visiting the dashboard, or by making a simple `POST` request to [the `/oauth/token` endpoint of our Authentication API](/api/authentication#client-credentials). However, with regards to the manual process, we do understand that changing screens is not always the best user experience, so we are looking into ways to make the new flow more intuitive. - ### The Validity Period -With the previous flow the tokens never expired. With the new flow all Management APIv2 Tokens __expire by default after 24 hours__. You can [work around that](#can-i-still-get-a-non-expiring-token-), even though we do not recommend it. +With the previous flow, the tokens never expired. With the new flow, all Management APIv2 Tokens __expire by default after 24 hours__. #### Why this changed Having a token that never expires can be very risky, in case an attacker gets hold of it. If the token expires within a few hours the attacker has only a small window to access your protected resources. -## Can I still get a non-expiring token? - -Yes you can. We added a text box (__Token Expiration (Seconds)__), at [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer), where you can set the new expiration time (in seconds) and click __Update & Regenerate Token__. A new token will be generated with your custom expiration time. Our recommendation however is not to use this and get a new token every 24 hours. You can easily automate this [following this process](/api/management/v2/tokens#1-get-a-token). - -Furthermore, you can generate a token using [JWT.io](https://jwt.io/): -- Use the [JWT.io Debugger](https://jwt.io/#debugger-io) to manually type the claims and generate a token. -- Use one of the [JWT.io libraries](https://jwt.io/#libraries-io). - -::: warning -Long-lived tokens compromise your security. Following this process is NOT recommended. -::: - -### Use the JWT.io Debugger - -You can use the [JWT.io Debugger](https://jwt.io/#debugger-io) to manually generate a token. - -The debugger allows you to edit the __Header__ and __Payload__ content on the right hand side of the screen. The token will automatically be updated on the left hand text area. Note that the debugger supports only `HS256` when editing header and payload. - -To generate a token follow the next steps: - -1. Go to [JWT.io Debugger](https://jwt.io/#debugger-io). Notice that there is a sample token on the left hand editor. The right hand editor contains the header, payload and verify signature parts. - -2. Delete the dummy `secret` value from the _Verify Signature_ panel. Set your __Global Client Secret__ (you can find this value at [Advanced Tenant Settings](${manage_url}/#/tenant/advanced)) and check the __secret base64 encoded__ flag. - -3. Make sure the _Header_ contains the `alg` and `typ` claims, as follows. - - ```json - { - "alg": "HS256", - "typ": "JWT" - } - ``` -4. Delete the dummy claims from the _Payload_ and add the following claims: `iss`, `aud`, `scope`, `iat`, `exp`. - - ```json - { - "iss": "https://${account.namespace}/", - "aud": "YOUR_GLOBAL_CLIENT_ID", - "scope": "SPACE-SEPARATED-LIST-OF-SCOPES", - "iat": CURRENT_TIMESTAMP, - "exp": EXPIRY_TIME - } - ``` - - Where: - - - __iss__: Who issued the token. Use your tenant's __Domain__. You can find this value at any [Application's Settings](${manage_url}/#/applications/${account.clientId}/settings). - - - __aud__: Who is the intended audience for this token. Use the __Global Client Id__ of your tenant. You can find this value at [Advanced Tenant Settings](${manage_url}/#/tenant/advanced). - - - __scope__: The (space separated) list of authorized scopes for the token. Each [Auth0 Management API v2](/api/management/v2) endpoint requires specific scopes. For example, the [Get all applications](/api/management/v2#!/Clients/get_clients) endpoint requires the scopes `read:clients` and `read:client_keys`, while the [Create an application](/api/management/v2#!/Clients/post_clients) endpoint requires the scope `create:clients`. So if you need to read _and_ create applications, then the token should include three scopes: `read:clients`, `read:client_keys` and `create:clients`. In this case you would set the scope at the editor to the value `read:clients read:client_keys create:clients`. - - - __iat__: The time at which the token was issued. It must be a number containing a `NumericDate` value, for example `1487260214` (which maps to `Thu, 16 Feb 2017 15:50:14 GMT`). You can use an [epoch converter](http://www.epochconverter.com/) to get this value. - - - __exp__: The time at which the token will expire. It must be a number containing a `NumericDate` value, for example `1518808520` (which maps to `Fri, 16 Feb 2018 19:15:20 GMT`). - -5. As you type the token on the left hand editor is automatically refreshed. When you are done copy this value. - -### Use a Library - -- Use one of the [JWT.io libraries](https://jwt.io/#libraries-io). For example, the following snippet generates a JWT using [node-jsonwebtoken](https://github.com/auth0/node-jsonwebtoken): - - ```javascript - const jwt = require('jsonwebtoken'); - const globalClientSecret = new Buffer('YOUR_GLOBAL_CLIENT_SECRET', 'base64'); - const currentTimestamp = Math.floor(new Date()); - - var token = jwt.sign({ - iss: 'https://${account.namespace}/', - aud: 'YOUR_GLOBAL_CLIENT_ID', - scope: 'read:clients read:client_keys'}, - globalClientSecret, - { //options - algorithm: 'HS256', - expiresIn: '1y' - } - ); - - console.log(token); - ``` - - Note the following: - - - The token is signed using `HS256` and the __Global Client Secret__ (you can find this value at [Advanced Tenant Settings](${manage_url}/#/tenant/advanced)). - - - The audience (claim `aud`) is the __Global Client Id__ (you can find this value at [Advanced Tenant Settings](${manage_url}/#/tenant/advanced)). - - - We want this token in order to call the [Get all applications](/api/management/v2#!/Clients/get_clients) so we only asked for the scopes required by this endpoint: `read:clients read:client_keys`. - - - The token expires in one year (`expiresIn: '1y'`). +To get a token, you should follow only the process described in [Access Tokens for the Management API](/api/management/v2/tokens). diff --git a/articles/api/management/v2/tokens.md b/articles/api/management/v2/tokens.md index 4bcf7cb20c..4d99886e40 100644 --- a/articles/api/management/v2/tokens.md +++ b/articles/api/management/v2/tokens.md @@ -1,329 +1,38 @@ --- -description: Details on how to generate and use a token for the Auth0 Management APIv2 +description: Overview of how Auth0 Management APIv2 Access Tokens work and how to use them. section: apis -toc: true topics: - apis - management-api - tokens contentType: - concept - - how-to useCase: invoke-api --- -# How to Get an Access Token for the Management API -In order to call the endpoints of [Auth0 Management API v2](/api/management/v2), you need to authenticate. For this you need a token, which we call the __Auth0 Management API Token__. +# Access Tokens for the Management API -This token is a [JSON Web Token](/jwt) and it contains specific granted permissions (known as __scopes__). +To call the [Auth0 Management API v2](/api/management/v2) endpoints, you need to authenticate with a token called the __Auth0 Management API Token__. This token is a JSON Web Token (JWT) and it contains specific granted permissions (known as __scopes__). -## How to get and use tokens +To call an endpoint for test purposes, you can get a token manually using the Dashboard. For production however, the recommended best practice is to get short-lived tokens programmatically. -If you want to quickly call an endpoint for test purposes, then you can [get a token manually using the Dashboard](#get-a-token-for-test). +To call endpoints, you will need to do the following: -For production use however, the recommended best practice is to [get short-lived tokens programmatically](#get-a-token-for-production). - -## Before you start - -In this section we will see some configuration you must do in the Auth0 [Dashboard](${manage_url}) the first time you want to get a token for the Management API. You won't have to do this again, unless you create a new tenant. - -You must create and authorize a [Machine to Machine Application](/applications/machine-to-machine). We recommend creating one exclusively for authorizing access to the Management API, instead of reusing another one you might have. - -To create and authorize a Machine to Machine Application for the Management API: -1. Go to [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer) -2. Click the button __Create & Authorize a Test Application__ -3. That's it! A new application has been created and it's authorized to access the Management API - -![Create and Authorize Application](/media/articles/api/tokens/create-authorize-client.png) - -Note, that each Machine to Machine Application that accesses an API, has to be granted a set of scopes. This application that we just created has been granted __all__ the Management API scopes. This means that it can access all the endpoints. - -::: panel What are the scopes? -The scopes are permissions that should be granted by the owner. Each [Auth0 Management API v2](/api/management/v2) endpoint requires specific scopes. For example, the [Get all clients](/api/management/v2#!/Clients/get_clients) endpoint requires the scopes `read:clients` and `read:client_keys`, while the [Create an application](/api/management/v2#!/Clients/post_clients) endpoint requires the scope `create:clients`. From that we can deduce that if we need to read _and_ create applications, then our token should include three scopes: `read:clients`, `read:client_keys` and `create:clients`. -::: - -If you have multiple applications that should access the Management API, and you need different sets of scopes per app, we recommend creating a new Machine to Machine Application for each. For example, if one application is to read and create users (`create:users`, `read:users`) and another to read and create applications (`create:clients`, `read:clients`) create two Applications (one for user scopes, one for applications) instead of one. - -:::panel How do I know which scopes I must set? -Go to the [Management API Explorer](/api/management/v2#!) and find the endpoint you want to call. Each endpoint has a section called **Scopes** and there you can find listed all the scopes that this endpoint requires. For example, the [Get all clients](/api/management/v2#!/Clients/get_clients) endpoint requires the scopes `read:clients` and `read:client_keys`. -::: - -## Get a token for test - -:::note -If this the first time you are trying to get a token for your tenant, then you must do some [configuration steps](#before-you-start) before you continue in this section. -::: - -Let's see how you can get a token manually. Remember, this is only for test purposes. You shouldn't get manually long-lived tokens and use them in your applications, since this is cancelling out the security advantages that tokens offer. - -To manually get a token, go to [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer). A token is automatically generated and displayed there. - -Click __Copy Token__. You can now make authorized calls to the [Management API v2](/api/management/v2) using this token. - -![Test Application](/media/articles/api/tokens/copy-token.png) - -Note that this token has by default an expiration time of __24 hours__ (86400 seconds). After that the token will expire and you will have to get a new one. To change that, update the __Token Expiration (Seconds)__ field and click __Update & Regenerate Token__. - -:::warning -These tokens **cannot be revoked** so long expiration times are not recommended. Instead we recommend that you use short expiration times and issue a new one every time you need it. -::: - -### Use the token - -You can use the [Management API v2 explorer page](/api/management/v2) to manually call an endpoint, using the token you got in the previous step. You will need: -- The Management API v2 token you just got. -- Your tenant's domain (`${account.namespace}`). You can find this on the _Settings_ of any of your [Applications](${manage_url}/#/applications/${account.clientId}/settings). - -Once you have this information you are ready to call the API. Follow these steps: -1. Go to the [Management API v2 explorer page](/api/management/v2) -1. Click the __Set API Token__ button at the top left -1. Set the __Domain__ and __API Token__ fields, and click __Set Token__ -1. Under the __Set API Token__ button at the top left, some new information is now displayed: the domain and token set, and the scopes that have been granted to this application -1. Go to the endpoint you want to call, fill any parameters that might be required and click __Try__ - -![Set the Token](/media/articles/api/tokens/set-token.png) - -## Get a token for production - -:::note -If this the first time you are trying to get a token for your tenant, then you must do some [configuration steps](#before-you-start) before you continue in this section. -::: - -[The manual process](#get-a-token-for-test) might work for you if you want to test an endpoint. But if you need to make scheduled frequent calls then you have to build a process at your backend that will provide you with a token automatically (and thus simulate a non-expiring token). - -### Step 1. Get a token - -To ask Auth0 for a Management API v2 token, perform a `POST` operation to the `https://${account.namespace}/oauth/token` endpoint, using the credentials of the Machine to Machine Application you created at [this step](#1-create-and-authorize-an-application). - -The payload should be in the following format: - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/oauth/token", - "headers": [ - { "name": "Content-Type", "value": "application/json" } - ], - "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"client_credentials\",\"client_id\": \"${account.clientId}\",\"client_secret\": \"YOUR_CLIENT_SECRET\",\"audience\": \"https://${account.namespace}/api/v2/\"}" - } -} -``` - -The request parameters are: - -| __Request Parameter__ | __Description__ | -| ------ | ----------- | -| __grant_type__ | Denotes which [OAuth 2.0 flow](/protocols/oauth2#authorization-grant-types) you want to run. For machine to machine communication use the value `client_credentials`. | -| __client_id__ | This is the value of the __Client ID__ field of the Machine to Machine Application you created at [this step](#before-you-start). You can find it at the [Settings tab of your Application](${manage_url}/#/applications/${account.clientId}/settings). | -| __client_secret__ | This is the value of the __Client Secret__ field of the Machine to Machine Application you created at [this step](#before-you-start). You can find it at the [Settings tab of your Application](${manage_url}/#/applications/${account.clientId}/settings). | -| __audience__ | This is the value of the __Identifier__ field of the `Auth0 Management API`. You can find it at the [Settings tab of the API](${manage_url}/#/apis). | - -The response will contain a [signed JWT](/jwt), when it expires, the scopes granted, and the token type. - -```json -{ - "access_token": "eyJ...Ggg", - "expires_in": 86400, - "scope": "read:clients create:clients read:client_keys", - "token_type": "Bearer" -} -``` - -From the above we can see that our Access Token is a [bearer Access Token](https://tools.ietf.org/html/rfc6750), it will expire in 24 hours (86400 seconds), and it has been authorized to read and create applications. - -#### Use Auth0's Node.js Client Library - -As an alternative to making HTTP calls, you can use the [node-auth0](https://www.npmjs.com/package/auth0) library to automatically [obtain tokens for the Management API](https://www.npmjs.com/package/auth0#user-content-management-api-client). - -### Step 2. Use the token - -To use this token, include it in the `Authorization` header of your request. - -```har -{ - "method": "POST", - "url": "http://PATH_TO_THE_ENDPOINT/", - "headers": [ - { "name": "Content-Type", "value": "application/json" }, - { "name": "Authorization", "value": "Bearer YOUR_ACCESS_TOKEN"} - ] -} -``` - -For example, in order to [Get all applications](/api/management/v2#!/Clients/get_clients) use the following: - -```har -{ - "method": "GET", - "url": "https://${account.namespace}/api/v2/clients", - "headers": [ - { "name": "Content-Type", "value": "application/json" }, - { "name": "Authorization", "value": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Ik5ESTFNa05DTVRGQlJrVTRORVF6UXpFMk1qZEVNVVEzT1VORk5ESTVSVU5GUXpnM1FrRTFNdyJ9.eyJpc3MiOiJodHRwczovL2RlbW8tYWNjb3VudC5hdXRoMC5jb20vIiwic3ViIjoib9O7eVBnMmd4VGdMNjkxTnNXY2RUOEJ1SmMwS2NZSEVAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vZGVtby1hY2NvdW50LmF1dGgwLmNvbS9hcGkvdjIvIiwiZXhwIjoxNDg3MDg2Mjg5LCJpYXQiOjE5ODY5OTk4ODksInNjb3BlIjoicmVhZDpjbGllbnRzIGNyZWF0ZTpjbGllbnRzIHJlYWQ6Y2xpZW50X2tleXMifQ.oKTT_cEA_U6hVzNYPCl_4-SnEXXvFSOMJbZyFydQDPml2KqBxVw_UPAXhjgtW8Kifc_b2HQ4jFh7nH0KC_j1XjfEJPvwFZgqfI_ILzO3DPfpEIK_n_aX-Tz4okbZe6nj2aT_qLpHimLxK50jOGaMuzp4a1djHJTj5q-NbIiPW8AJowS2-gveP4T3dyyegUsZkmTNwrreqppPApmpWWE-wVsxnVsI_FZFrHnq0rn7lmY_Iz6vyiZjaKrd2C3hFm0zFGTn8FslBfHUldTcDNzOKOpCq7HFMeU0urXBXDetrzkW1afxIqED3G2C51JEV-4nTRYUinnWgXJfLJ87G3ge_A"} - ] -} -``` +* [Create and Authorize a Machine-to-Machine Application](/api/management/v2/create-m2m-app) +* [Get Access Tokens for Testing](/api/management/v2/get-access-tokens-for-test) +* [Get Access Tokens for Production](/api/management/v2/get-access-tokens-for-production) ::: note -You can get the curl command for each endpoint from the Management API v2 Explorer. Go to the endpoint you want to call, and click the __get curl command__ link at the __Test this endpoint__ section. +For single-page applications (SPAs), there are some limitations. See [Get Management API Tokens for SPAs](/api/management/v2/get-access-tokens-for-spas) for more information. ::: -### Sample Implementation: Python - -This python script gets a Management API v2 Access Token, uses it to call the [Get all applications](/api/management/v2#!/Clients/get_clients) endpoint, and prints the response in the console. - -Before you run it make sure that the following variables hold valid values: -- `AUDIENCE`: The __Identifier__ of the `Auth0 Management API`. You can find it at the [Settings tab of the API](${manage_url}/#/apis). -- `DOMAIN`: The __Domain__ of the Machine to Machine Application you created at [this step](#before-you-start). -- `CLIENT_ID`: The __Client ID__ of the Machine to Machine Application you created at [this step](#before-you-start). -- `CLIENT_SECRET`: The __Client Secret__ of the Machine to Machine Application you created at [this step](#before-you-start). - -```python -def main(): - import json, urllib, urllib2 - - # Configuration Values - AUDIENCE = "https://${account.namespace}/api/v2/" - DOMAIN = "${account.namespace}" - CLIENT_ID = "${account.clientId}" - CLIENT_SECRET = "YOUR_CLIENT_SECRET" - GRANT_TYPE = "client_credentials" # OAuth 2.0 flow to use - - # Get an Access Token from Auth0 - base_url = "https://{domain}".format(domain=DOMAIN) - data = urllib.urlencode([('client_id', CLIENT_ID), - ('client_secret', CLIENT_SECRET), - ('audience', AUDIENCE), - ('grant_type', GRANT_TYPE)]) - req = urllib2.Request(base_url + "/oauth/token", data) - response = urllib2.urlopen(req) - oauth = json.loads(response.read()) - access_token = oauth['access_token'] - - # Get all Applications using the token - req = urllib2.Request(base_url + "/api/v2/clients") - req.add_header('Authorization', 'Bearer ' + access_token) - req.add_header('Content-Type', 'application/json') - - try: - response = urllib2.urlopen(req) - res = json.loads(response.read()) - print res - except urllib2.HTTPError, e: - print 'HTTPError = ' + str(e.code) + ' ' + str(e.reason) - except urllib2.URLError, e: - print 'URLError = ' + str(e.reason) - except urllib2.HTTPException, e: - print 'HTTPException' - except Exception: - print 'Generic Exception' - -# Standard boilerplate to call the main() function. -if __name__ == '__main__': - main() -``` - -## Get a token from the frontend - -The method we showed in the previous section cannot be used from Single Page Applications (SPAs). The reason why is because we are using the **Client Secret** which is sensitive information (same as a password) and cannot be exposed to the browser. - -You can still get tokens for the Management API from the frontend, but very limited in scope. You can access only certain scopes and update only the logged-in user's data. In detail, you can access the following scopes, and hence endpoints: - -| **Endpoint** | **Scope for current user** | -| ------ | ----------- | -| [GET /api/v2/users/{id}](/api/management/v2#!/Users/get_users_by_id) | `read:current_user` | -| [GET /api/v2/users/{id}/enrollments](/api/management/v2#!/Users/get_enrollments) | `read:current_user` | -| [POST/api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities) | `update:current_user_identities` | -| [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_provider_by_user_id) | `update:current_user_identities` | -| [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | `update:current_user_metadata` | -| [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | `create:current_user_metadata` | -| [DELETE /api/v2/users/{id}/multifactor/{provider}](/api/management/v2#!/Users/delete_multifactor_by_provider) | `delete:current_user_metadata` | -| [POST /api/v2/device-credentials](/api/management/v2#!/Device_Credentials/post_device_credentials) | `create:current_user_device_credentials` | -| [DELETE /api/v2/device-credentials/{id}](/api/management/v2#!/Device_Credentials/delete_device_credentials_by_id) | `delete:current_user_device_credentials` | - -For example, if I get an Access Token that contains the scope `read:current_user` I can retrieve the information of the **currently logged-in user** (the one that the token was issued for). - -You can get a token, for example to retrieve the information of the currently logged-in user, using the [Authorization endpoint](/api/authentication#authorize-application). This is where you redirect your users to login or sign up. - -In the example below, we want to use the [GET User by ID endpoint](/api/management/v2#!/Users/get_users_by_id) to retrieve the full profile information of the logged-in user. To do so, first we will authenticate our user (using the [Implicit grant](/api/authentication?http#implicit-grant)) and retrieve the token(s). - -```text -https://${account.namespace}/authorize? - audience=https://${account.namespace}/api/v2/ - &scope=read:current_user - &response_type=token%20id_token - &client_id=${account.clientId} - &redirect_uri=${account.callback} - &nonce=CRYPTOGRAPHIC_NONCE - &state=OPAQUE_VALUE -``` - -:::note -If you are not familiar with authentication for Single Page Applications, see [Authentication for Client-side Web Apps](/application-auth/current/client-side-web). -::: - -Notice the following: -- We set the `audience` to `https://${account.namespace}/api/v2/` -- We asked for the scope `read:current_user` -- We set the `response_type` to `id_token token` so Auth0 will sent us both an ID Token and an Access Token - -If we decode the Access Token and review its contents we can see the following: - -```text -{ - "iss": "https://${account.namespace}/", - "sub": "auth0|5a620d29a840170a9ef43672", - "aud": "https://${account.namespace}/api/v2/", - "iat": 1521031317, - "exp": 1521038517, - "azp": "${account.clientId}", - "scope": "read:current_user" -} -``` - -Notice that the `aud` is set to your tenant's API URI, the `scope` to `read:current_user`, and the `sub` to the user ID of the logged in user. - -Once you have the Access Token you can use it to call the endpoint. Use the Access Token in the `Authorization` header of the request. - -```har -{ - "method": "GET", - "url": "https://${account.namespace}/api/v2/users/USER_ID", - "headers": [{ - "name": "Authorization", - "value": "Bearer YOUR_MGMT_API_ACCESS_TOKEN" - }] -} -``` - -## Frequently Asked Questions - -__How long is the token valid for?__
    -The Management API token has by default a validity of __24 hours__. After that the token will expire and you will have to get a new one. If you get one manually from [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer) though, you can change the expiration time. However, having non-expiring tokens is not secure. - -__The old way of generating tokens was better, since the token never expired. Why was this changed?__
    -The old way of generating tokens was insecure since the tokens had an infinite lifespan. The new implementation allows tokens to be generated with specific scopes and expirations. We decided to move to the most secure implementation because your security, and that of your users, is priority number one for us. - -__Can I change my token's validity period?__
    -You cannot change the default validity period, which is set to 24 hours. However, if you get a token manually from [the API Explorer tab of your Auth0 Management API](${manage_url}/#/apis/management/explorer) you can change the expiration time for the specific token. Note though, that your applications should use short-lived tokens to minimize security risks. - -__Can I refresh my token?__
    -You cannot renew a Management API token. A [new token](#2-get-the-token) should be created when the old one expires. - -__My token was compromised! Can I revoke it?__
    -You cannot directly revoke a Management API token, thus we recommend a short validity period. -Note that deleting the application grant will prevent *new tokens* from being issued to the application. You can do this either by [using our API](/api/management/v2#!/Client_Grants/delete_client_grants_by_id), or manually [deauthorize the API application using the dashboard](${manage_url}/#/apis/management/authorized-applications). - -__My Client Secret was compromised! What should I do?__
    -You need to change the secret immediately. Go to your [Application's Settings](${manage_url}/#/applications/${account.clientId}/settings) and click the __Rotate__ icon , or use the [Rotate a client secret](/api/management/v2#!/Clients/post_rotate_secret) endpoint. Note that previously issued tokens will continue to be valid until their expiration time. - ## Keep reading -::: next-steps +* [Access Tokens](/tokens/concepts/access-tokens) +* [Management API Access Token FAQs](/api/management/v2/faq-management-api-access-tokens) * [Changes in Auth0 Management API Tokens](/api/management/v2/tokens-flows) -* [Calling APIs from a Service](/api-auth/grant/client-credentials) +* [Client Credentials Flow](/flows/concepts/client-credentials) * [Ask for Access Tokens for a Client Credentials Grant](/api-auth/config/asking-for-access-tokens) -* [Information on the query string syntax](/api/management/v2/query-string-syntax) -* [Search for Users](/users/search) -::: +* [User Search](/users/search) +* [User Search Query Syntax](/users/search/v3/query-syntax) + diff --git a/articles/api/postman.md b/articles/api/postman.md index 06507dc992..7bdcb17983 100644 --- a/articles/api/postman.md +++ b/articles/api/postman.md @@ -1,63 +1,61 @@ --- -desription: This page explains how to use Postman Collections to access Auth0 APIs. +description: Learn how to use Postman Collections to access Auth0 APIs. section: apis topics: - - management-api - - authorization-api - - apis + - management-api + - authorization-api + - apis contentType: how-to useCase: invoke-api --- -# Using the Auth0 API with our Postman Collections +# Use Auth0 APIs with Postman Collections -## Installing the Collections +## Install Postman Collections -To install the Postman Collection you will need to have installed the Postman App for Windows, Mac or Chrome. You can download any of these from the [Postman Apps page](https://www.getpostman.com/apps). +To install the Postman Collection, you must first install the Postman App for Windows, Mac, or Chrome. You can download any of these from[Postman Apps](https://www.getpostman.com/apps). -Next, head over to our new [API Landing Page](/api/info), and install the Collection you want to use by clicking on the relevant "Run in Postman" button. +Next, visit [Auth0 APIs](/api/info) and install the Collection you want to use by clicking on the relevant **Run in Postman** button. -![](/media/articles/api/postman/auth0-api-landing.png) +![Auth0 API Postman Button](/media/articles/api/postman/auth0-api-landing.png) -Postman will prompt whether you want to open the Collection in Postman for Chrome or Postman for Windows / Mac. Select the application you have installed. +Postman will prompt whether you want to open the Collection in Postman for Chrome or Postman for Windows/Mac. Select the application you installed. -![](/media/articles/api/postman/postman-open-with-dialog.png) +Once you make a selection, the selected Postman application will open and the collection will be imported. -Once you have made a selection, the selected Postman application will be opened and the collection will be imported. +Our API Collections are organized into folders that categorize the various API calls according to category. For example, you will find all the Users methods under the **Users** folder in the Management API. -![](/media/articles/api/postman/collection-post-install.png) +## Configure Postman Environment -Our API Collections are organized into folders which categorizes the various API calls according to category, so for example, for the Management API you will find all the Users methods under the **Users** folder. +The Auth0 Postman Collections make use of environment variables to customize the requests that are sent. To learn more about managing Postman environments, see [Setting up an environment with variables](https://learning.postman.com/docs/postman/variables-and-environments/variables/). -## Configuring the Postman Environment +You must create an environment and configure the following variables: -The Auth0 Postman collections make use of environment variables to customize the requests being sent. More information on managing Postman environments can be found at [Setting up an environment with variables](https://www.getpostman.com/docs/environments) +| Variable | Description | +| -- | -- | +| `auth0_domain` | Should contain the domain for your Auth0 tenant, such as `jerrie.auth0.com`. | +| `auth0_token` | Should contain the token needed to make calls to the Management API. Is only required when using the Management API collection. To learn more, see [How to Get an Access Token for the Management API](/api/management/v2/tokens). | -You will need to create an environment and configure the following variables: +In the screenshot below, you can see a Postman environment configured with both the `auth0_domain` and `auth0_token` variables defined: -* `auth0_domain`: Should contain the domain for your Auth0 tenant, such as **jerrie.auth0.com**. -* `auth0_token`: Should contain the token needed when making calls to the Management API, and is therefore only required when using the Management API collection. For more information see [How to Get an Access Token for the Management API](/api/management/v2/tokens) +![Environment Configured](/media/articles/api/postman/environment-configured.png) -In the screenshot below you can see a Postman environment configured with both the `auth0_domain` and `auth0_token` variables defined: - -![](/media/articles/api/postman/environment-configured.png) - -## Executing a request +## Execute requests Once the environment is configured, you can follow these steps to execute an Auth0 API method: -1. Select the environment you want to work with -2. Select the relevant API method in the collection folder -3. Click the send button - -![](/media/articles/api/postman/execute-api-method.png) +1. Select the environment with which you want to work. +2. Select the relevant API method in the collection folder. +3. Click the **Send** button. -You may also optionally have to configure query parameters or the JSON method body, depending on the API call. For more information please refer to the [Sending Requests](https://www.getpostman.com/docs/requests) document on the Postman website. +![Execute API Method](/media/articles/api/postman/execute-api-method.png) -## A word about storing tokens in Postman variables +You may also have to configure query parameters or the JSON method body, depending on the API call. To learn more, see [Sending Requests](https://learning.getpostman.com/docs/postman/sending-api-requests/requests/). -We do need to point out that storing tokens in Postman as environment variables could pose a potential security risk. If you are signed in to the Postman application it will automatically try and [synchronize some entities such as Collections and Environments with the Postman servers](https://www.getpostman.com/docs/sync_overview). This means that a token, which could allow someone else to gain access to your Management API, is leaving the privacy of your computer and uploaded Postman's servers. +::: warning +Storing tokens in Postman as environment variables could pose a security risk. If you are signed in to the Postman application, it will automatically try to [synchronize entities such as Collections and Environments with the Postman servers](https://www.getpostman.com/docs/sync_overview). This means that a token, which could allow someone else to gain access to your Management API, is leaving the privacy of your computer and being uploaded to Postman's servers. -It also has to be said that Postman has taken measures to ensure that this information is encrypted, and indeed encourages users to store this sort of information in Environment Variables. You can [read more about this on their website](https://www.getpostman.com/docs/security). +That said, Postman has taken measures to ensure that tokens are encrypted and encourages users to store them in Environment Variables. You can read more at [Postman Security](https://www.getpostman.com/security). -If you feel that this still poses too much of a risk for you, then you will need to sign out of Postman to ensure that environment variables are not synchronized. +If you feel that this still poses too much of a risk, then you will need to sign out of Postman to ensure that environment variables are not synchronized. +::: \ No newline at end of file diff --git a/articles/appliance/admin/backing-up-the-appliance-instances.md b/articles/appliance/admin/backing-up-the-appliance-instances.md index 7dc235c9d7..a8a8111de9 100644 --- a/articles/appliance/admin/backing-up-the-appliance-instances.md +++ b/articles/appliance/admin/backing-up-the-appliance-instances.md @@ -7,6 +7,7 @@ topics: contentType: concept useCase: appliance applianceId: appliance1 +sitemap: false --- # PSaaS Appliance Administration: Appliance Backups diff --git a/articles/appliance/admin/creating-tenants.md b/articles/appliance/admin/creating-tenants.md deleted file mode 100644 index 205b6b443b..0000000000 --- a/articles/appliance/admin/creating-tenants.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -section: appliance -description: How to automatically create tenants in the PSaaS Appliance -topics: - - appliance - - tenants -contentType: how-to -useCase: appliance -applianceId: appliance2 ---- - -# PSaaS Appliance Administration: Automatic Creation of Tenants - -If your business needs require you to create tenants regularly, you may automate this process in the PSaaS Appliance. For example, you might need to create one tenant for each customer or project that goes live. - -## Creating a Management API Application for the Root Tenant Authority - -1. Choose the Root Tenant Authority (RTA) tenant using the drop-down menu located in the top right-hand side of the Dashboard. -2. Go to the Applications page. -3. Create an application called 'Tenant Provisioning.' -4. Once you have created the 'Tenant Provisioning' application, go to the Connections tab and disable **all** Connections for this application. -5. Navigate to `${manage_url}/#/apis`. Click the link to open the Auth0 Management API. -6. Go to the Machine to Machine Applications tab, and enable Tenant Provisioning by moving the associated slide to the right. -7. Create the new application grant. - -### Creating the New Application Grant - -1. Navigate to the [Management API Explorer](/api/management/v2#!/Client_Grants/post_client_grants) to generate the required `POST` call. -2. Click the bubble that says **'create:client_grants'** to select that Scope. -3. Paste the following payload into the provided `body` box after you have supplied the client ID and the root tenant authority: - ```text - { - 'client_id': '${account.clientId}', - 'audience': 'https://ROOT_TENANT_AUTHORITY/api/v2/', - 'scope': ['create:tenants'] - } - ``` -4. Click 'Try' to test the provided information. If you receive a `201` response, you may proceed to click on the 'get curl command' link to generate the required `POST` call. It will contain the following information: - - ```har - { - "method": "POST", - "url": "https://ROOT_TENANT_AUTHORITY/api/v2/client-grants", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [], - "queryString" : [], - "postData": { - "mimeType": "application/json", - "text" : "{ \"client_id\": \"${account.clientId}\", \"audience\": \"https://ROOT_TENANT_AUTHORITY/api/v2/\", \"scope\": [\"create:tenants\"] }" - }, - "headersSize" : -1, - "bodySize" : -1, - "comment" : "" - } - ``` - -## Using the New Application grant - -Once you have created your New Application Grant, you may use it to complete the following tasks. - -### Getting an Access Token - -```har -{ - "method": "POST", - "url": "https://ROOT_TENANT_AUTHORITY_DOMAIN/oauth/token", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [ - { "name": "cache-control", "value": "no-cache" }, - { "name": "content-type", "value": "application/json" } - ], - "queryString" : [], - "postData" : { - "mimeType": "application/json", - "text": "{\"audience\": \"https://ROOT_TENANT_AUTHORITY/api/v2/\", \"grant_type\": \"client_credentials\",\"client_id\": \"${account.clientId}\", \"client_secret\": \"YOUR_CLIENT_SECRET\"}" - }, - "headersSize" : -1, - "bodySize" : -1, - "comment" : "" -} -``` - -In return, you will receive the Access Token: - -```text -{ - 'access_token': 'eyJ0eXAiO...' -} -``` - -### Creating a Tenant - -You may use the following call create a tenant. Once the tenant is created, the API responds with a Client ID and Secret that grants access to the Management API for the newly-created tenant (which you can then use to get additional Access Tokens--see the following section for the sample call). - -```har -{ - "method": "POST", - "url": "https://ROOT_TENANT_AUTHORITY_DOMAIN/api/v2/tenants", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [ - { "name": "cache-control", "value": "no-cache" }, - { "name": "content-type", "value": "application/json" }, - { "name": "authorization", "value": "Bearer ACCESS_TOKEN" } - ], - "queryString" : [], - "postData" : { - "mimeType": "application/json", - "text": "{\"name\": \"customer-1\",\"owners\": [\"me@email.com\"]}" - }, - "headersSize" : -1, - "bodySize" : -1, - "comment" : "" -} -``` - -#### Getting an Access Token for the Newly-Created Tenant - -This snippet shows how you can get an Access Token for the newly-created tenant, which you can then use to call the Management API. - -```har -{ - "method": "POST", - "url": "https://NEW_TENANT_DOMAIN/oauth/token", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [ - { "name": "cache-control", "value": "no-cache" }, - { "name": "content-type", "value": "application/json" } - ], - "queryString" : [], - "postData" : { - "mimeType": "application/json", - "text": "{\"audience\": \"https://NEW_TENANT_DOMAIN/api/v2/\", \"grant_type\": \"client_credentials\", \"client_id\": \"MANAGEMENT_CLIENT_ID\", \"client_secret\": \"MANAGEMENT_CLIENT_SECRET\"}" - }, - "headersSize" : -1, - "bodySize" : -1, - "comment" : "" -} -``` diff --git a/articles/appliance/admin/disabling-sign-ups.md b/articles/appliance/admin/disabling-sign-ups.md index 9762cc505e..219fc4f573 100644 --- a/articles/appliance/admin/disabling-sign-ups.md +++ b/articles/appliance/admin/disabling-sign-ups.md @@ -7,6 +7,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance3 +sitemap: false --- # PSaaS Appliance Administration: Disabling Sign-Ups diff --git a/articles/appliance/admin/federated-access-to-manage.md b/articles/appliance/admin/federated-access-to-manage.md new file mode 100644 index 0000000000..a5633b68fd --- /dev/null +++ b/articles/appliance/admin/federated-access-to-manage.md @@ -0,0 +1,65 @@ +--- +description: How to set up federated login to the Manage Dashboard +section: appliance +topics: + - appliance + - admin + - signups +contentType: how-to +useCase: appliance +applianceId: appliance76 +sitemap: false +--- +# Set Up Federated Login to the Manage Dashboard + +If you use an Identity Provider (IdP) to handle your staff logins, you can use the IdP with your root tenant authority (otherwise known as the RTA or your config tenant) to provide federated access to your Dashboard. + +By using your IdP, this eliminates the need for you to: + +* *For customer-hosted PSaaS Appliance:* Manually create users in the root tenant authority (RTA) +* *For Auth0-hosted PSaaS Appliance:* Open a support case requesting the addition of a Dashboard administrator. + +::: note +If you have an Auth0-hosted PSaaS Appliance, but you do not have access to the root tenant, please submit a [Support Ticket](${env.DOMAIN_URL_SUPPORT}) and the Appliance Services staff will help you set this up. +::: + +## Setting Up Federated Access + +The Auth0 root tenant acts as an identity provider (IdP) for the Manage Dashboard. As such, you will need to add a Service Provider (SP) to your existing IdP to federate access to the Manage Dashboard. + +This process requires the following three steps: + +1. Set up the Auth0 Service Provider (SP) + *For customers with Auth0-hosted PSaaS Appliance: Auth0 will create the Connection for you after you provide the necessary setup information.* +2. Provide your Service Provider metadata to the Identity Provider (IdP) +3. Test the Identity Provider + +Please note that how you complete the three steps above differ slightly based on whether you're working with a customer-hosted PSaaS Appliance or an Auth0-hosted PSaaS Appliance. + +### Customer-hosted PSaaS Appliance + +[Configure Auth0 as the Service Provider (SP)](/protocols/saml/saml-configuration/auth0-as-service-provider) and use both the root tenant authority and the new Service Provider Connection to access Auth0. + +### Auth0-hosted PSaaS Appliance + +[Configure Auth0 as the Service Provider (SP)](/protocols/saml/saml-configuration/auth0-as-service-provider). Follow the tutorial up through the section where you identify the Identity Provider (IdP) and Connection protocol (you will be stopping at the section where you're shown how to Configure Auth0). + +Please be sure to configure your mappings between Auth0 (as the SP) and your IdP in the form of Assertions. You can do so in the Dashboard by going to **Connections** > **Enterprise** > **SAMLP Identity Provider**. Find your connection, and click the cog icon to launch the **Settings** tab. Switch to the **Mappings** view, and provide mappings for **name**, the **name format** (optional), and **value**. The specifics will vary based on the IdP you're using, so please contact Auth0 if you have any questions. + +At this point, send Auth0 the information you've collected in a [Support Ticket](${env.DOMAIN_URL_SUPPORT}) and request that you be granted federated access to the config tenant/RTA. + +In your Support ticket, you should include: + +* The **email domain(s)** that will be redirected to your Identity Provider +* The Identity Provider's **single sign-on URL** +* The Identity Provider's **public key** (encoded in PEM or CER format) +* The **sign out URL** (optional) + +You can find most of this information in the XML metadata file provided by your Identity Provider. If you'd prefer, you can send Auth0 this file, along with the email domains that you will be redirecting to the IdP. + +Once Auth0 receives all of the information we need, we will: + +* Create a Connection in your root tenant +* Provide you with the metadata link containing the information you need to provide to your Identity Provider + +Once you provide this information (as well as the callback URL and the Entity ID) to your IdP, you will be able to test your federated Login to the Dashboard. \ No newline at end of file diff --git a/articles/appliance/admin/importance-of-updates.md b/articles/appliance/admin/importance-of-updates.md index c2107661ee..c38ad249b4 100644 --- a/articles/appliance/admin/importance-of-updates.md +++ b/articles/appliance/admin/importance-of-updates.md @@ -8,6 +8,7 @@ topics: contentType: concept useCase: appliance applianceId: appliance75 +sitemap: false --- # Why You Should Update the PSaaS Appliance Regularly diff --git a/articles/appliance/admin/index.md b/articles/appliance/admin/index.md index 964cdd0fc7..cdde2ec3c8 100644 --- a/articles/appliance/admin/index.md +++ b/articles/appliance/admin/index.md @@ -9,6 +9,7 @@ topics: contentType: index useCase: appliance applianceId: appliance4 +sitemap: false --- # PSaaS Appliance: Administrator's Manual @@ -22,4 +23,4 @@ This document covers factors PSaaS Appliance administrators should be aware of w * [Monitoring & Performing Health Checks on Load Balancers](/appliance/admin/monitoring) * [Updating the PSaaS Appliance](/appliance/admin/updating-the-appliance) * [Why You Should Update the PSaaS Appliance Regularly](/appliance/admin/importance-of-updates) -* [Configuring Custom Error Pages](/hosted-pages/custom-error-pages) +* [Configuring Custom Error Pages](/universal-login/custom-error-pages) diff --git a/articles/appliance/admin/inviting-coadmins.md b/articles/appliance/admin/inviting-coadmins.md index 0e50753ce5..a5f17a2222 100644 --- a/articles/appliance/admin/inviting-coadmins.md +++ b/articles/appliance/admin/inviting-coadmins.md @@ -7,6 +7,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance5 +sitemap: false --- # PSaaS Appliance Administration: Inviting Co-Administrators diff --git a/articles/appliance/admin/limiting-ssh-access.md b/articles/appliance/admin/limiting-ssh-access.md index 1dd62a328c..4d0b93b513 100644 --- a/articles/appliance/admin/limiting-ssh-access.md +++ b/articles/appliance/admin/limiting-ssh-access.md @@ -8,10 +8,11 @@ topics: contentType: concept useCase: appliance applianceId: appliance6 +sitemap: false --- # PSaaS Appliance Administration: Limiting SSH Access Auth0 requires SSH access in order to connect to the PSaaS Appliance to perform updates or troubleshooting/accessing required logs. These are the only instances where SSH (by default, port 22) should be exposed on the nodes. -In all other instances, Auth0 recommends restricting SSH access to the PSaaS Appliance. For Appliance deployments in the cloud, you would *not* enable the SSH endpoint for your virtual machines. For on-premise PSaaS Appliance deployments, you would deny SSH to to the virtual machines in your corporate firewall. +In all other instances, Auth0 recommends restricting SSH access to the PSaaS Appliance. For Appliance deployments in the cloud, you would *not* enable the SSH endpoint for your virtual machines. For on-premise PSaaS Appliance deployments, you would deny SSH to the virtual machines in your corporate firewall. diff --git a/articles/appliance/admin/managing-the-dashboard.md b/articles/appliance/admin/managing-the-dashboard.md index 7265afc65c..5ad7477bc3 100644 --- a/articles/appliance/admin/managing-the-dashboard.md +++ b/articles/appliance/admin/managing-the-dashboard.md @@ -7,6 +7,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance7 +sitemap: false --- # PSaaS Appliance Administration: Manage the Dashboard diff --git a/articles/appliance/admin/monitoring.md b/articles/appliance/admin/monitoring.md index 9297948dab..751be898b9 100644 --- a/articles/appliance/admin/monitoring.md +++ b/articles/appliance/admin/monitoring.md @@ -7,6 +7,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance8 +sitemap: false --- # PSaaS Appliance Administration: Monitoring diff --git a/articles/appliance/admin/rate-limiting.md b/articles/appliance/admin/rate-limiting.md index 298327f76a..5e276a2e64 100644 --- a/articles/appliance/admin/rate-limiting.md +++ b/articles/appliance/admin/rate-limiting.md @@ -7,6 +7,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance9 +sitemap: false --- # PSaaS Appliance: Rate Limiting diff --git a/articles/appliance/admin/updating-the-appliance.md b/articles/appliance/admin/updating-the-appliance.md index b4fc05c4c5..bfec4751aa 100644 --- a/articles/appliance/admin/updating-the-appliance.md +++ b/articles/appliance/admin/updating-the-appliance.md @@ -8,6 +8,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance10 +sitemap: false --- # Updating the PSaaS Appliance @@ -84,7 +85,28 @@ For additional information on gathering testing information, please see [PSaaS A * Perform the post-test check: * Check to see if all instances list the same update count and that they're currently running the latest version. * Check that all Health Checks are okay. - * Run smoke tests to ensure that there are no issues with the update. + +* Run smoke tests to ensure that there are no issues with the update. + + The specifics of what constitutes a complete smoke check for your PSaaS Appliance varies, since the appropriate tests vary based on your implementation and usage of Auth0. Furthermore, each organization prefers different levels of detail when it comes to testing -- some prefer more thorough testing than others. Regardless, we recommend testing at the very least: + + 1. All application functionality that involves authentication flows or user identity changes + 2. Basic access to the Auth0 Management Dashboard + + Some of the areas and processes that you might consider including in your smoke tests include: + + * Registration + * Login (including those involving Social or other identity providers) + * Logout + * Password reset + * Single sign-on (SSO) + * Passwordless/SMS login + * User metadata updates + * Machine-to-machine interactions + * SDK usage + * Mobile and desktop usage + * Login and use of the Auth0 Management Dashboard + * Extensions (make sure that the ones you've installed are functioning as expected Please remember that you are responsible for testing and ensuring that all of your applications work as expected. @@ -92,6 +114,6 @@ Please remember that you are responsible for testing and ensuring that all of yo During an upgrade, we expect there to be some downtime. For single-node clusters, we expect there to be 3-5 minutes of downtime. For multi-node clusters, we can perform updates sequentially, where users may see up to 30 seconds of downtime. -Downtime occurs when we restart services. Because of this, we are willing to schedule updates to Production clusters during non-business hours. Please contact your Customer Success Manager to select a time that would be best for you. +Downtime occurs when we restart services. Because of this, we are willing to schedule updates to Production clusters during non-business hours. Please let us know your preferences in the Support Ticket. -If you require your Production update during non-business hours, we ask that you confirm the day prior during normal business hours. \ No newline at end of file +If you require your Production update during non-business hours, we ask that you confirm the day prior during normal business hours. diff --git a/articles/appliance/appliance-overview.md b/articles/appliance/appliance-overview.md index 9fabccca19..ed9bfb70b7 100644 --- a/articles/appliance/appliance-overview.md +++ b/articles/appliance/appliance-overview.md @@ -6,6 +6,7 @@ topics: contentType: concept useCase: appliance applianceId: appliance52 +sitemap: false --- # PSaaS Appliance Overview @@ -13,12 +14,7 @@ applianceId: appliance52 The PSaaS Appliance is an option for your organization when compliance or other policy requirements prevent you from using a multi-tenant cloud service. The PSaaS Appliance can be deployed in one of three places: * a dedicated cloud environment hosted by Auth0 (you may opt for a shared cloud environment or an environment where resources are allocated only to your company). -* your cloud environment using **Amazon AWS** or **Microsoft Azure**. Other public cloud service providers will need to be reviewed. -* your own datacenter (as a managed service) using **VMWare** or **Microsoft Hyper-V**. - -::: note -Please contact us for additional information if you are interested in using cloud environments and/or virtualization environments not listed above. -::: +* your cloud environment using **Amazon AWS** ## Infrastructure diff --git a/articles/appliance/cli/adding-node-to-backup-role.md b/articles/appliance/cli/adding-node-to-backup-role.md index 1026c38009..fad2cdabe9 100644 --- a/articles/appliance/cli/adding-node-to-backup-role.md +++ b/articles/appliance/cli/adding-node-to-backup-role.md @@ -9,14 +9,11 @@ topics: contentType: how-to useCase: appliance applianceId: appliance11 +sitemap: false --- # PSaaS Appliance: Adding a Node to the Backup Role -::: note - This document applies beginning with PSaaS Appliance update **build 7247**. -::: - ## Prerequisites * Backup can be configured on single or multiple-node setups. In multi-node setups, the backup must be placed on a non-primary device. diff --git a/articles/appliance/cli/backing-up-the-appliance.md b/articles/appliance/cli/backing-up-the-appliance.md index 71990e5841..f382361fb5 100644 --- a/articles/appliance/cli/backing-up-the-appliance.md +++ b/articles/appliance/cli/backing-up-the-appliance.md @@ -9,6 +9,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance12 +sitemap: false --- # How to Back Up the PSaaS Appliance Using the CLI @@ -31,7 +32,7 @@ Please be aware that we use the following sample values throughout this document * IP address of the node on the replica set to be backed up: `192.168.1.186`. Generically, the node may also be referred to as ``. * Password used for encryption: `Passw0rd`. -* The replica set connection string: `a0/a0-1:27017,a0-2:27017,a0-3:27017` +* The replica set connection string: `a0/a0-1:27017,a0-2:27017,a0-3:27017`. ## Generate a New Backup @@ -65,10 +66,10 @@ To do this, you can use the `backup-sensitive` command, which works the same way The full instructions (along with the commands you'll need to run) are as follows: -1. Request a backup: `a0cli -t node_IP_address backup-sensitive --password 0therPassw0rd` -2. Check the status of a backup: `a0cli -t node_IP_address backup-sensitive-status` -3. Retrieve backup of sensitive information: `a0cli -t node_IP_address backup-sensitive-retrieve` -4. Delete the sensitive backup from the node: `a0cli -t node_IP_address backup-sensitive-delete` +1. Request a backup: `a0cli -t node_IP_address backup-sensitive --password 0therPassw0rd`; +2. Check the status of a backup: `a0cli -t node_IP_address backup-sensitive-status`; +3. Retrieve backup of sensitive information: `a0cli -t node_IP_address backup-sensitive-retrieve`; +4. Delete the sensitive backup from the node: `a0cli -t node_IP_address backup-sensitive-delete`. ## Check the Status of the Backup diff --git a/articles/appliance/cli/configure-cli.md b/articles/appliance/cli/configure-cli.md index e721170559..90b57df34f 100644 --- a/articles/appliance/cli/configure-cli.md +++ b/articles/appliance/cli/configure-cli.md @@ -7,6 +7,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance13 +sitemap: false --- # Configuring and Using the Auth0 Appliance Command Line Interface @@ -15,7 +16,7 @@ The PSaaS Appliance Command Line Interface (CLI) allows you to perform operation ## Downloading the CLI Setup Files -To download the files required to set up the CLI, please contact your Auth0 Customer Success Manager for your custom download link. +To download the files required to set up the CLI, submit a [support ticket](https://support.auth0.com/tickets) for your custom download link. ## Installing and Using the CLI @@ -32,7 +33,7 @@ Usage: a0cli [options] create-key Creates private/public keys pair on current path. show-key Shows public key on current path. delete-key Deletes keys pair from current path. - update-commands Retrieve availables commands from the specified node. + update-commands Retrieve available commands from the specified node. Options: @@ -53,7 +54,7 @@ Usage: a0cli [options] create-key Creates private/public keys pair on current path. show-key Shows public key on current path. delete-key Deletes keys pair from current path. - update-commands Retrieve availables commands from the specified node. + update-commands Retrieve available commands from the specified node. backup Creates a new backup. backup-delete Deletes the current sensitive backup backup-retrieve retrieves the current backup. diff --git a/articles/appliance/cli/index.md b/articles/appliance/cli/index.md index d5a30e1ae5..8f2d5a346f 100644 --- a/articles/appliance/cli/index.md +++ b/articles/appliance/cli/index.md @@ -9,6 +9,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance14 +sitemap: false --- # Private SaaS (PSaaS) Appliance Command Line Interface diff --git a/articles/appliance/cli/reconfiguring-ip.md b/articles/appliance/cli/reconfiguring-ip.md index 80f038449e..8ec85afb75 100644 --- a/articles/appliance/cli/reconfiguring-ip.md +++ b/articles/appliance/cli/reconfiguring-ip.md @@ -8,70 +8,11 @@ topics: contentType: how-to useCase: appliance applianceId: appliance15 +sitemap: false --- # How to Reconfigure IP Addresses Using the Command Line Interface -When running in a cluster, the PSaaS Appliance nodes need to know the IP addresses of the other nodes within the same cluster (they do not automatically detect each other). Whenever you move the network of the cluster, you may change the individual IP addresses using the console (TTY1) interface in the Virtual Machine Manager. However, there is no easy way to tell the cluster nodes the new IP addresses of the other members of the cluster. +When running in a cluster, the PSaaS Appliance nodes need to know the IP addresses of the other nodes within the same cluster (they do not automatically detect each other). Whenever you move the network of the cluster, the IP addresses of the individual nodes need to be re-set to match the original node names. -Beginning with PSaaS Appliance build **6576**, you may reconfigure the mapping of IP addresses to the names of nodes for each PSaaS Appliance node using the PSaaS Appliance's Command Line Interface (CLI). Once this is done, the nodes may resume communication with one another within that cluster. - -## Prerequisites - -Prior to beginning, please be sure to [configure the CLI](/appliance/cli/configure-cli) for use in performing operations on your PSaaS Appliance instances via authorized workstations. - -## Using the `re-ip` Task - -The `reip` task has the following signature: - -```text -$a0cli -t re-ip ":[,:...]" -``` - -Running the above will modify the ``'s `/etc/hosts` file to point each `` to its corresponding ``. - -### Use Example - -Suppose that you run the following command: - -```text -$a0cli -t 10.0.0.11 re-ip "a0-1:10.0.0.21,a0-2:10.0.0.22,a0-3:10.0.0.23" -``` - -Suppose that this node has the following `/etc/hosts` file: - -```text -# The following lines are desirable for IPv6 capable hosts -::1 ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -ff02::3 ip6-allhosts -127.0.0.1 login.myauth0.com -127.0.0.1 login0.myauth0.com -127.0.0.1 login.appliancelab.net -127.0.0.1 auth.appliancelab.net -10.0.1.11 a0-1 -10.0.1.12 a0-2 -10.0.1.13 a0-3 -``` - -Running the command results in the CLI modifying the `/etc/hosts` file so that it becomes the following: - -```text -# The following lines are desirable for IPv6 capable hosts -::1 ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -ff02::3 ip6-allhosts -127.0.0.1 login.myauth0.com -127.0.0.1 login0.myauth0.com -127.0.0.1 login.appliancelab.net -127.0.0.1 auth.appliancelab.net -10.0.1.21 a0-1 -10.0.1.22 a0-2 -10.0.1.23 a0-3 -``` +Beginning with PSaaS Appliance build **14591**, reconfiguring of IP addresses using the PSaaS Appliance's Command Line Interface (CLI) is no longer possible. Please open a support ticket when you're ready to reconfigure your VMs' IP addresses, as this operation will be carried out by an Auth0 MSE. diff --git a/articles/appliance/clock.md b/articles/appliance/clock.md index 9922b2e490..5674a7c5b0 100644 --- a/articles/appliance/clock.md +++ b/articles/appliance/clock.md @@ -7,12 +7,13 @@ topics: contentType: how-to useCase: appliance applianceId: appliance53 +sitemap: false --- # Time Synchronization Auth0 uses several cryptographic functions that depend on the system clock. -If you are running Auth0 on an IaaS (Infrastracture as a Service) provider (such as AWS, Microsoft Azure, and so on), time synchronization is managed automatically and you can skip these instructions. +If you are running Auth0 on an IaaS (Infrastructure as a Service) provider (such as AWS, Microsoft Azure, and so on), time synchronization is managed automatically and you can skip these instructions. If you are running Auth0 on your own hardware or a VM host, the PSaaS Appliance must have NTP configured correctly. In most cases, the NTP server is your Domain Controller. Contact your IT administrator for details. diff --git a/articles/appliance/critical-issue.md b/articles/appliance/critical-issue.md index 091101c40b..d7b7d47801 100644 --- a/articles/appliance/critical-issue.md +++ b/articles/appliance/critical-issue.md @@ -10,11 +10,12 @@ contentType: - concept useCase: appliance applianceId: appliance54 +sitemap: false --- # Critical Support Issue Guidance for Appliance Customers -This document outlines additional support procedure information for enterprise subscription customers with an PSaaS Appliance and shoud be read in conjunction with the general [Enterprise Support Guidance document](/onboarding/enterprise-support). +This document outlines additional support procedure information for enterprise subscription customers with an PSaaS Appliance and should be read in conjunction with the general [Enterprise Support Guidance document](/onboarding/enterprise-support). PSaaS Appliance customers must have [Enterprise Support](/onboarding/enterprise-support#premium-enterprise-support) as a minimum. Refer to your subscription agreement to confirm if other custom support or SLA coverage has been included. @@ -37,7 +38,7 @@ Please do *not* submit an Urgent ticket for non-production environments. Urgent PSaaS Appliance customers should use the [Auth0 Support Center](${env.DOMAIN_URL_SUPPORT}) as a primary method of logging a critical support issue. As part of the onboarding procedure a cloud account should be created that gives administrators the possibility to log in to Support Center and create new tickets. Set the ticket severity to **Urgent** if you need an immediate response. ::: note -Using Support Center requires a cloud account setup. If you are unsure about this, please try logging in at the [Auth0 Support Center](${env.DOMAIN_URL_SUPPORT}) or check with your Auth0 Customer Success Manager. +Using Support Center requires a cloud account setup. If you are unsure about this, please try logging in at the [Auth0 Support Center](${env.DOMAIN_URL_SUPPORT}) or check with your Auth0 Technical Account Manager. ::: As a secondary point of escalation, PSaaS Appliance customers can also send an email to `productionoutage@auth0.com` to log a critical support issue. *Note that this should only be a secondary escalation point, as a ticket created in Support Center provides a more reliable way to identify the customer having the problem and interact with the user.* diff --git a/articles/appliance/custom-domains/index.md b/articles/appliance/custom-domains/index.md index 611656a077..cb3728aba9 100644 --- a/articles/appliance/custom-domains/index.md +++ b/articles/appliance/custom-domains/index.md @@ -9,10 +9,15 @@ contentType: - index useCase: appliance applianceId: appliance16 +sitemap: false --- # Private SaaS (PSaaS) Appliance: Custom Domains +::: warning +Private SaaS Deployments (beginning with release 1905) must use the Auth0 [Custom Domains](/custom-domains) feature instead of the PSaas Custom Domains feature when creating new Custom Domains (regardless of whether they have existing Custom Domains using the PSaaS Custom Domains feature or not). **The PSaaS Custom Domains feature is deprecated.** Please contact your Auth0 MSE if you have any questions. +::: + If you are using **PSaaS Appliance Build 5XXX** or later, you may configure custom domains using the Management Dashboard. Custom domains allow you to expose one arbitrary DNS name for a tenant. Conventionally, the PSaaS Appliance uses a three-part domain name for access, and it is the first portion of the domain name that varies depending on the tenant. diff --git a/articles/appliance/dashboard/activity.md b/articles/appliance/dashboard/activity.md index 72b8e1fcbd..d73389b069 100644 --- a/articles/appliance/dashboard/activity.md +++ b/articles/appliance/dashboard/activity.md @@ -7,12 +7,13 @@ topics: contentType: concept useCase: appliance applianceId: appliance17 +sitemap: false --- # PSaaS Appliance Dashboard: Activity ::: note - For additional information on navigating to and using the PSaaS Appliance Dashboard, please see the section on [PSaaS Appliance Controls](/appliance/dashboard#appliance-controls). +For additional information on navigating to and using the PSaaS Appliance Dashboard, please see the section on [PSaaS Appliance Controls](/appliance/dashboard#psaas-appliance-controls). ::: After you begin an update or make a change to the configuration, Auth0 displays progress and logs for those actions on this page in case you need the information for troubleshooting purposes. diff --git a/articles/appliance/dashboard/cli.md b/articles/appliance/dashboard/cli.md index b5efee0f06..f817659fb8 100644 --- a/articles/appliance/dashboard/cli.md +++ b/articles/appliance/dashboard/cli.md @@ -8,6 +8,7 @@ topics: contentType: concept useCase: appliance applianceId: appliance18 +sitemap: false --- # PSaaS Appliance Dashboard: CLI @@ -20,7 +21,7 @@ If your PSaaS Appliance instances requires integration with the PSaaS Appliance ![](/media/articles/appliance/dashboard/cli-keys.png) -Please see your vender for instructions on generating the public access keys. Once you are in possession of the required key(s), you may associate them with your PSaaS Appliance instance by clicking on "Add Key". You will then be asked for the following pieces of information: +Please see your vendor for instructions on generating the public access keys. Once you are in possession of the required key(s), you may associate them with your PSaaS Appliance instance by clicking on "Add Key". You will then be asked for the following pieces of information: * **Name**: the name that identifies your key; * **Key**: the public key string. diff --git a/articles/appliance/dashboard/index.md b/articles/appliance/dashboard/index.md index 8a184ed2c2..e77472478b 100644 --- a/articles/appliance/dashboard/index.md +++ b/articles/appliance/dashboard/index.md @@ -11,6 +11,7 @@ contentType: - concept useCase: appliance applianceId: appliance19 +sitemap: false --- # Private SaaS (PSaaS) Appliance Management Dashboard @@ -39,8 +40,6 @@ For additional information about the pages contained in the PSaaS Appliance conf [Activity](/appliance/dashboard/activity) -[Instrumentation](/appliance/dashboard/instrumentation) - [Rate Limiting](/appliance/dashboard/rate-limiting) [CLI](/appliance/dashboard/cli) diff --git a/articles/appliance/dashboard/instrumentation.md b/articles/appliance/dashboard/instrumentation.md deleted file mode 100644 index e1db2028e4..0000000000 --- a/articles/appliance/dashboard/instrumentation.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -section: appliance -description: Overview on instrumentation in the PSaaS Appliance -topics: - - appliance - - dashboard - - instrumentation -contentType: concept -useCase: appliance -applianceId: appliance20 ---- - -# PSaaS Appliance Dashboard: Instrumentation - -The PSaaS Appliance ships with a feature called [Instrumentation](/appliance/instrumentation), which makes it easy for your PSaaS Appliance administrators or Auth0 Customer Success Engineers to gather information about the current (or previous) state of the PSaaS Appliance. - -If you have chosen to enable Instrumentation, you can see specific Grafana dashboards in the [PSaaS Appliance Dashboard](${manage_url}/configuration#/instrumentation). - -## The Instrumentation Page - -If you've never used the PSaaS Appliance Dashboard to view your Grafana data, you'll be asked to sign in to your Grafana account. Without these permissions, Auth0 cannot return and display your data and dashboards. - -![](/media/articles/appliance/dashboard/instrumentation-login.png) - -Once you've logged in, you'll be able to see your data. You can set the following options to change the data displayed: - -* **Nodes**: The PSaaS Appliance node for which you want to view data. Each node ships with its own Grafana instance; -* **Dashboard**: The [Grafana dashboard](http://docs.grafana.org/guides/getting_started/#dashboards-panels-rows-the-building-blocks-of-grafana) you want to see for the node you've selected; -* **Range**: The time period for which you want data. Choose from one of the following: - - * Last minute; - * Last 5 minutes; - * Last 15 minutes; - * Last 30 minutes; - * Last hour. - -![](/media/articles/appliance/dashboard/instrumentation-page.png) diff --git a/articles/appliance/dashboard/nodes.md b/articles/appliance/dashboard/nodes.md index 96246902a1..f406e27741 100644 --- a/articles/appliance/dashboard/nodes.md +++ b/articles/appliance/dashboard/nodes.md @@ -8,6 +8,7 @@ topics: contentType: concept useCase: appliance applianceId: appliance21 +sitemap: false --- # Auth0 Appliance Dashboard: Nodes diff --git a/articles/appliance/dashboard/oss-components.md b/articles/appliance/dashboard/oss-components.md index fb286ffe5f..76c680a20e 100644 --- a/articles/appliance/dashboard/oss-components.md +++ b/articles/appliance/dashboard/oss-components.md @@ -8,6 +8,7 @@ topics: contentType: concept useCase: appliance applianceId: appliance22 +sitemap: false --- # OSS Components diff --git a/articles/appliance/dashboard/rate-limiting.md b/articles/appliance/dashboard/rate-limiting.md index 20465a1515..ac92f8c95c 100644 --- a/articles/appliance/dashboard/rate-limiting.md +++ b/articles/appliance/dashboard/rate-limiting.md @@ -8,6 +8,7 @@ topics: conceptType: concept useCase: appliance applianceId: appliance23 +sitemap: false --- # Auth0 Appliance Dashboard: Rate Limiting diff --git a/articles/appliance/dashboard/settings.md b/articles/appliance/dashboard/settings.md index 5724978e55..842e959bdc 100644 --- a/articles/appliance/dashboard/settings.md +++ b/articles/appliance/dashboard/settings.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance24 +sitemap: false --- # Auth0 Appliance Dashboard: Settings @@ -77,13 +78,22 @@ The Settings page is broken down into the following sections: * **MFA Session Absolute Timeout**: the absolute time window for which the user can have an MFA session. After this period of time elapses, the user will be prompted again for MFA; * **MFA Session Inactive Timeout**: the maximum time window for which the user can have an MFA session without logging in again. If the user logs in prior to the expiration of this time period, the window will be extended. -## Update Settings +### Units of time -* **Update Proxy**: unless your specific configuration is set up for offline updates, please leave this field blank. +When providing time values to Auth0, please use the following abbreviations to ensure the correct units are used: -## Monitoring +| Abbreviation | Description | +| - | - | +| w | weeks | +| d | days | +| h | hours | +| m | minutes | +| s | seconds | +| ms | milliseconds | -* **New Relic License Key**: if you use New Relic for monitoring, enter your license key here to monitor your PSaaS Appliance instances. +## Update Settings + +* **Update Proxy**: unless your specific configuration is set up for offline updates, please leave this field blank. ## API Keys @@ -95,7 +105,7 @@ The Settings page is broken down into the following sections: ## Advanced Settings -* **Enable Large Cookie Size**: if enabled, cookies larger than 4kb will be permitted (this might be required for protocols such as SAML and WS-Federation). +* **Enable Large Cookie Size**: if enabled, cookies larger than 4kb will be permitted (this might be required for protocols such as SAML and WS-Federation). * **Max Custom Database Timeout**: the maximum time allowed in seconds to make a query to your database (in seconds) for a custom database connection. ## Deprecated diff --git a/articles/appliance/dashboard/tenants.md b/articles/appliance/dashboard/tenants.md index ee4a4093b8..120e7b9073 100644 --- a/articles/appliance/dashboard/tenants.md +++ b/articles/appliance/dashboard/tenants.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance25 +sitemap: false --- # PSaaS Appliance Dashboard: Tenants @@ -34,7 +35,11 @@ For each associated tenant, you will see the following pieces of information: The name column of the Tenants page is a hyperlink. Clicking on this brings up the page where you can set up custom domains for this particular tenant, as well overview information for any currently-existing custom domains. -### Adding a Custom Domain +### Adding a Custom Domain (legacy PSaaS customers only) + +::: note +The following steps are only required for legacy PSaaS customers. All new customers can use the Custom Domains feature as implemented in the public cloud version. +::: To add a custom domain, click on the "Add Domain" button. You will be prompted for the following information: diff --git a/articles/appliance/dashboard/troubleshoot.md b/articles/appliance/dashboard/troubleshoot.md index 314bec9e38..7af19b48fc 100644 --- a/articles/appliance/dashboard/troubleshoot.md +++ b/articles/appliance/dashboard/troubleshoot.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance26 +sitemap: false --- # PSaaS Appliance Dashboard: Troubleshoot diff --git a/articles/appliance/dashboard/updates.md b/articles/appliance/dashboard/updates.md index 0b77bd61a1..a78879ad02 100644 --- a/articles/appliance/dashboard/updates.md +++ b/articles/appliance/dashboard/updates.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance27 +sitemap: false --- # PSaaS Appliance Dashboard: Updates @@ -34,5 +35,5 @@ Once you have selected the appropriate build, any **release notes** applicable w To begin the update, click on "Update from Internet." You will be prompted once more to confirm to ensure that the appropriate backups have been made, since PSaaS Appliance updates cannot be undone. ::: note -You should schedule Production updates with your Auth0 Customer Success Manager so that there is an Auth0 Customer Success Engineer available in case any patches need to be manually applied. For more information on updates, see [Updating the PSaaS Appliance](/appliance/admin/updating-the-appliance). +You should schedule Production updates with your Auth0 Technical Account Manager so that there is an Auth0 Customer Success Engineer available in case any patches need to be manually applied. For more information on updates, see [Updating the PSaaS Appliance](/appliance/admin/updating-the-appliance). ::: diff --git a/articles/appliance/disaster-recovery-raci.md b/articles/appliance/disaster-recovery-raci.md index 42899b4734..4a9e440e7b 100644 --- a/articles/appliance/disaster-recovery-raci.md +++ b/articles/appliance/disaster-recovery-raci.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance55 +sitemap: false --- @@ -54,7 +55,7 @@ The following table details the task division for configuring, creating, and mon Download PSaaS Appliance CLI tool C R, A - The subscriber will need to contact their Auth0 Customer Success Manager for the custom download link. + The subscriber will need to contact their Auth0 Technical Account Manager for the custom download link. Install PSaaS Appliance CLI Tool @@ -125,7 +126,7 @@ The following table details the task division for configuring, creating, and mon Restore the Data Backup R, C I - Please open a ticket in the Auth0 Support Center to request assistance with restoring a backup. Auth0 Customer Success Engineers will review your request, and if necessary, partner with the subscriber's infrastructure engineers to restore the environment. Please note that, in certain cases, a Professional Services fee may apply. + Please open a ticket in the Auth0 Support Center to request assistance with restoring a backup. Auth0 Customer Success Engineers will review your request, and if necessary, partner with the subscriber's infrastructure engineers to restore the environment. Please note that, in certain cases, a Professional Services fee may apply. @@ -156,12 +157,18 @@ The following table details the task division for configuring, creating, and mon R, A The subscriber is responsible for restoring a VM Snapshot.. + + Recover Auth0 Environment + R + I, A + Auth0 is responsible for recovering the authentication environment. + ## Backup Cadence Recommendations -Auth0 recommends backing up your data on a daily basis (usually overnight to lessen impact on performance). However, if you need greater assurance of up-to-date data or have concerns about a logical data corruption, you might choose to backup more frequently. If this is the case, please contact your Auth0 Customer Success Manager to schedule a discussion, since the backup process puts a substantial load on the backup node and may impact your Production environment. +Auth0 recommends backing up your data on a daily basis (usually overnight to lessen impact on performance). However, if you need greater assurance of up-to-date data or have concerns about a logical data corruption, you might choose to backup more frequently. If this is the case, please contact your Auth0 Technical Account Manager to schedule a discussion, since the backup process puts a substantial load on the backup node and may impact your Production environment. Auth0 recommends taking **weekly** Virtual Machine Snapshots. diff --git a/articles/appliance/disaster-recovery.md b/articles/appliance/disaster-recovery.md index 1be18cae36..a2296865d2 100644 --- a/articles/appliance/disaster-recovery.md +++ b/articles/appliance/disaster-recovery.md @@ -7,11 +7,12 @@ topics: contentType: concept useCase: appliance applianceId: appliance56 +sitemap: false --- # PSaaS Appliance: Disaster Recovery -When preparing for the possibility of issues with your PSaaS Appliance instances, your options depend on your tolerance for downtime. Below, you will find a discussion of the advantages and disadvantages associated with the various disaster recovery (DR) options available. +When preparing for the possibility of issues with your PSaaS Appliance instances, your options depend on your tolerance for downtime. Below, you will find information on the advantages and disadvantages associated with the various disaster recovery (DR) options available. Additionally, there is a difference between PSaaS Appliance availability and data availability/recovery. For example, the standard three-node cluster deployment has high availability and can survive a single-node failing. However, in cases of a data center failure or a logical data corruption, you would need a disaster recovery solution to help recover from that. @@ -19,13 +20,15 @@ In cases where the data centers have very low latency, you can run individual PS ## Geographic High-Availability PSaaS Appliance Implementation -If your requirements demand very little to no downtime, we recommend a [Geographic High-Availability PSaaS Appliance](/appliance/geo-ha) implementation. This is the only implementation that has automatic failover with recovery on the order of 1 minute. +If your requirements demand regional resilience with little downtime, we recommend a [Geographic High-Availability PSaaS Appliance](/appliance/geo-ha) implementation. This is the only implementation that has failover between regions. + +Issue detection and failover typically occur at the database level in 30 seconds or less. However, switching over and rerouting traffic from one data center to another is an expensive operation, so we've configured the infrastructure to detect false positives and *not* switch over if one occurs. This secondary detection process reroutes client traffic through failure detection time-out mechanisms that result in an *effective* failover time of approximately ten minutes. **Advantages**: -Geo-HA is an PSaaS Appliance implementation that provides: +Geo-HA is a PSaaS Appliance implementation that provides: * Data center redundancy; -* Automatic failure handling; +* Rapid failure response; * The highest form of PSaaS Appliance availability offered by Auth0. **Disadvantages**: @@ -34,35 +37,33 @@ Geo-HA involves: * A higher cost due to increased complexity; * Additional PSaaS Appliance Virtual Machines (VM) that need maintenance; * An additional layer in front of the load balancer for GEO failover, such as F5 Global Traffic Manager or AWS Route 53; -* Additional configuration to handle logical corruption, since this is not a scenario that is covered by the typical setup. +* Additional configuration to handle logical corruption. For more information, please see: * [Geo HA](/appliance/geo-ha) * [Disaster Recovery](/appliance/geo-ha/disaster-recovery) ## VM Snapshots -If you have some tolerance for downtime (either in terms of minutes or hours), you can consider using the Virtual Machine (VM) snapshot approach. A VM snapshot contains everything you need to rebuild an PSaaS Appliance. You would be responsible for regularly taking VM snapshots and either storing them either offsite or replicating them to other regions in the cloud. +If you have some tolerance for downtime (either in terms of minutes or hours), you can consider using the Virtual Machine (VM) snapshot approach. A VM snapshot contains everything needed to rebuild a PSaaS Appliance. You would be responsible for regularly taking VM snapshots and either storing them either offsite or replicating them to other regions in the cloud. **Advantages**: -* Recovery via VM snapshots is faster than using database backups (though the process is slower than GEO-HA). -* You may not need manual intervention from an Auth0 Customer Success Engineer (CSE) to restore your cluster. +* Recovery via VM snapshots is quicker than using database backups (though the process is slower than GEO-HA). **Disadvantages**: -* VM snapshots can become very large in size (snapshots are not compressed, and you would need a snapshot of each VM/drive), which makes storage tricky. +* You will need manual intervention from an Auth0 Managed Services Engineer (MSE) to restore your cluster. +* VM snapshots can become very large (snapshots are not compressed, and you would need a snapshot of each VM/drive), which makes storage tricky. * The backup and recovery process requires manual intervention. ### Basic Steps for Recovering with VM Snapshots -The following outlines the basic steps required for restoring your PSaaS Appliance instances using VM snapshots: +The following outlines the basic steps required for restoring PSaaS Appliance instances using VM snapshots: 1. Ensure that you have a snapshot of your VM(s) and that it is stored at a secondary site. In the event of a disaster, your primary site may not be accessible. 2. Restore your VM(s) using your snapshots at your secondary site. -Use the [PSaaS Appliance Command Line Interface (CLI)](/appliance/cli) to [reconfigure the IP addresses](/appliance/cli/reconfiguring-ip) of the VM(s). +3. Contact a Managed Services Engineer via support ticket to complete the recovery of your environment ::: panel VMWare's Site Recovery Manager -If you are hosting your PSaaS Appliance instances using VMware, you may also implement a similar backup/recovery scenario using VMWare's Site Recovery Manager (SRM). SRM provides an automated mechanism to move your snapshots to a secondary site, where they can be retrieved if you ever need your data restored. If you choose this option, Auth0 will help you set up and test your implementation. - -We have tested that it will change the IP for the box and you can [run re-ip](/appliance/cli/reconfiguring-ip) as long as you have prepared the [PSaaS Appliance Command Line Interface (CLI)](/appliance/cli) ahead of time and uploaded the certificate. +Site Recovery Manager is not supported on current versions of Auth0 PSaaS Appliance. If you rely on this VMWare feature, please contact your Technical Account Manager for guidance. ::: ## Database Backups @@ -77,7 +78,7 @@ If you choose to use database backups as your DR strategy, please note that this * Database backups are smaller and easier to move offsite than VM snapshots. **Disadvantage**: -* You will need manual intervention from an Auth0 CSE to restore your PSaaS Appliance. +* You will need manual intervention from an Auth0 MSE to restore your PSaaS Appliance. * Recovering with a database backup requires the greatest amount of time. For more information, please see: @@ -85,12 +86,8 @@ For more information, please see: * [Using the CLI to Backup PSaaS Appliance Instances](/appliance/cli/backing-up-the-appliance) * [Adding an PSaaS Appliance Node to the Backup Role](/appliance/cli/adding-node-to-backup-role) -::: note - This option is available to PSaaS Appliance on version **7247** or later. -::: - ## Combining VM Snapshots and Database Backups -A middle ground between using VM snapshots and database backups is to take weekly VM snapshots, while scheduling nightly database backups. +A middle ground between using VM snapshots and database backups is to take weekly VM snapshots while scheduling nightly database backups. The recovery process still requires the assistance of an Auth0 CSE, but because the VMs can be automatically restored, only the database needs manual intervention/assistance. This eliminates some of the downtime resulting from using just database backups. diff --git a/articles/appliance/extensibility-node8.md b/articles/appliance/extensibility-node8.md deleted file mode 100644 index 709b895b97..0000000000 --- a/articles/appliance/extensibility-node8.md +++ /dev/null @@ -1,98 +0,0 @@ ---- -title: Migration Guide - Extensibility and Node 8 -description: This article covers the Auth0 PSaaS Appliance features/modules affected, as well as recommendations to ensure a smooth migration process. -section: appliance -topics: - - appliance - - extensibility - - migration -contentType: - - how-to - - concept -toc: true -useCase: appliance -applianceId: appliance57 ---- -# PSaaS Appliance Migration Guide: Extensibility and Node 8 - -Auth0 announced that it will be making the Webtask Node 8 runtime available for Public Cloud customers beginning 2018 April 17. - -The Auth0 PSaaS Appliance team has ported these changes to the Appliance environment, and the changes are [available in **release #16257**](https://auth0.com/changelog/appliance). - -Auth0 has notified all PSaaS Appliance customers that this release is available. - -::: warning -Beginning with the September 2018 major release **16999**, Node.js v4 will no longer be supported on the PSaaS Appliance. - -Versions **16257** and **16793** support Node.js v4 and v8, so you should test using either version before upgrading to version **16999** or later. -::: - -## Background - -The Webtask engine powering Auth0 extensibility currently utilizes Node.js v4. On 30 April 2018, [Node.js v4 went out of long-term support (LTS)](https://github.com/nodejs/Release#release-schedule), which means that the Node.js development team will no longer be back-porting critical security fixes to this version. - -Continuing to use this version of Node.js could potentially expose your extensibility code to security vulnerabilities. - -## Changes to expect - -Migrating from Node.js v4 to Node.js v8 will impact all Auth0 extensibility solutions, including: - -* Rules -* Hooks -* Custom Database Connections -* Custom Social Connections - -Many of your existing scripts will continue to run without any modifications required, though some will require changes. - -## Scheduling your update - -Beginning June 4th, 2018, our Appliance Services PM or your Customer Success Manager will begin working with you to schedule upgrades for your environments. - -While we are not aware of any security vulnerabilities resulting from the continued use of Node.js v4, we strongly recommend that you schedule updates to your Development and Production PSaaS Appliance environments as soon as possible. - -## Am I affected? - -During the process of introducing Node.js v8 to our Webtask runtime, we ran tests to determine if there are modules that are not forward-compatible with Node.js v8. - -Based on the results of our tests in the Cloud environment, most customers should see no issues when upgrading to Node.js v8. - -### Built-in modules - -Some built-in modules (that is, modules that you do not explicitly `require()`) were not forward-compatible with Node.js v8. If you are using such modules, please be aware that there are new versions available. - -The full list of affected modules can be found [here](/migrations/guides/extensibility-node8#affected-modules). - -### Auth0 Extensions - -All officially-supported Auth0 Extensions will be updated to run on Node.js v8 prior to the rollout of new PSaaS Appliance deployments. - -## Enable Node.js v8 in the PSaaS Appliance - -::: panel Auth0-Hosted PSaaS Appliance -For those with PSaaS Appliance in the Auth0 Dedicated Cloud Service, please open a ticket with [Support](${env.DOMAIN_URL_SUPPORT}) so that Auth0 can enable Node.js v8 on your behalf. - -Please indicate: - -* The environment (DEV or PROD) for which you want Node.js v8 enabled -* Timing restrictions/the time frame during which you would like Auth0 to make the switch -::: - -The Auth0 Sandbox should be updated to Node.js v8 to complete the migration of Rules, Hooks, and Webtask from Node.js v4. - -This change will affect **all** tenants on the PSaaS Appliance. - -Please ensure that the VMs have internet access when enabling Node.js v8 for the first time. - -1. Navigate to the Sandbox configuration page (the URL will be of the following format: **https://CustomerManageDomain/configuration#/sandbox**). - -![](/media/articles/appliance/migrations/sandbox.png) - -2. Switch the value for **Node Version** from **4** to **8**. - -![](/media/articles/appliance/migrations/node-version.png) - -3. Scroll to the bottom and click **Save**. - -**At this point, the PSaaS Appliance will take some time to reconfigure and begin using Node.js v8. You can check the status of this process using the *Activity* section of the Appliance dashboard.** - -Be sure to test your existing Rules, Hooks, and Webtask to ensure they function correctly. diff --git a/articles/appliance/extensions.md b/articles/appliance/extensions.md index 2bc46d3e0e..b98480d9b1 100644 --- a/articles/appliance/extensions.md +++ b/articles/appliance/extensions.md @@ -10,6 +10,7 @@ contentType: - how-to useCase: appliance applianceId: appliance58 +sitemap: false --- # PSaaS Appliance: Extensions @@ -18,17 +19,17 @@ While using [Extensions](/extensions) in the PSaaS Appliance is very similar to You may receive updates to Extensions at any time without prior notice. -## Configure Extensions +## Set up and enable Webtasks -Extensions make use of Webtasks. When you activate a Webtask in the PSaaS Appliance, you get a URL specific to that instance of the Webtask service. By default, this URL is structured as follows: +You must set up and enable Webtasks before you can use Extensions. -`webtask.` +To [set up and enable your Webtasks](/appliance/infrastructure/extensions#requirements-for-enabling-webtasks), go to the [Webtasks page under Tenant Settings](${manage_url}/#/tenant/webtasks) in the Management Dashboard. -::: note -To enable Webtasks, go to the [Webtasks Settings page of the Management Dashboard](${manage_url}/#/account/webtasks). +## Configure Extensions -See [Enable Webtasks, Web Extensions, and User Search](/appliance/infrastructure/extensions) for additional information. -::: +When you activate a Webtask in the PSaaS Appliance, you get a URL specific to that instance of the Webtask service. By default, this URL is structured as follows: + +`webtask.` In order for you to configure Extensions, you will need to add this URL to the **Allowed Origins (CORS)** section under the [Auth0 Dashboard's Application Settings page](${manage_url}/#/applications). diff --git a/articles/appliance/geo-ha/disaster-recovery.md b/articles/appliance/geo-ha/disaster-recovery.md index aecf4e1d15..8750ac5517 100644 --- a/articles/appliance/geo-ha/disaster-recovery.md +++ b/articles/appliance/geo-ha/disaster-recovery.md @@ -7,6 +7,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance28 +sitemap: false --- @@ -76,7 +77,7 @@ The following table details some of the ways in which the Geographic High-Availa Connection between the Global Load Balancer and the Primary Site Unavailable - All requests are routed to the secondary site, but the secondary nodes continue to use data on the primary site + All requests are routed to the secondary site, but the secondary nodes continue to use data on the primary site. Some performance degradation due to cross-geography data requests. @@ -101,7 +102,7 @@ The following table details some of the ways in which the Geographic High-Availa To test the Geographic High-Availability PSaaS Appliance (GEO HA) failover/failback procedure, you should: -1. Take all nodes in the primary data center offline. +1. Take all nodes in the primary data center offline; 2. Run tests against the global load balancer to ensure that traffic gets rerouted to the secondary site. GEO HA does not support having both the primary and secondary sites disconnected and active at the same time. Because the data layer is arranged in one stretched cluster, the cluster only permits one data node to act as primary. @@ -116,7 +117,7 @@ As a customer, it is your responsibility to perform regular backups on your Geog Typically, Auth0 recommends performing a daily backup. However, if you have concerns about a logical data corruption, or you need greater assurance of up-to-date data, you might choose to backup more frequently. -Because the backup process puts a substantial load on the backup node, please contact your Auth0 Customer Success Manager to schedule a discussion about performance impact if backups are performed more frequently/during peak usage times. +Because the backup process puts a substantial load on the backup node, please contact your Auth0 Technical Account Manager to schedule a discussion about performance impact if backups are performed more frequently/during peak usage times. ## Further Reading diff --git a/articles/appliance/geo-ha/dr-overview.md b/articles/appliance/geo-ha/dr-overview.md index 24df03dc01..32051a5492 100644 --- a/articles/appliance/geo-ha/dr-overview.md +++ b/articles/appliance/geo-ha/dr-overview.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance29 +sitemap: false --- diff --git a/articles/appliance/geo-ha/index.md b/articles/appliance/geo-ha/index.md index 355007949b..16329c8635 100644 --- a/articles/appliance/geo-ha/index.md +++ b/articles/appliance/geo-ha/index.md @@ -11,11 +11,12 @@ contentType: - reference useCase: appliance applianceId: appliance30 +sitemap: false --- # Private SaaS (PSaaS) Appliance: High Availability Geo Cluster (Geo HA) -The high availability geo cluster is a PSaaS Appliance implementation that provides data center redundancy and automatic failure handling. This is the highest form of PSaaS Appliance availability offered by Auth0. +The high availability geo cluster is a PSaaS Appliance implementation that provides regional data center redundancy and rapid failure response. This is the highest form of PSaaS Appliance availability offered by Auth0. ## Overview diff --git a/articles/appliance/index.html b/articles/appliance/index.html index cf2c1bdcdc..56af4b1bc2 100644 --- a/articles/appliance/index.html +++ b/articles/appliance/index.html @@ -7,13 +7,14 @@ - appliance useCase: appliance applianceId: appliance59 +sitemap: false ---

    Private SaaS (PSaaS) Appliance

    - An Auth0 deployment that exists in a dedicated area of Auth0's cloud, your cloud, or your own data center. + An Auth0 deployment that exists in a dedicated area of Auth0's cloud or your AWS cloud.

    @@ -101,9 +102,9 @@

    PSaaS Appliance Administration

  • - Tools for Monitoring the PSaaS Appliance + Monitoring the PSaaS Appliance

    - In addition to providing tools for monitoring your PSaaS Appliance instances, Auth0 provides integration with select third-party utilities. + Learn how to monitor your PSaaS Appliance instances, so that you always know how it is performing.

    • @@ -117,12 +118,6 @@

      PSaaS Appliance Administration

      The PSaaS Appliance Command Line Interface (CLI) allows you to perform operations on your PSaaS Appliance via authorized workstations.

    • -
    • - Automatic Creation of Tenants -

      - If your business needs require you to create tenants regularly, you may automate this process in your PSaaS Appliance instances. For example, you might need to create one tenant for each customer or project that goes live. -

      -
    • Node.js Modules Available in Rules and Custom Database Connections for PSaaS Appliance

      diff --git a/articles/appliance/infrastructure/dns.md b/articles/appliance/infrastructure/dns.md index 15c8486a9a..2466fa2ca1 100644 --- a/articles/appliance/infrastructure/dns.md +++ b/articles/appliance/infrastructure/dns.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance31 +sitemap: false --- diff --git a/articles/appliance/infrastructure/extensions.md b/articles/appliance/infrastructure/extensions.md index 82508fdc1c..f2a2e22e74 100644 --- a/articles/appliance/infrastructure/extensions.md +++ b/articles/appliance/infrastructure/extensions.md @@ -7,69 +7,70 @@ topics: - extensions contentType: - Reference - - Index useCase: appliance applianceId: appliance32 +sitemap: false --- # Enable Webtasks, Extensions, and User Search -Beginning with version `8986`, the PSaaS Appliance supports extensions. This is in addition to support for [Webtasks](appliance/webtasks). +The PSaaS Appliance supports: -::: note -Some of the [Extensions](/extensions) available to users of the Auth0 public cloud are unavailable in the PSaaS Appliance. As such, these do not appear as options in the PSaaS Appliance's Dashboard. -::: +* Extensions +* [Webtasks](appliance/webtasks) +* User search using Elasticsearch -Beginning with version `10755`, the PSaaS Appliance supports User Search using Elasticsearch. This allows you to use extensions that require User Search, including the [Delegated Admininstration extension](/extensions/delegated-admin) +## Extensions -## Requirements for Enabling User Search +You can find a list of extensions available to you [in the Dashboard](${manage_url}/#/extensions). -To enable User Search, you must increase the amount of storage available in your Development and Production environments. +Some of the [Extensions available to users of the Auth0 public cloud](/extensions) are unavailable in the PSaaS Appliance. As such, these do not appear as options in the PSaaS Appliance's Dashboard. -* If you have a *single non-Production/Development node*, you need an additional **50 GB** drive; -* If you have a *three-node Production cluster*, you need an additional **100 GB** drive on *each* of your three Virtual Machines; -* If you have a *Geographic High-Availability implementation*, you need an additional **100 GB** drive on *each* of your data nodes in the primary and secondary data centers. +## Webtasks Requirements -For all other configuration types, please consult with your Customer Success Engineer. - -## Enabling User Search - -Once you have added the additional drive(s), submit a Support ticket to request that Auth0: - -* Enable User Search; -* Update your PSaaS Appliance to version `10755` or above. Auth0 will work with you to upgrade your Development environment first, so that you can test the changes. Auth0 will coordinate the Production upgrade after you've concluded testing in Development. - -## Requirements for Enabling Webtasks - -Your Development and/or Production environments must meet the following requirements before you can enable Webtasks and update to version `8986` or above. +Your Development and Production environments must meet the following requirements before you can enable Webtasks: * All nodes in the cluster have outbound access using **Port 443** to: * `docker.it.auth0.com` (or `52.9.124.234`) - * Please note that version 8293 required outbound access to `docker.it.auth0.com` (or `52.9.124.234`) on Port **5000**. * `cdn.auth0.com` -* All nodes are able to communicate with other nodes in the same cluster using ports **8721** and **8701**. +* All nodes can communicate with other nodes in the same cluster using ports **8721** and **8701**. * All [SSL certificates](/appliance/infrastructure/security#ssl-certificates) have the appropriate Webtask DNS entry. Examples: * `webtask..com` * `webtask-dev..com` -## Enabling Webtasks - -Once you have met the requirements for enabling Webtasks, submit a Support ticket to request that Auth0: +## Enable Webtasks -* Configure Webtasks (including switching your sandbox mode to `auth0-sandbox`) -* Update your PSaaS Appliance to version `8986`. Auth0 will work with you to upgrade your Development environment first, so that you can test the changes. Afterwards, Auth0 will coordinate the Production upgrade. +Once you have met the requirements for enabling Webtasks, submit a Support ticket to request that Auth0 configure Webtasks on your behalf. ## Dedicated Domains -Beginning with PSaaS Appliance version `13451`, you may now configure Webtask on a [dedicated domain](/appliance/webtasks/dedicated-domains). This enables you to safely use extensions in multi-tenant environments (the behavior is akin to that of the Auth0 Public Cloud Service). +You may configure Webtasks on a [dedicated domain](/appliance/webtasks/dedicated-domains). Using dedicated domains enables you to safely use extensions in multi-tenant environments (the behavior is akin to that of the Auth0 Public Cloud Service). If you are planning on using Extensions, you **must** implement Webtask dedicated domains. +## User search + +The PSaaS Appliance supports User Search using Elasticsearch. This allows you to use extensions that require user search functionality, including the [Delegated Administration extension](/extensions/delegated-admin). + +### Requirements for enabling user search + +To enable User Search, you must increase the amount of storage available in your Development and Production environments. + +* If you have a *single non-Production/Development node*, you need an additional **50 GB** drive; +* If you have a *three-node Production cluster*, you need an extra **100 GB** drive on *each* of your three Virtual Machines; +* If you have a *Geographic High-Availability implementation*, you need an additional **100 GB** drive on *each* of your data nodes in the primary and secondary data centers. + +For all other configuration types, please consult with your Customer Success Engineer. + +## Enabling User Search + +Once you have added the additional drive(s), submit a Support ticket to request that Auth0 enable User Search. + ## Keep reading ::: next-steps * [IP Address and Port Requirements](/appliance/infrastructure/ip-domain-port-list) * [Extensions](/extensions) -* [Delegated Admininstration extension](/extensions/delegated-admin) +* [Delegated Administration extension](/extensions/delegated-admin) * [Webtasks](/appliance/webtasks) * [Version Change Logs](https://auth0.com/changelog/appliance) ::: diff --git a/articles/appliance/infrastructure/faq.md b/articles/appliance/infrastructure/faq.md index a181e73615..e9dc9fc33e 100644 --- a/articles/appliance/infrastructure/faq.md +++ b/articles/appliance/infrastructure/faq.md @@ -7,6 +7,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance33 +sitemap: false --- # PSaaS Appliance Infrastructure Requirements: Frequently Asked Questions @@ -29,7 +30,9 @@ No, the PSaaS Appliance is a managed service that runs within your network. You While this is currently not supported, preinstalled anti-virus software may be included in future updates. #### Will Auth0 provide me with a CSR file for my SSL Certificate? -If Auth0 hosts the PSaaS Appliance, Auth0 will provide the required certificate(s). +No. The details of generating certificates, such as a CSR, vary among public certificate providers. Please work with your public certificate authority for these requirements. + +If Auth0 hosts the PSaaS Appliance, Auth0 will provide the required `*.auth0.com` SSL certificates. #### Why do both the DEV (non-prod) node and PROD cluster require unique certificates signed by a public Certificate Authority? Webtasks and web extensions require this due to Node.js security requirements. @@ -80,7 +83,6 @@ Auth0 requires [remote access](/appliance/remote-access-options) to your PSaaS A 1. Jumphost + Firewall Whitelist 2. Two Jumphosts -3. VPN We do not support other methods, such as VDI or Screen Sharing mechanisms. @@ -96,4 +98,4 @@ You can read the PSaaS Appliance terms [here](https://auth0.com/legal/baseline/P #### Does the PSaaS Appliance require internet access? -Please refer to [our documentation on the internet-related requirements](/appliance/infrastructure/internet-restricted-deployment) for the PSaaS Appliance. \ No newline at end of file +Please refer to [our documentation on the internet-related requirements](/appliance/infrastructure/internet-restricted-deployment) for the PSaaS Appliance. diff --git a/articles/appliance/infrastructure/index.md b/articles/appliance/infrastructure/index.md index b05fab0a4b..6f2919f464 100644 --- a/articles/appliance/infrastructure/index.md +++ b/articles/appliance/infrastructure/index.md @@ -11,6 +11,7 @@ contentType: - reference useCase: appliance applianceId: appliance34 +sitemap: false --- # Private SaaS (PSaaS) Appliance Infrastructure Requirements diff --git a/articles/appliance/infrastructure/infrastructure-overview.md b/articles/appliance/infrastructure/infrastructure-overview.md index 80bbae05fa..b9e92e633a 100644 --- a/articles/appliance/infrastructure/infrastructure-overview.md +++ b/articles/appliance/infrastructure/infrastructure-overview.md @@ -7,6 +7,7 @@ topics: contentType: concept useCase: appliance applianceId: appliance35 +sitemap: false --- # PSaaS Appliance Deployment Architecture diff --git a/articles/appliance/infrastructure/installation.md b/articles/appliance/infrastructure/installation.md index 8dfff7ea94..4197c25fc8 100644 --- a/articles/appliance/infrastructure/installation.md +++ b/articles/appliance/infrastructure/installation.md @@ -10,6 +10,7 @@ contentType: - how-to useCase: appliance applianceId: appliance36 +sitemap: false --- @@ -51,11 +52,10 @@ Auth0 provides a project plan methodology to help customers get up and running w The following basic steps are required to get the infrastructure up and running and the PSaaS Appliance deployed: -1. Understand the PSaaS Appliance infrastructure requirements as detailed in this document; -2. Complete and submit the [Pre-PSaaS Appliance Installation Checklist](https://docs.google.com/forms/d/e/1FAIpQLSckWRi2MWpzhBkUXoqjaEzMPGUsyL4ICbOetcGvSnn64dSM-A/viewform?c=0&w=1) to ensure that you have everything you need ready and on hand for the PSaaS Appliance deployment; -3. Access and install the PSaaS Appliance; -4. Complete and submit the Post-PSaaS Appliance Install Checklist to notify Auth0 that you have everything in place and that Auth0 can commence configuring the PSaaS Appliance; -5. Complete the steps detailed in the PSaaS Appliance Setup Guide. +1. Understand the PSaaS Appliance infrastructure requirements as detailed in this document. +2. Set up the infrastructure after the Appliance Project Manager has shared the required AMI file with you. +3. Complete and submit the [PSaaS Appliance Install Checklist](https://docs.google.com/forms/d/e/1FAIpQLSckWRi2MWpzhBkUXoqjaEzMPGUsyL4ICbOetcGvSnn64dSM-A/viewform?c=0&w=1) to notify Auth0 that you have the required infrastructure in place and that Auth0 can begin configuring the PSaaS Appliance. +4. Meet with Auth0 to deploy the DEV and PROD environments (the Appliance Project Manager will set up this meeting). ## Development/Test/Production Lifecycle diff --git a/articles/appliance/infrastructure/internet-restricted-deployment.md b/articles/appliance/infrastructure/internet-restricted-deployment.md index ba6dc5a203..352e6b0e36 100644 --- a/articles/appliance/infrastructure/internet-restricted-deployment.md +++ b/articles/appliance/infrastructure/internet-restricted-deployment.md @@ -4,8 +4,9 @@ description: Operating the PSaaS Appliance in an Internet-Restricted Environment contentType: reference useCase: appliance applianceId: appliance37 +sitemap: false --- -# PSaaS Appliace Deployments with Limited Internet Connectivity +# PSaaS Appliance Deployments with Limited Internet Connectivity The Auth0 PSaaS Appliance is delivered as a managed service that can run in: @@ -37,25 +38,24 @@ Operating the PSaaS Appliance in an internet-restricted environment results in t ### Management Dashboard -The browser that you are using to manage your PSaaS Appliance requires internet access to navigate to the Management Dashboard (located at **manage.your-domain**). +The browser that you are using to manage your PSaaS Appliance requires Internet access to navigate to the Management Dashboard (located at **manage.your-domain**). You may, however, restrict server-side access to the Management Dashboard. To properly render the Dashboard, it accesses the following sites: -* **cdn.auth0.com**: resources loaded from this CDN are well-known and include CSS, JavaScript, and images -* **fonts.googleapis.com**: resources loaded include CSS and font files -* **s.gravatar.com** and **i2.wp.com**: resources include user profile images loaded from WordPress' Gravatar service +* **cdn.auth0.com**: resources loaded from this CDN are well-known and include CSS, JavaScript, and images. +* **fonts.googleapis.com**: resources loaded include CSS and font files. +* **s.gravatar.com** and **i2.wp.com**: resources include user profile images loaded from WordPress' Gravatar service. * **fast.fonts.net**: resources include CSS files for font support. ### Multi-factor Authentication (MFA) -When using multi-factor authentication (MFA), you will need internet access for Guardian MFA (both SMS and push notifications require internet connectivity). +When using multi-factor authentication (MFA), you will need Internet access for Push notifications, SMS, and Voice. For limited connectivity options, you may choose from: -* Guardian MFA TOTP -* Google Authenticator +* One-time password with Google Authenticator, Authy or similar apps * A custom MFA implementation using redirect rules * Duo (on-premise versions only) @@ -63,4 +63,4 @@ For limited connectivity options, you may choose from: The PSaaS Appliance requires access to specific external resources for normal functionality, and we do not recommend restricting access to these resources for optimal function. These resources are primarily located on the Auth0 CDN. -Currently, there are no plans to reduce the reliance of the PSaaS Appliance on the Auth0 CDN. \ No newline at end of file +Currently, there are no plans to reduce the reliance of the PSaaS Appliance on the Auth0 CDN. diff --git a/articles/appliance/infrastructure/ip-domain-port-list.md b/articles/appliance/infrastructure/ip-domain-port-list.md index efc935fbd9..d81d3d2a2f 100644 --- a/articles/appliance/infrastructure/ip-domain-port-list.md +++ b/articles/appliance/infrastructure/ip-domain-port-list.md @@ -4,12 +4,13 @@ section: appliance topics: - appliance - infrastructure - - ip-addressses + - ip-addresses - domains - ports contentType: reference useCase: appliance applianceId: appliance38 +sitemap: false --- @@ -193,6 +194,14 @@ Auth0 strives to keep these IP addresses stable, though this is not a given. Fro Required by the PSaaS Appliance to resolve host names internal and external to your environment Yes + + SMTP + Outbound + SMTP Server(s) + 25/587 + Allows sending of emails from the Appliance + No + diff --git a/articles/appliance/infrastructure/network.md b/articles/appliance/infrastructure/network.md index ac700840e0..d197ad2191 100644 --- a/articles/appliance/infrastructure/network.md +++ b/articles/appliance/infrastructure/network.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance39 +sitemap: false --- # PSaaS Appliance Infrastructure Requirements: Network diff --git a/articles/appliance/infrastructure/security.md b/articles/appliance/infrastructure/security.md index f876ec34ee..adc6c39577 100644 --- a/articles/appliance/infrastructure/security.md +++ b/articles/appliance/infrastructure/security.md @@ -8,6 +8,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance40 +sitemap: false --- # PSaaS Appliance Infrastructure Requirements: Security and Access @@ -16,7 +17,12 @@ applianceId: appliance40 ## SSL Certificates -You need to create and install a unique SSL certificate for each PSaaS Appliance (such as your production cluster, your development node, or your QA environment). You need additional certificates if your environments require [extensions](/extensions) or you use [custom domains](/appliance/custom-domains). If you are using extensions, please see [Webtask with Dedicated Domains](/appliance/webtasks/dedicated-domains). +When using the PSaaS Appliance, you will need to provide several SSL certificates. You must create and install a unique SSL certificate for: + +* Each PSaaS Appliance (e.g., your production cluster, your development node, your QA environment) +* [Extensions](/appliance/extensions) +* [Custom Domains](/appliance/custom-domains) +* [Webtasks](/appliance/webtasks) (with or without [Dedicated Domains](/appliance/webtasks/dedicated-domains)) ::: note If you are unsure of where to get SSL Certificates, please contact your network security team. They are usually the ones familiar with the required processes and working with the appropriate certificate authorities (CA) to generate new certificates. @@ -24,8 +30,8 @@ You need to create and install a unique SSL certificate for each PSaaS Appliance The SSL Certificate: -* must be created by a public certificate authority. They cannot be self-signed. -* may be a wildcard *or* a multi-domain (SAN) certificate; +* must be created by a public certificate authority. They cannot be self-signed; +* can be a wildcard *or* a multi-domain (SAN) certificate; * must contain all required DNS/domain names, including those for the: * Management Dashboard; * Configuration Tenant; @@ -51,6 +57,14 @@ PARENT -----END CERTIFICATE----- ``` +If you're uploading the public and private keys separately, convert the private key to RSA as follows: + +```text +-----BEGIN RSA PRIVATE KEY----- +PRIVATE-KEY +-----END RSA PRIVATE KEY----- +``` + ## Transparent Proxies If you are behind a transparent proxy, you will need to: @@ -60,11 +74,11 @@ If you are behind a transparent proxy, you will need to: ## HTTPS or TLS -Users must connect to the PSaaS Appliance using secure protocols (HTTPS or TLS). Depending on your network design, you could terminate the Secure Channel at the load balancer or at the PSaaS Appliance. In both cases your SSL/TLS certificate must be locally installed on the PSaaS Appliance. +Users must connect to the PSaaS Appliance using secure protocols (HTTPS or TLS). Depending on your network design, you could terminate the Secure Channel at the load balancer or the PSaaS Appliance. In both cases, your SSL/TLS certificate must be locally installed on the PSaaS Appliance. ## SMTP -You must configure an SMTP server in order for the PSaaS Appliance to send emails. The PSaaS Appliance requires an authentication SMTP server that has been configured with SMTP PLAIN authentication. +You must configure an SMTP server for the PSaaS Appliance to send emails. The PSaaS Appliance requires an authentication SMTP server that has been configured with SMTP PLAIN authentication. **AWS SES Users**: If your domain is not validated, you will not be able to send email with AWS SES. @@ -78,8 +92,8 @@ Auth0 requires [remote access](/appliance/remote-access-options) to your PSaaS A ### Initial Configuration -Auth0's remote access method for initial configuration requires SSH access via Jumphost (the preferred method) or via VPN. After the initial configuration, please feel free to disable this connection. +Auth0's remote access method for initial configuration requires SSH access via Jumphost. After the initial setup, please feel free to disable this connection. ### Updates, Maintenance, and Troubleshooting -Typically, updates are performed via the Auth0 Dashboard. In the event that Auth0 needs to remote in to identify and troubleshoot issues, an Auth0 Customer Success Engineer will need access to the PSaaS Appliance through SSH access via Jumphost (the preferred method) or over VPN. This connection may be enabled for and disabled after the agreed-upon time frames for work. +Typically, updates are performed via the Auth0 Dashboard. If Auth0 needs to remote in to identify and troubleshoot issues, an Auth0 Customer Success Engineer will need access to the PSaaS Appliance through SSH access via Jumphost. This connection can be enabled for and disabled after the agreed-upon time frames for work. diff --git a/articles/appliance/infrastructure/virtual-machines.md b/articles/appliance/infrastructure/virtual-machines.md index 1ef637cf05..45851327f6 100644 --- a/articles/appliance/infrastructure/virtual-machines.md +++ b/articles/appliance/infrastructure/virtual-machines.md @@ -8,15 +8,12 @@ topics: contentType: reference useCase: appliance applianceId: appliance41 +sitemap: false --- # PSaaS Appliance Infrastructure Requirements: Virtual Machines -You may deploy the PSaaS Appliance on your premises using your own infrastructure or the infrastructure of a cloud provider. Currently, Auth0 supports the following PSaaS Appliance usage on the following virtualization environments: - -* Amazon Web Services (AWS); -* Microsoft Azure; -* VMware. +You may deploy the PSaaS Appliance on your premises using your own infrastructure or the infrastructure of a cloud provider. Currently, Auth0 supports PSaaS Appliance usage on Amazon Web Services (AWS). ## Virtual Machine Templates @@ -44,7 +41,7 @@ For multi-node clusters, Auth0 recommends deploying the PSaaS Appliance virtual ## For AWS Users -* The *recommended* [instance type](https://aws.amazon.com/ec2/instance-types/) is **M4.2xlarge** (minimum). +* The *recommended* [instance type](https://aws.amazon.com/ec2/instance-types/) is **m5.2xlarge** (minimum). * Auth0 will need the following pieces of information to share the AMI with you: * AWS account number; * AWS region name. The region should have at least three [availability zones](https://aws.amazon.com/about-aws/global-infrastructure) for your Production cluster. diff --git a/articles/appliance/instrumentation.md b/articles/appliance/instrumentation.md new file mode 100644 index 0000000000..1aea21eb0a --- /dev/null +++ b/articles/appliance/instrumentation.md @@ -0,0 +1,61 @@ +--- +section: appliance +description: This document covers why and how to enable instrumentation in the PSaaS Appliance. +topics: + - appliance + - instrumentation +contentType: + - how-to +useCase: appliance +applianceId: appliance45 +sitemap: false +--- +# PSaaS Appliance Monitoring: Instrumentation + +The PSaaS Appliance allows you to collect time series data about individual processes and the overall cluster. + +To collect and analyze time series data, you must: + +* Have instrumentation enabled (please contact Auth0 for assistance with this) +* Export the data collected to DataDog + +If you've chosen to host the PSaaS Appliance in your on-premise data center or in a cloud data center to which you've subscribed (e.g. AWS or Azure), you must use the instrumentation feature to monitor your PSaaS Appliance. + +If Auth0 hosts the PSaaS Appliance on your behalf, you do not have access to this feature – Auth0's Managed Service Engineering (MSE) team will use instrumentation to monitor the PSaaS Appliance for you. + +## Alerts + +The PSaaS Appliance does not come with any built-in tool for sending alerts. To remedy this, we rely on DataDog and Telegraf to help implement robust monitoring and alerting strategies for the PSaaS Appliance. + +### Signals to Monitor + +These are the signals that the PSaaS Appliance makes available to DataDog via the Telegraf agent. The Telegraf agent defines these signals automatically. + +* [CPU](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/CPU_README.md) +* [Disk](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/DISK_README.md) +* [Disk IO](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/DISK_README.md) +* [Memory](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/MEM_README.md) +* [Processes](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/PROCESSES_README.md) +* [Swap](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/MEM_README.md) +* [System](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/SYSTEM_README.md) +* [MongoDB](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/mongodb/README.md) +* [Net](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/system/net.go) +* [NGINX](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/nginx/README.md) +* [RabbitMQ](https://github.com/influxdata/telegraf/tree/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/rabbitmq) +* [Procstat](https://github.com/influxdata/telegraf/blob/34b7a4c3611d1ede908ef275401544c34a4a3ba3/plugins/inputs/procstat/README.md) +* [X509](https://github.com/influxdata/telegraf/blob/release-1.11/plugins/inputs/x509_cert/README.md) + +### Auth0 Signals to Monitor + +Please note that Auth0 exposes many internal metrics that will be visible in your DataDog console. The names of these metrics typically begin with `auth0_`. + +The internal metrics may change at any point, so in most cases, we do not recommend that you build monitoring strategies based on these signals (you can safely ignore these metrics, if you'd like). However, there are a few that you **should** monitor. We list the exceptions in the table below. + +| Signal | Description | +| - | - | +| auth0_http_requests_received | The total number of requests received by the PSaaS Appliance. | +| auth0_http_requests_replied | The total number of requests replied to by the PSaaS Appliance. | +| auth0_http_response_time.count | The number of responses issued by the PSaaS Appliance. This metric corresponds to `auth0_http_requests_replied`. | +| auth0_http_response_time.lower | The shortest amount of time it took for the PSaaS Appliance to respond to a request. | +| auth0_http_response_time.mean | The average time it took for the PSaaS Appliance to respond to a request. | +| auth0_http_response_time.upper | The longest amount of time it took for the PSaaS Appliance to respond to a request. | diff --git a/articles/appliance/instrumentation/add-grafana-users.md b/articles/appliance/instrumentation/add-grafana-users.md deleted file mode 100644 index 98d2c262d8..0000000000 --- a/articles/appliance/instrumentation/add-grafana-users.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -section: appliance -description: This document covers how to add new users to Grafana. -topics: - - appliance - - instrumentation -contentType: how-to -useCase: appliance -applianceId: appliance42 ---- - -# PSaaS Appliance: Adding Users to Grafana - - -By default, each Grafana instance (every PSaaS Appliance node comes with its own instance of Grafana) includes the following users: - -* `admin` -* `root@auth0.com` - -To visualize the instrumentation page with an PSaaS Appliance administrative user *other* than `root@auth0.com`, you will need to add that user to the Grafana instances for **each** PSaaS Appliance node. - -1. Navigate to the PSaaS Appliance node's instance of Grafana (`https://.com/grafana/`), and log in using a set of valid credentials. -2. Click the **Grafana icon** located in the top left corner. Select **Admin** and then **Global Users**. - - ![Grafana Admin Menu](/media/articles/appliance/instrumentation/grafana-users-1.png) - -3. To add the user, click **+ Add new user**. - - ![Grafana Add New User Button](/media/articles/appliance/instrumentation/grafana-users-2.png) - -3. Add the user's *email address* to the **Name**, **Email**, and **Username** fields, and set the user's password. This can be any complex password of the user's choosing. Note that the user will have to enter their password only if they try to access Grafana using Basic Authentication. If the user logs in using OAuth, Grafana will select the user based on the provided email address. - - ![Grafana Add New User Screen](/media/articles/appliance/instrumentation/grafana-users-3.png) - - You can use one of two authentication methods with Grafana: - - ::: panel Grafana Authentication - * **Basic Authentication**: used by configuration scripts launched by Puppet - * **OAuth Authentication**: used by when pages when users either: - * Visualize the instrumentation page; - * Navigate to Grafana's website. - ::: - -4. Click **Create**. You will now see the user reflected in the *Users* list. - - ![Grafana Users List](/media/articles/appliance/instrumentation/grafana-users-4.png) diff --git a/articles/appliance/instrumentation/available-metrics.md b/articles/appliance/instrumentation/available-metrics.md deleted file mode 100644 index 8ee9207ad9..0000000000 --- a/articles/appliance/instrumentation/available-metrics.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -section: appliance -description: This document covers the metrics available when using Instrumentation. -topics: - - appliance - - instrumentation -contentType: reference -useCase: appliance -applianceId: appliance43 ---- - -# PSaaS Appliance: Metrics Available via Instrumentation - -The following metrics are available to you when Instrumentation is enabled on your PSaaS Appliance: - -## Metrics Regarding PSaaS Appliance Infrastructure - -* [CPU](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/CPU_README.md) -* [Disk](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/DISK_README.md) -* [Disk I/O](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/DISK_README.md) -* [Memory](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/MEM_README.md) -* [Processes](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/PROCESSES_README.md) -* [Swap](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/MEM_README.md) -* [System](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/SYSTEM_README.md) -* [MongoDB](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/mongodb/README.md) -* [Net](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/system/net.go) -* [NGINX](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/nginx/README.md) -* [RabbitMQ](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/rabbitmq) -* [Procstat](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/procstat/README.md) - -## Metrics Regarding PSaaS Appliance Processes - -* auth0-api2_http_requests_authenticated -* auth0-api2_http_requests_received -* auth0-api2_http_requests_replied -* auth0-api2_http_response_time -* auth0-import-users-worker_event-loop_blocked -* auth0-import-users-worker_resources_cpu_usage -* auth0-import-users-worker_resources_memory_heapTotal -* auth0-import-users-worker_resources_memory_heapUsed -* auth0-import-users-worker_resources_memory_usage -* auth0-notifications_event-loop_blocked -* auth0-notifications_resources_cpu_usage -* auth0-notifications_resources_memory_heapTotal -* auth0-notifications_resources_memory_heapUsed -* auth0-notifications_resources_memory_usage -* auth0-server_auth_step_time -* auth0-server_clients_findByTenantAndClientId -* auth0-server_connections_getByName -* auth0-server_http_requests_received -* auth0-server_http_requests_replied -* auth0-server_http_response_time -* auth0-server_tenants_get -* auth0-users_bootup_time -* auth0-users_http_requests_received -* auth0-users_http_requests_replied -* auth0-users_http_requests_size -* auth0-users_http_response_time diff --git a/articles/appliance/instrumentation/components.md b/articles/appliance/instrumentation/components.md deleted file mode 100644 index 72b69292f0..0000000000 --- a/articles/appliance/instrumentation/components.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -section: appliance -description: This document covers the software used for Instrumentation. -topics: - - appliance - - instrumentation -contentType: reference -useCase: appliance -applianceId: appliance44 ---- - -# PSaaS Appliance: Instrumentation Components - -The following applications are used to implement Instrumentation within the PSaaS Appliance: - -* [Grafana](http://grafana.org/): tools for time series and metrics visualization -* [InfluxDB](https://www.influxdata.com/time-series-platform/influxdb/): time series database used to store/query collected data -* [Telegraf](https://www.influxdata.com/time-series-platform/telegraf/): tools for gathering data from the PSaaS Appliance diff --git a/articles/appliance/instrumentation/index.md b/articles/appliance/instrumentation/index.md deleted file mode 100644 index bb07693601..0000000000 --- a/articles/appliance/instrumentation/index.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -url: /appliance/instrumentation -section: appliance -description: This document covers why and how to enable instrumentation in the PSaaS Appliance. -topics: - - appliance - - instrumentation -contentType: - - index - - concept -useCase: appliance -applianceId: appliance45 ---- - -# Private SaaS (PSaaS) Appliance: Instrumentation - -The PSaaS Appliance ships with a feature called Instrumentation, which makes it easy for your PSaaS Appliance administrators or Auth0 Customer Success Engineers to gather information about the current (or previous) state of the PSaaS Appliance. With Instrumentation, you are collecting time series data about the overall PSaaS Appliance, as well as individual processes. You can then query or visualize this data to draw conclusions about the state of your PSaaS Appliance. - -::: note -Please contact your Auth0 Customer Success Manager if you would like to enable Instrumentation for your PSaaS Appliance (please note that this feature is not available for PSaaS Appliances hosted by Auth0). -::: - -* [Software Components Utilized](/appliance/instrumentation/components) -* [Available Metrics](/appliance/instrumentation/available-metrics) -* [Visualize Your Data](/appliance/instrumentation/visualize-data) -* [Add Users in Grafana](/appliance/instrumentation/add-grafana-users) diff --git a/articles/appliance/instrumentation/visualize-data.md b/articles/appliance/instrumentation/visualize-data.md deleted file mode 100644 index 46e8ea6360..0000000000 --- a/articles/appliance/instrumentation/visualize-data.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -section: appliance -description: This document covers how to visualize data gathered via Instrumentation. -topics: - - appliance - - instrumentation -contentType: how -useCase: appliance -applianceId: appliance46 ---- - -# PSaaS Appliance: How to Visualize Your Data - -Once you have enabled Instrumentation, you can access your data in one of two places: - -* PSaaS Appliance Dashboard -* Grafana - -## View Your Data in the PSaaS Appliance Dashboard - -If you would like to see your data in the Appliance Dashboard, navigate to `https:///configuration#/instrumentation` to access the graphs created from the data collected from your PSaaS Appliance instances. - -![PSaaS Appliance Instrumentation Dashboard](/media/articles/appliance/instrumentation/general-data.png) - -## Access Your Data Directly from Grafana - -Each PSaaS Appliance node has its own instances of Grafana, InfluxDB, and Telegraph. To access a given node's Grafana instance: - -1. Obtain the node's private IP address -2. Using the private IP address, navigate to `https://.com/grafana/` - -### Add Grafana Dashboards to the Instrumentation Page in the PSaaS Appliance Dashboard - -If you need to view relationships between datasets that have yet to be graphed, you can create new (or update existing) Grafana Dashboards displayed on the PSaaS Appliance Dashboard's Instrumentation page. To create new Grafana dashboards, please view [this video](https://www.youtube.com/watch?v=sKNZMtoSHN4&index=7&list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2). - -Once you have created your Grafana dashboards, tag them as `instrumentation` so that they appear on the Instrumentation page. To do this: - -1. Navigate to the Grafana dashboard's *Settings > General* page. -2. Add a tag to the appropriate Grafana dashboard called `instrumentation`. - -![Grafana Dashboard Settings Screen](/media/articles/appliance/instrumentation/tag-dashboard.png) diff --git a/articles/appliance/modules.md b/articles/appliance/modules.md index 3082f48b07..494289c92f 100644 --- a/articles/appliance/modules.md +++ b/articles/appliance/modules.md @@ -8,48 +8,42 @@ topics: contentType: reference useCase: appliance applianceId: appliance60 +sitemap: false --- # Node.js Modules Available in Rules and Custom Database Connections -For security reasons, rules and custom database connections for PSaaS Appliance run in a JavaScript sandbox. You can use the full power of the ECMAScript 5 language and a few selected libraries. - -The latest version of the PSaaS Appliance supports the use of three different modes: -* Webtask - This model has the same functionality as the Auth0 cloud version. It provides a balance between performance and isolation, supports a greater number of node modules, and is the recommended model for most customers; -* In process - This model executes within the Node.js process of the Auth0 service. This provides the best raw performance. The model provides no isolation between custom code and the Auth0 service, and supports only the limited set of modules listed below. The recommended approach for high scale is to allocate additional resources and use the Webtask model. In some very demanding conditions where isolation is not a concern, this model may be considered; -* Out-of-process - This is the original model that provides high isolation. It has significantly higher performance overhead compared to the other two models and supports the limited set of modules listed below. +For security reasons, you must execute rules and custom database logic for PSaaS Appliance using [the Webtask stage/sandbox](/appliance/webtasks). The sandbox offers you a performant environment running ECMAScript 6 and provides isolation for the code you've written. The current sandbox supports: -* [async](https://github.com/caolan/async) _(~0.9.0)_ -* [auth0](https://github.com/auth0/node-auth0) _(2.0.0-alpha.5)_ -* [azure_storage](https://github.com/Azure/azure-storage-node) _(~0.4.1)_ -* [bcrypt](https://github.com/ncb000gt/node.bcrypt.js) _(~0.8.3)_ -* [Buffer](http://nodejs.org/docs/v0.10.24/api/buffer.html) -* [couchbase](https://github.com/couchbase/couchnode) _(~1.2.1)_ -* [cql](https://github.com/jorgebay/node-cassandra-cql) _(~0.4.4)_ -* [crypto](http://nodejs.org/docs/v0.10.24/api/crypto.html) -* [ip](https://github.com/keverw/range_check) _(0.0.1)_ -* [jwt](https://github.com/auth0/node-jsonwebtoken) _(~0.4.1)_ -* [knex](http://knexjs.org) _(~0.6.3)_ - * The function returned by `require('knex')` is available as `Knex`. -* [lodash](https://github.com/lodash/lodash) _(~2.4.1)_ -* [mongo](https://github.com/mongodb/node-mongodb-native) _(~1.3.15)_ - * [BSON](http://mongodb.github.io/node-mongodb-native/api-bson-generated/bson.html) - * [Double](http://mongodb.github.io/node-mongodb-native/api-bson-generated/double.html) - * [Long](http://mongodb.github.io/node-mongodb-native/api-bson-generated/long.html) - * [ObjectID](http://mongodb.github.io/node-mongodb-native/api-bson-generated/objectid.html) - * [Timestamp](http://mongodb.github.io/node-mongodb-native/api-bson-generated/timestamp.html) -* [mysql](https://github.com/felixge/node-mysql) _(~2.0.0-alpha8)_ -* [pbkdf2](https://github.com/davidmurdoch/easy-pbkdf2) _(0.0.2)_ -* [pg](https://github.com/brianc/node-postgres) _(4.1.1)_ -* [pubnub](https://github.com/pubnub/javascript/tree/master/node.js) _(3.7.0)_ -* [q](https://github.com/kriskowal/q) _(~1.0.1)_ -* [querystring](http://nodejs.org/api/querystring.html) _(0.10.28)_ -* [request](https://github.com/mikeal/request) _(~2.27.0)_ -* [sqlserver](https://github.com/pekim/tedious) _(~0.1.4)_ -* [uuid](https://github.com/broofa/node-uuid) _(~2.0.1)_ -* [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) _(~0.2.8)_ -* [xmldom](https://github.com/jindw/xmldom) _(~0.1.13)_ -* [xpath](https://github.com/goto100/xpath) _(0.0.5)_ -* [xtend](https://github.com/Raynos/xtend) _(~1.0.3)_ +| Module | Version (If Applicable) | Notes | +| - | - | - | +| [async](https://github.com/caolan/async) | ~2.1.2 | | +| [auth0](https://github.com/auth0/node-auth0) | 2.13.0 | 2.13.0 | +| [bcrypt](https://github.com/ncb000gt/node.bcrypt.js) | ~3.0.0 | | +| [Buffer](http://nodejs.org/docs/v0.10.24/api/buffer.html) | | | +| [cql](https://github.com/jorgebay/node-cassandra-cql) | ~0.4.4 | | +| [crypto](http://nodejs.org/docs/v0.10.24/api/crypto.html) | | | +| [ip](https://github.com/keverw/range_check) | 0.3.2 | | +| [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) | ~7.1.9 | | +| [knex](http://knexjs.org) | ~0.8.6 | The function returned by `require('knex')` is available as `Knex`. | +| [lodash](https://github.com/lodash/lodash) | ~4.17.10 | | +| [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) | ~2.0.33 | | +| [node-mongodb-native - BSON](http://mongodb.github.io/node-mongodb-native/api-bson-generated/bson.html) | 0.3.2 | | +| [node-mongodb-native - Double](http://mongodb.github.io/node-mongodb-native/api-bson-generated/double.html) | | | +| [node-mongodb-native - Long](http://mongodb.github.io/node-mongodb-native/api-bson-generated/long.html) | | | +| [node-mongodb-native - ObjectID](http://mongodb.github.io/node-mongodb-native/api-bson-generated/objectid.html) | | | +| [node-mongodb-native - Timestamp](http://mongodb.github.io/node-mongodb-native/api-bson-generated/timestamp.html) | | | +| [mysql](https://github.com/felixge/node-mysql) | ~2.15.0 | | +| [pbkdf2](https://github.com/davidmurdoch/easy-pbkdf2) | 0.0.2 | | +| [pg](https://github.com/brianc/node-postgres) | 6.1.2 | | +| [pubnub](https://github.com/pubnub) | 3.7.11 | | +| [q](https://github.com/kriskowal/q) | ~1.4.1 | | +| [querystring](http://nodejs.org/api/querystring.html) | 0.2.0 | | +| [request](https://github.com/mikeal/request) | ~2.81.0 | | +| [uuid](https://github.com/kelektiv/node-uuid) | ~3.3.2 | | +| [xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) | ~0.11.2 | | +| [xmldom](https://github.com/jindw/xmldom) | ~0.1.13 | | +| [xpath](https://github.com/goto100/xpath) | 0.0.9 | | +| [xtend](https://github.com/Raynos/xtend) | ~4.0.0 | | diff --git a/articles/appliance/monitoring/authenticated-endpoints.md b/articles/appliance/monitoring/authenticated-endpoints.md index ed30d0c8e9..50fa8bc069 100644 --- a/articles/appliance/monitoring/authenticated-endpoints.md +++ b/articles/appliance/monitoring/authenticated-endpoints.md @@ -8,69 +8,164 @@ topics: contentType: how-to useCase: appliance applianceId: appliance47 +sitemap: false --- -# PSaaS Appliance: Using Authenticated Testing Endpoints +# PSaaS Appliance: Authenticated Testing Endpoints -For calls to the testing endpoints that return detailed information, Auth0 requires these requests to be authenticated using a key generated using the PSaaS Appliance Dashboard. This key is used in the request header of the call sent to the endpoint. +Auth0 offers endpoints that allow you to check the system health of a specific resource. In this article, we will cover the authenticated endpoints, which are available to those who submit requests whose header contains the appropriate credentials. -## Generating the API Key +The authenticated endpoints are similar to the Test All endpoints in that both return positive or negative status information about system resources. -To generate an API Key for use the authenticated testing endpoints, navigate to the [Settings](/appliance/dashboard/settings) page of your PSaaS Appliance Dashboard. There, you will find an [API Keys section](/appliance/dashboard/settings#api-keys) that allows you to generate new keys. +Authenticated endpoints do not provide detailed information about the system's resource utilization. Instead, they return an HTTP status reflecting the status of a given resource. Using the third-party tools of your choice, you can set up alerts that activate based on the status codes returned by Auth0's endpoints. -During the first use, you will see a that there is no key. To generate your first key, click on the "Generate" button at the far right of the row. +## How to generate an API key + +To send requests to the authenticated endpoints, you will need to generate and include an API key in the header of your request. + +Begin by navigating to the [Settings](/appliance/dashboard/settings) page of your PSaaS Appliance Dashboard. Scroll down to the [API Keys section](/appliance/dashboard/settings#api-keys). + +If this is the first time you are doing this, you'll see that there is no key. You can generate your first key by clicking the **Generate** button to the right. ![](/media/articles/appliance/api-keys/no-key.png) -You will be prompted to confirm the new key generation. If confirmed, you will see that the key now populates the previously-blank field. +You will be prompted to confirm the new key generation. + +Once confirmed, you will see that the key now populates the previously-blank field. ![](/media/articles/appliance/api-keys/key.png) +Scroll to the bottom of the page, and click Save to apply the new API Key value. + +At this point, Auth0 does a reconfiguration and restarts the health service. Once this process completes, you will be able to use your new API key. + :::panel-warning Changing Your API Key -You may only use one key at a time. If you generate a new key, all applications and services using the old key will fail. +You may only use one API key at a time. If you generate a new key, be sure to provide the new key to your existing applications and services; otherwise, they will fail. ::: -## Available Endpoints +## Authenticated API Endpoints + +The API exposes a number of endpoints that you can use to test the status of the service. -The following authenticated endpoints are available for you to use: +**Each node comes with its own set of endpoints, so you will need to make multiple calls if you are monitoring a multi-node PSaaS Appliance implementation.** The exception is the `GET /status/replicaset` endpoint, which reports on multiple nodes. -* GET /status/cpu -* GET /status/memory -* GET /status/disk -* GET /status/services -* GET /status/network -* GET /status/internet -* GET /status/email -* GET /status/db -* GET /status/replicaset +There are two ways you can call a specific API endpoint: -Your call might look something like the following: +* Submit your request to the node directly +* Issue your request through the load balancer using the manage domain + +If you're checking the status of a specific node, it's best to submit your request to the node directly: ```text -curl -v http://127.0.0.1:9110/status/cpu ---user api_keys_health:YOUR_API_KEY +curl -v https://{node-ip}/health/status/cpu --user api_keys_health:YOUR_API_KEY ``` -You may also make the call via https, though you will have to make the following modifications to your call: - * Add "health" to the URL path; - * Remove the port number from the IP address used. +Otherwise, you can issue your request through the load balancer using the **manage** domain: + +```text +curl -v https://{manage-dashboard-domain}/health/status/cpu --user api_keys_health:YOUR_API_KEY +``` + +### Response Codes + +Each endpoint will return one of three status codes to communicate the status of the resource in question: + +| Response Code | Response | +| ------------- | -------- | +| 204 | OK | +| 429 | Too many requests | +| 520 | Warning | + +Additionally, each status code conveys additional information depending on the endpoint being queried. You'll find more information on this in the following sections that cover the specific endpoints available to you. + +None of the responses will include a body. + +#### GET /status/cpu + +This endpoint returns information about the overall available CPU capacity in the last minute on the PSaaS Appliance. Overall CPU capacity means that all CPU time is aggregated and compared with the time that any core was not idle. For example, if a four-core PSaaS Appliance node had two cores completely utilized and two cores completely idle, the CPU capacity calculated will be 50%. + +| Response Code | Response | +| ------------- | -------- | +| 204 | The system had more than 20% of the total CPU capacity available in the last minute. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | The system had 20% of the total CPU capacity (or less) available in the last minute. | + +#### GET /status/memory + +This endpoint returns information on the amount of memory available on the PSaaS Appliance. + +| Response Code | Response | +| ------------- | -------- | +| 204 | The system has more than 10% of its memory available. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | The system has 10% (or less) of its memory available. | + +#### GET /status/disk + +This endpoint returns information on disk utilization. Each node has a set number of volumes; if there is at least one volume that's utilizing more than 90% of the allocated disk space, the endpoint returns a warning. + +| Response Code | Response | +| ------------- | -------- | +| 204 | No volume on the node exceeds 90% utilization. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | One or more disk(s) on the node has exceeded 90% utilization. | + +#### GET /status/services -For example, `http://10.1.0.248:9110/status/cpu` becomes `https://10.1.0.248/health/status/cpu`. +This endpoint checks to see if any of the node's core Auth0 services are down. -## Access from Outside the PSaaS Appliance +| Response Code | Response | +| ------------- | -------- | +| 204 | Every core service is running on the node. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | At least one of the core services on the node is not running. | + +#### GET /status/network + +This endpoint reports the status of the network for the node. The node issues a PING command to each node in the cluster, and if it fails to PING any node, the endpoint will return an error code. + +| Response Code | Response | +| ------------- | -------- | +| 204 | The node was able to successfully ping every other node in the cluster. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | The node was not able to ping at least one node in the cluster, indicating there's a network problem. | -If you'd like to access these endpoints from outside the PSaaS Appliance, you can do so using your `manage` domain. +#### GET /status/internet -| Internal Access | External Access | -| --------------- | --------------- | -| http://10.1.0.248:9110/status/cpu **or** https://10.1.0.248/health/status/cpu | ${manage_url}/health/status/cpu | +This endpoint tests outbound internet connectivity on the node over port 443. This endpoint issues a `HEAD` request to `https://apt-mirror.it.auth0.com`. If the request returns anything other than a 200 status code, this endpoint will return an HTTP code indicating failure. + +| Response Code | Response | +| ------------- | -------- | +| 204 | The node was able to successful issue a `HEAD` request to `https://apt-mirror.it.auth0.com`. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | The was unable to issue a `HEAD` request, or the node received an error message after sending a `HEAD` request to `https://apt-mirror.it.auth0.com`. | + +#### GET /status/email + +This endpoint tests the SMTP connection using the provided configuration settings. + +| Response Code | Response | +| ------------- | -------- | +| 204 | The node was able to use the provided configuration settings to connect to the SMTP server. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | The node was unable to connect to the SMTP server. | + +#### GET /status/db + +This endpoint checks to see if the node can run database queries and receive the results. + +| Response Code | Response | +| ------------- | -------- | +| 204 | The node was able to successfully query the database. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | The node was not able to connect and run a query against the database. | -## Endpoint Responses +#### GET /status/replicaset -Calls to authenticated endpoints will return in one of the following status codes: +This endpoint checks to see if the replica set is healthy. If there is at least one node that is down, the endpoint will return an HTTP code indicating failure. | Response Code | Response | | ------------- | -------- | -| 204 | There are no issues with the resource. | -| 429 | Too many requests have been made to the resource. | -| 520 | There is an issue with the resource. | +| 204 | All nodes in the replica set are up. | +| 429 | The status endpoint has been called too many times (limit: 10 requests per second). Please wait and try again. | +| 520 | At least one node in the replica set is down. | diff --git a/articles/appliance/monitoring/index.md b/articles/appliance/monitoring/index.md index a79abd098f..a7f8f588d9 100644 --- a/articles/appliance/monitoring/index.md +++ b/articles/appliance/monitoring/index.md @@ -5,20 +5,73 @@ description: Ways to monitor the PSaaS Appliance topics: - appliance - monitoring -contentType: index +contentType: +- index +- concept useCase: appliance applianceId: appliance48 +sitemap: false --- # Monitoring the Private SaaS (PSaaS) Appliance -In addition to providing tools for monitoring your PSaaS Appliance, Auth0 provides integration with select third-party utilities. +The PSaaS Appliance is a managed service, which means that Auth0 is responsible for: -Your options include: +* Installation +* Updates +* General maintenance tasks -* **Instrumentation**: If [Instrumentation](/appliance/instrumentation) has been enabled for your PSaaS Appliance instances, you can gather and visualize data about your infrastructure and processes - * If you've enabled Instrumentation, you can send your data to DataDog. You'll need to supply your DataDog API key in the configuration page to do this. When viewing your metrics in DataDog, it will *not* appear in the standard DataDog UI under Infrastructure. You'll need to add your own dashboard and search for the PSaaS Appliance data you want displayed. -* **Health Checks**: [Health Checks](/appliance/dashboard/troubleshoot#health-check) provide minute-by-minute summaries of your PSaaS Appliance infrastructure at a given point in time. These logs are available for the the previous twenty-nine days and can be found in the [Troubleshoot](/appliance/dashboard/troubleshoot) page of your PSaaS Appliance Configuration Area; -* **[Auth0's `testall` Endpoint](/appliance/monitoring/testall)**: The `testall` endpoint is an unauthenticated endpoint that is particularly useful for monitoring by load balancers; -* **[Auth0's Authenticated Testing Endpoints](/appliance/monitoring/authenticated-endpoints)**: Auth0 provides endpoints that you may, once authenticated, call to receive status codes such as *204*, *520*, or *429*; -* **Integration with Third-Party Utilities to Monitor Synthetic Transactions**: Auth0 supports integration with system monitoring tools like *Microsoft System Center* so that you can [run and monitor synthetic transactions](/monitoring#configuring-scom). \ No newline at end of file +However, the deployment option you choose affects the scope of what Auth0 can do when it comes to *monitoring* the PSaaS Appliance. Currently, Auth0 supports the following deployment options: + +* The subscriber's Amazon Web Services cloud environment +* An Auth0-controlled data center + +If you choose to deploy the PSaaS Appliance to an Auth0-controlled data center, we have control over every aspect involved (DNS, certificates, infrastructure, Auth0 software stack). This level of control allows us to assist you in monitoring the health of the PSaaS Appliance and acting to prevent or remediate issues. + +However, if you choose to deploy the PSaaS Appliance to AWS, **you are responsible for monitoring the deployment. Auth0 is unable to monitor such environments.** + +::: note +Please review [PSaaS Appliance: Roles and Responsibilities](https://auth0.com/docs/appliance/raci) for information on who is responsible for various activities related to managing and monitoring the PSaaS Appliance. +::: + +## Features Aiding Monitoring + +The PSaaS Appliance offers a number of tools to help you monitor the software that is running, as well as the infrastructure on which it runs. You can find additional information on these monitoring tools in the chart that follows: + +| Tool | Description | +| - | - | +| Service Status Check | The [`/testall` endpoint](/appliance/monitoring/testall) reports the overall status of core Auth0 services. You can call this endpoint from the load balancer or from an individual node. If called from the load balancer, you can determine if there's a system-wide service outage. If called from a specific node, you'll receive information on the status of core services running on that node alone. | +| System Health Checks | The [authenticated endpoints](/appliance/monitoring/authenticated-endpoints) provide a more granular health check than the `/testall` endpoint, allowing you to see the status of lower level system resources. With these endpoints, you can monitor the status of the PSaaS Appliance as it relates to memory, disk, network, internet, email, database, replica set, services, and the cluster.

      The authenticated endpoints return status codes indicating whether the system resource in question is healthy or not. | +| [Instrumentation](/appliance/instrumentation) | The PSaaS Appliance offers instrumentation data, which is a vital component of monitoring and detecting anomalies or problems *before* they occur. To review your PSaaS Appliance instrumentation data, you can send it to DataDog. With DataDog, you can set up robust monitoring and alerts strategies to review the health of your PSaaS Appliance. | +| Dashboards | The PSaaS Appliance's [Troubleshooting](/appliance/dashboard/troubleshoot) dashboard allows you to view [Health Check](/appliance/dashboard/troubleshoot#health-check) results for the past 29 days. Please note that this dashboard does not provide any alerts functionality and should not be used as your only monitoring strategy. | +| Audit and Tenant Events | The [Tenant Logs](https://auth0.com/docs/logs) track processed transactions and provide an overview of application activity in your tenant. | +| Synthetic Transactions | You can use any third-party service that supports synthetic transaction to monitor PSaaS Appliance service availability. | + +## Recommended Monitoring Strategy + +Because each subscriber's implementation is different, the monitoring strategy you employ should match the needs of your use case. + +With that said, Auth0 suggests the following as a starting point for monitoring the PSaaS Appliance. The signals mentioned are indicators that there might be an unhealthy scenario occurring and provide information on the appropriate action for you to take: + +| Signal | Trigger | Action | +| - | - | - | +| [/testall at load balancer level](/appliance/monitoring/testall) | Does not return 200 with body OK | [Submit a support ticket](/support/tickets) with a severity of **Urgent** | +| [/testall at node level](/appliance/monitoring/testall#monitoring-individual-nodes) | Does not return 200 with body OK | [Submit a support ticket](/support/tickets) with a severity of **High** | +| [GET /status/memory](/appliance/monitoring/authenticated-endpoints#get-status-memory) at node level | Returns a 520 status code | [Submit a support ticket](/support/tickets) with a severity of **Normal** | +| [GET /status/disk](/appliance/monitoring/authenticated-endpoints#get-status-disk) at node level | Returns a 520 status code | [Submit a support ticket](/support/tickets) with a severity of **Normal** | +| [GET /status/network](/appliance/monitoring/authenticated-endpoints#get-status-network) at node level | Returns a 520 status code | [Submit a support ticket](/support/tickets) with a severity of **Normal** | +| [GET /status/internet](/appliance/monitoring/authenticated-endpoints#get-status-internet) at node level | Returns a 520 status code | [Submit a support ticket](/support/tickets) with a severity of **Normal** | +| [GET /status/email](/appliance/monitoring/authenticated-endpoints#get-status-email) at node level | Returns a 520 status code | [Submit a support ticket](/support/tickets) with a severity of **Normal** | +| [GET /status/db](/appliance/monitoring/authenticated-endpoints#get-status-db) at node level | Returns a 520 status code | [Submit a support ticket](/support/tickets) with a severity of **Normal** | +| [GET /status/replicaset](/appliance/monitoring/authenticated-endpoints#get-status-replicaset) at node level | Returns a 520 status code | [Submit a support ticket](/support/tickets) with a severity of **Normal** | +| Synthetic Transaction: Login | Synthetic login failed | [Submit a support ticket](/support/tickets) with a severity of **Normal** | + +When building your monitoring strategy for a PSaaS Appliance implementation hosted on an environment you own or control, remember that you are responsible for using the instrumentation and tenant log data to watch for anomalies. + +## Your Responsibilities in Monitoring the Auth0-Hosted PSaaS Appliance + +If Auth0 hosts your PSaaS Appliance, you won't have access to instrumentation data. However, you are still expected to monitor your tenant logs for anomalies, since this provides you information on the health of your PSaaS Appliance-dependent applications. + +If Auth0 hosts your PSaaS Appliance implementation, Auth0's Managed Service Engineering (MSE) team is responsible for monitoring. However, the MSE team is focused on the health of the PSaaS Appliance – you are responsible for tracking the health of your applications, as well as its usage of Auth0. + +If you provide Auth0 with the appropriate email addresses, Auth0 can send a daily uptime report of your hosted PSaaS Appliance service to those email addresses. You can also specify one or more email addresses to which Auth0 will send alerts in the event that there is an issue. diff --git a/articles/appliance/monitoring/testall.md b/articles/appliance/monitoring/testall.md index 13d675219c..442f42ee39 100644 --- a/articles/appliance/monitoring/testall.md +++ b/articles/appliance/monitoring/testall.md @@ -8,6 +8,7 @@ topics: contentType: how-to useCase: appliance applianceId: appliance49 +sitemap: false --- # Using the `testall` Endpoint diff --git a/articles/appliance/private-cloud-requirements.md b/articles/appliance/private-cloud-requirements.md index 2297110d04..58a4f080df 100644 --- a/articles/appliance/private-cloud-requirements.md +++ b/articles/appliance/private-cloud-requirements.md @@ -9,6 +9,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance61 +sitemap: false --- # Requirements for the Auth0 Dedicated Cloud Service diff --git a/articles/appliance/raci.md b/articles/appliance/raci.md index ebc1bd4ef9..4d86c2fe93 100644 --- a/articles/appliance/raci.md +++ b/articles/appliance/raci.md @@ -7,6 +7,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance62 +sitemap: false --- # PSaaS Appliance: Roles and Responsibilities @@ -42,14 +43,14 @@ The following RACI Matrix provides a more in-depth summary of the roles and resp |PSaaS Appliance-Related Tasks or Deliverables|Auth0|Subscriber|Notes| |---|---|---|---| |Preparing VM Infrastructure, including: memory, storage, processors, load balances, networks, SSL certificates, DNS records, SMTP servers, enabling Auth0 access via Jumphost/VPN|C|R, A (subscriber's infrastructure engineer)|The subscriber will submit the PSaaS Appliance Infrastructure Checklist when the VMs are ready and the [infrastructure requirements](/appliance/infrastructure) are met.| -|Deployment to Development and Production environments|R, A - Auth0 Customer Success Engineer|I|The Auth0 Customer Success Engineer will SSH into the VMs and deploy the Appliance.| -|Configuration of Development and Production environments|C|R|The Auth0 CSE will show the subscriber's infrastructure engineer [how to upload the SSL certificates, enter the SMTP credentials, and add administrators](/appliance/dashboard).| -|Operations Handover|R|C|Auth0 Customer Success Engineers will provide a 90-minute Operations Handover meeting to review information regarding PSaaS Appliance monitoring, backup, and updates, as well as answer questions.| +|Deployment to Development and Production environments|R, A - Auth0 Managed Service Engineer (MSE)|I|The Auth0 Managed Service Engineer will SSH into the VMs and deploy the Appliance.| +|Configuration of Development and Production environments|C|R|The Auth0 MSE will show the subscriber's infrastructure engineer [how to upload the SSL certificates, enter the SMTP credentials, and add administrators](/appliance/dashboard).| +|Operations Handover|R|C|Auth0 Managed Service Engineers will provide a 90-minute Operations Handover meeting to review information regarding PSaaS Appliance monitoring, backup, and updates, as well as answer questions.| |Monitoring|I|R, A|The subscriber is responsible for [monitoring the PSaaS Appliance](/appliance/monitoring).| |Backing Up|I (in the event that there are issues)|R, A|The subscriber is responsible for [backing up the PSaaS Appliance](/appliance/disaster-recovery) using the [Command-Line Tools](/appliance/cli).| |Code Integration into Applications|C, I (in the event that there are issues)|R, A|The subscriber is responsible for Auth0 code integration.| |User Migration (if required)|C, I (in the event that there are issues)|R, A|The subscriber is responsible for migrating users where appropriate.| -|Updates|R|R, A|Auth0 Customer Success Engineers will partner with the subscriber's infrastructure engineers to update the PSaaS Appliance on an agreed-upon basis. The subscriber is responsible for: taking VM snapshot(s) prior to the update, providing access to the PSaaS Appliance, being present as the PSaaS Appliance updates. Auth0 is responsible for: running manual scripts (if required), informing the subscriber on the status of the upgrade.| +|Updates|R|R, A|Auth0 Managed Service Engineers will partner with the subscriber's infrastructure engineers to update the PSaaS Appliance on an agreed-upon basis. The subscriber is responsible for: taking VM snapshot(s) prior to the update, providing access to the PSaaS Appliance, being present as the PSaaS Appliance updates. Auth0 is responsible for: running manual scripts (if required), informing the subscriber on the status of the upgrade.| |Testing Updates|C, I (in the event that there are questions/issues)|R, A|The subscriber will test the PSaaS Appliance after the Development node has been updated and inform Auth0 about any issues.| |Issue Identification and Support Ticket Submission|C|R, A|The subscriber is responsible for submitting issues via the [Support Center](/onboarding/enterprise-support).| |Issue Resolution|R|C|Auth0 will provide support for issues within the *core* of the PSaaS Appliance. Auth0 will *consult* on issues pertaining to integration between Auth0 APIs and Dashboards.| diff --git a/articles/appliance/remote-access-options.md b/articles/appliance/remote-access-options.md index b185655439..586fd59a1f 100644 --- a/articles/appliance/remote-access-options.md +++ b/articles/appliance/remote-access-options.md @@ -7,6 +7,7 @@ topics: contentType: reference useCase: appliance applianceId: appliance63 +sitemap: false --- # PSaaS Appliance Remote Access Options @@ -49,25 +50,7 @@ Similar to option 1, this configuration permits an external Auth0 Jumphost to co * Additional virtual Jumphost required in customer infrastructure -### Option 3: VPN - -This configuration provides VPN access to the customer’s network either to Auth0 engineers individually or a dedicated, Jumphost-like Auth0 server. - -![](/media/articles/appliance/remote-access/vpn.png) - -*Pros*: - -* Customers usually have VPN infrastructure in place -* No additional servers are required -* Auth0 access can be enabled and disabled using existing VPN account procedures - -*Cons*: - -* Inability to audit management activity on the command line -* Customer responsible for provisioning VPN accounts for Auth0 engineers and Identity Management -* Customer responsible for securing VPN traffic only to PSaaS appliance -* Customer is responsible for VPN availability (critical to allow access during support events) ### Unsupported Configurations -We do not support other methods, such as VDI or Screen Sharing mechanisms. They introduce compliance concerns, including (but not limited to) Auth0’s inability to internally audit connections and SSH sessions, enforce identity management on Auth0 employee accounts,exposure to untrusted systems on customer’s end running non-standard software (from where the connections are generated to Auth0 VMs), and inability to verify the identity of participants on the other end. \ No newline at end of file +We do not support other methods, such as VDI or Screen Sharing mechanisms. They introduce compliance concerns, including (but not limited to) Auth0’s inability to internally audit connections and SSH sessions, enforce identity management on Auth0 employee accounts, exposure to untrusted systems on customer’s end running non-standard software (from where the connections are generated to Auth0 VMs), and inability to verify the identity of participants on the other end. diff --git a/articles/appliance/webtasks/dedicated-domains.md b/articles/appliance/webtasks/dedicated-domains.md index 30b2b9b4e6..11bbe60ff3 100644 --- a/articles/appliance/webtasks/dedicated-domains.md +++ b/articles/appliance/webtasks/dedicated-domains.md @@ -13,12 +13,11 @@ contentType: - how-to useCase: appliance applianceId: appliance50 +sitemap: false --- # PSaaS Appliance: Webtask with Dedicated Domains -Some extensions, such as the [Authorization Extension](/extensions/authorization-extension/v2), required us to enable full trust in your PSaaS environment to run correctly. - -Beginning with PSaaS Appliance version `13451`, you may now configure Webtask on a dedicated domain. This enables you to safely use extensions in multi-tenant environments (the behavior is akin to that of the Auth0 Public Cloud Service). +In order to use extensions, such as the [Authorization Extension](/extensions/authorization-extension/v2), you will need to configure Webtasks on a dedicated domain in PSaaS Appliance environments. This enables you to safely use extensions in multi-tenant environments (the behavior is akin to that of the Auth0 Public Cloud Service). ::: note If you are planning on using [Extensions](/appliance/extensions), you must implement Webtask dedicated domains. diff --git a/articles/appliance/webtasks/index.md b/articles/appliance/webtasks/index.md index b1a1bd285c..c390c9c027 100644 --- a/articles/appliance/webtasks/index.md +++ b/articles/appliance/webtasks/index.md @@ -9,6 +9,7 @@ contentType: - index useCase: appliance applianceId: appliance51 +sitemap: false --- # PSaaS Appliance: Webtasks @@ -22,23 +23,7 @@ Prior to working with Webtasks, please ensure that you have configured the: * [Webtask Command Line Interface (`wt-cli`)](https://webtask.io/docs/101) ::: -## Sandboxes - -Auth0 provides different stages (which are known as sandboxes) on which you may run your rules and custom database logic: - -* `node_sandbox` (default): while more secure than `eval`, `node_sandbox` is more resource intensive; -* `eval`: provides the best performance, but is the least secure of the three available modes; -* `auth0-sandbox`: provides better performance that `node_sandbox`, improved isolation over `eval`, and offers a greater number of Node.js modules for use with your custom code. - -::: note -Only one sandbox mode may be selected at any given time (for example, you may not run selected rules in one sandbox and other rules in another sandbox). If you would like to change the sandbox mode, please discuss this with your Auth0 Customer Success Engineer. -::: - -## Code Compatibility - -Code that you have written for use with `node-sandbox` or `eval` will work in `auth0-sandbox`. However, code that is written for `auth0-sandbox` may not be compatible with `node-sandbox` or `eval`, especially if your code uses modules. - -The `auth0-sandbox` is the recommended method for running your custom code. +Auth0 provides `auth0-sandbox`, a stage (sometimes referred to as a *sandbox*) on which you may run your rules and custom database logic. ## Working with Webtasks @@ -48,9 +33,11 @@ You may use Webtasks by calling its endpoints directly. This can be done using t Currently, not all of the [Node.js modules available for the Auth0 Cloud Environment](https://auth0-extensions.github.io/canirequire/) are available for the PSaaS Appliance. -To see which modules are available for Webtasks running on PSaaS Appliance instances, execute the [`List Modules` Webtask](https://github.com/auth0-extensions/canirequire/blob/gh-pages/tasks/list_modules.js) using the appropriate sandbox on your PSaaS Appliance instance. +To see which modules are available for Webtasks running on PSaaS Appliance instances, execute the [`List Modules` Webtask](https://github.com/auth0-extensions/canirequire/blob/gh-pages/tasks/list_modules.js) on your PSaaS Appliance instance. -First, copy locally the [`List Modules` Webtask](https://github.com/auth0-extensions/canirequire/blob/gh-pages/tasks/list_modules.js), either by downloading the file or by copying this code: +#### Set up the List Modules Webtask + +First, copy locally the [`List Modules` Webtask](https://github.com/auth0-extensions/canirequire/blob/gh-pages/tasks/list_modules.js), either by downloading the file from GitHub or by copying this code: ```js 'use npm'; @@ -96,13 +83,13 @@ module.exports = cb => { }; ``` -Afterwards, create a webtask profile using `wt-cli`, if you don't already have one. +Next, create a Webtask profile using `wt-cli` (if you don't already have one): ```bash wt init --container "YOUR_TENANT_NAME" --url "WEBTASK_URL" --token "eyJhbGci..." -p "a``YOUR_TENANT_NAME-default" ``` -Now you are ready to register your webtask, using the `wt create` command. This command receives as input a path or URL of the webtasks's code and provides as output the URL where the webtask is available. +Finally, you are ready to register your Webtask using the `wt create` command. This command receives as input a path or URL of the ebtask's code and provides as output the URL where the Webtask is available. If you saved the file under a `my-webtasks` directory as `list_modules.js` you would use the following: @@ -110,8 +97,7 @@ If you saved the file under a `my-webtasks` directory as `list_modules.js` you w wt create ./my-webtasks/list_modules.js ``` -You should get a message that the webtask was created, alongside with the URL to access it. The response is a JSON object. - +You should get a message that the Webtask was created, alongside with the URL to access it. The response is a JSON object. ```json { diff --git a/articles/application-auth/current/client-side-web.md b/articles/application-auth/current/client-side-web.md index bfb125f842..8d504faa5c 100644 --- a/articles/application-auth/current/client-side-web.md +++ b/articles/application-auth/current/client-side-web.md @@ -16,11 +16,11 @@ useCase: # Authentication for Client-side Web Apps -You can use the Auth0 Authentication API to create client-side web applications that use [OpenID Connect](/protocols/oidc) and [OAuth 2.0](/protocols/oauth2) to authenticate users and get their authorization to access protected resources. +You can use the Auth0 Authentication API to create client-side web applications that use [OpenID Connect](/protocols/oidc) and [OAuth 2.0](/protocols/oauth2) to authenticate users and get their authorization to access protected resources. ## Overview -Auth0 exposes endpoints that you can use to authenticate users and get their authorization. You can redirect the user from your JavaScript application to these endpoints in the web browser. Auth0 will handle the authentication of the user, get their authorization for the resources your app wants to access, and then redirect the user back to a pre-configured callback URL, returning an [ID Token](/tokens/id-token) and [Access Token](/tokens/access-token) in the hash fragment of the request. +Auth0 exposes endpoints that you can use to authenticate users and get their authorization. You can redirect the user from your JavaScript application to these endpoints in the web browser. Auth0 will handle the authentication of the user, get their authorization for the resources your app wants to access, and then redirect the user back to a pre-configured callback URL, returning an [ID Token](/tokens/concepts/id-tokens) and [Access Token](/tokens/concepts/access-tokens) in the hash fragment of the request. ## The Authentication Flow @@ -28,9 +28,9 @@ The OAuth 2.0 Authorization Framework allows for different kinds of authorizatio The Implicit Grant flow is initiated by redirecting the user in the web browser to the Auth0 `/authorize` endpoint. Auth0 will then display the Auth0 Lock dialog, allowing the user to enter their credentials or alternatively sign in with any other configured [Identity Provider](/identityproviders). -After the user has authenticated, Auth0 will redirect the browser back to the **Redirect URI** (also called **Callback URL**), passing along the [ID Token](/tokens/id-token) as parameter in the [hash fragment](https://en.wikipedia.org/wiki/Fragment_identifier). The [ID Token](/tokens/id-token) is a [JSON Web Token (JWT)](/jwt) and contains various attributes (referred to as Claims) regarding the user, such as the user's name, email address, profile picture and so on. +After the user has authenticated, Auth0 will redirect the browser back to the **Redirect URI** (also called **Callback URL**), passing along the [ID Token](/tokens/concepts/id-tokens) as parameter in the [hash fragment](https://en.wikipedia.org/wiki/Fragment_identifier). The [ID Token](/tokens/concepts/id-tokens) is a [JSON Web Token (JWT)](/tokens/concepts/jwts) and contains various attributes (referred to as Claims) regarding the user, such as the user's name, email address, profile picture and so on. -The [ID Token](/tokens/id-token) can be decoded to extract the claims and you are free to use these inside of your application, to display a user's name and profile image for example. +The [ID Token](/tokens/concepts/id-tokens) can be decoded to extract the claims and you are free to use these inside of your application, to display a user's name and profile image for example. ::: note You can potentially also receive an Access Token which can be used to call the [Authentication API's `/userinfo` endpoint](/api/authentication#get-user-info) or your own APIs. @@ -47,15 +47,15 @@ For more information on calling APIs from Client-side Web Apps, please see [Call ## Register your Applications -The first thing you need to do is to create a new applications in Auth0. An Auth0 applications maps to your application and allows it to use Auth0 for authentication. +The first thing you need to do is to create a new application in Auth0. An Auth0 application maps to your application and allows it to use Auth0 for authentication. Navigate to the [Auth0 Dashboard](${manage_url}) and click on the [Applications](${manage_url}/#/applications) menu option on the left. Create a new Application by clicking on the **Create Applications** button. -The **Create Applications** window will open, allowing you to enter the name of your new application. Choose **Single Page Web Applications** as the **Applications Type** and click on the **Create** button to create the new applications. +The **Create Applications** window will open, allowing you to enter the name of your new application. Choose **Single-Page Web Applications** as the **Applications Type** and click on the **Create** button to create the new applications. ![](/media/articles/client-auth/client-side-web/create-client.png) -Once the applications has been created you can navigate to the **Settings** tab of the applications and in the **Allowed Callback URLs** field add a URL where Auth0 must redirect to after the user has authenticated, such as `https://YOUR_APP/callback`. +Once the application has been created you can navigate to the **Settings** tab of the applications and in the **Allowed Callback URLs** field add a URL where Auth0 must redirect to after the user has authenticated, such as `https://YOUR_APP/callback`. This URL must be part of your application, as your application will need to extract the ID Token from the hash fragment of this URL. @@ -69,7 +69,7 @@ Save the Settings. ## Call the Authorization URL -The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any SSO session is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. +The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any Single Sign-on (SSO) session is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. This endpoint supports the following query string parameters: @@ -77,7 +77,7 @@ This endpoint supports the following query string parameters: |:------------------|:---------| | response_type | The response type specifies the Grant Type you want to use. For client-side web applications using the Implicit Grant Flow, this should be `id_token`. (If you also want to receive an Access Token it should be set to `token id_token`.) | | client_id | The Client ID of the Applications you registered in Auth0. This can be found on the **Settings** tab of your Applications in the Auth0 Dashboard | -| scope | Specifies the claims (or attributes) of the user you want the be returned in the [ID Token](/tokens/id-token). To obtain an [ID Token](/tokens/id-token) you need to specify at least a scope of `openid`. If you want to return the user's full profile information, you can request `openid profile`.

      You can read up more about [scopes](/scopes). | +| scope | Specifies the claims (or attributes) of the user you want the be returned in the [ID Token](/tokens/concepts/id-tokens). To obtain an [ID Token](/tokens/concepts/id-tokens) you need to specify at least a scope of `openid`. If you want to return the user's full profile information, you can request `openid profile`.

      You can read up more about [scopes](/scopes). | | redirect_uri | The URL in your application where the user will be redirected to after they have authenticated, such as `https://YOUR_APP/callback`| | connection | This is an optional parameter which allows you to force the user to sign in with a specific connection. You can for example pass a value of `github` to send the user directly to GitHub to log in with their GitHub account.

      If this parameter is not specified, the user will be presented with the normal Auth0 Lock screen from where they can sign in with any of the available connections. You can see the list of configured connections on the **Connections** tab of your applications. | | state | The state parameter will be sent back should be used for CSRF and contextual information (like a return url) | @@ -89,17 +89,17 @@ This endpoint supports the following query string parameters: ## Handle the callback -After the user has authenticated, Auth0 will call back to the URL specified in the `redirect_uri` query string parameter which was passed to the `/authorize` endpoint. When calling back to this URL, Auth0 will pass along the [ID Token](/tokens/id-token) in the hash fragment of the URL, such as +After the user has authenticated, Auth0 will call back to the URL specified in the `redirect_uri` query string parameter which was passed to the `/authorize` endpoint. When calling back to this URL, Auth0 will pass along the [ID Token](/tokens/concepts/id-tokens) in the hash fragment of the URL, such as ```text https://YOUR_APP/callback#id_token=eyJ0... ``` -The [ID Token](/tokens/id-token) will be a [JSON Web Token (JWT)](/jwt) containing information about the user. You can access the hash fragment using the `window.location.hash` property and then use basic JavaScript string manipulation to access the ID Token. +The [ID Token](/tokens/concepts/id-tokens) will be a [JSON Web Token (JWT)](/tokens/concepts/jwts) containing information about the user. You can access the hash fragment using the `window.location.hash` property and then use basic JavaScript string manipulation to access the ID Token. -You will need to decode the [ID Token](/tokens/id-token) in order to read the claims (or attributes) of the user. The [JWT section of our website](/jwt) contains more information about the structure of a JWT. +You will need to decode the [ID Token](/tokens/concepts/id-tokens) in order to read the claims (or attributes) of the user. -Once the JWT is decoded, you can extract the information about the user from the payload of the [ID Token](/tokens/id-token). This is a JSON structure and will contain the claims (attributes) about the user as well as some other metadata. +Once the JWT is decoded, you can extract the information about the user from the payload of the [ID Token](/tokens/concepts/id-tokens). This is a JSON structure and will contain the claims (attributes) about the user as well as some other metadata. The [Auth0.js library](https://auth0.com/docs/libraries/auth0js) can assist you in decoding the JWT by calling the `parseHash` function, and then access the ID Token values from the `idTokenPayload` property: @@ -151,7 +151,7 @@ The [Auth0.js library](https://auth0.com/docs/libraries/auth0js) can assist you ### The ID Token payload -An example payload for an [ID Token](/tokens/id-token) may look something like this: +An example payload for an [ID Token](/tokens/concepts/id-tokens) may look something like this: ```json { @@ -175,13 +175,13 @@ The payload above contains the following claims: | email | The email address of the user which is returned from the Identity Provider. | | picture | The profile picture of the user which is returned from the Identity Provider. | | sub | The unique identifier of the user. This is guaranteed to be unique per user and will be in the format (identity provider)|(unique id in the provider), such as github|1234567890. | -| iss | The _issuer_. A case-sensitive string or URI that uniquely identifies the party that issued the JWT. For an Auth0 issued [ID Token](/tokens/id-token), this will be **the URL of your Auth0 tenant**.

      **This is a [registered claim](https://tools.ietf.org/html/rfc7519#section-4.1) according to the JWT Specification** | -| aud | The _audience_. Either a single case-sensitive string or URI or an array of such values that uniquely identify the intended recipients of this JWT. For an Auth0 issued [ID Token](/tokens/id-token), this will be the **Client ID of your Auth0 Applications**.

      **This is a [registered claim](https://tools.ietf.org/html/rfc7519#section-4.1) according to the JWT Specification** | +| iss | The _issuer_. A case-sensitive string or URI that uniquely identifies the party that issued the JWT. For an Auth0 issued [ID Token](/tokens/concepts/id-tokens), this will be **the URL of your Auth0 tenant**.

      **This is a [registered claim](https://tools.ietf.org/html/rfc7519#section-4.1) according to the JWT Specification** | +| aud | The _audience_. Either a single case-sensitive string or URI or an array of such values that uniquely identify the intended recipients of this JWT. For an Auth0 issued [ID Token](/tokens/concepts/id-tokens), this will be the **Client ID of your Auth0 Applications**.

      **This is a [registered claim](https://tools.ietf.org/html/rfc7519#section-4.1) according to the JWT Specification** | | exp | The _expiration time_. A number representing a specific date and time in the format “seconds since epoch” as [defined by POSIX6](https://en.wikipedia.org/wiki/Unix_time). This claim sets the exact moment from which this **JWT is considered invalid**.

      **This is a [registered claim](https://tools.ietf.org/html/rfc7519#section-4.1) according to the JWT Specification** | | iat | The _issued at time_. A number representing a specific date and time (in the same format as `exp`) at which this **JWT was issued**.

      **This is a [registered claim](https://tools.ietf.org/html/rfc7519#section-4.1) according to the JWT Specification** | | nonce | A string value which was sent with the request to the `/authorize` endpoint. This is used to [prevent token replay attacks](/api-auth/tutorials/nonce). | -The exact claims contained in the [ID Token](/tokens/id-token) will depend on the `scope` parameter you sent to the `/authorize` endpoint. In an [ID Token](/tokens/id-token) issued by Auth0, the **registered claims** and the `sub` claim will always be present, but the other claims depends on the `scope`. You can refer to the [examples below](#examples) to see examples of how the scope influences the claims being returned. +The exact claims contained in the [ID Token](/tokens/concepts/id-tokens) will depend on the `scope` parameter you sent to the `/authorize` endpoint. In an [ID Token](/tokens/concepts/id-tokens) issued by Auth0, the **registered claims** and the `sub` claim will always be present, but the other claims depends on the `scope`. You can refer to the [examples below](#examples) to see examples of how the scope influences the claims being returned. ::: note The [JWT.io website](https://jwt.io) has a handy debugger which will allow you to debug any JSON Web Token. This is useful is you quickly want to decode a JWT to see the information contained in the token. @@ -189,7 +189,7 @@ The [JWT.io website](https://jwt.io) has a handy debugger which will allow you t ### Keep the user logged in -Auth0 will assist you in authenticating a user, but it is up to you to keep track in your application of whether or not a user is logged in. You can use `localStorage` to keep track of whether a user is logged in or not, and also to store the claims of the user which was extracted from the [ID Token](/tokens/id-token). +Auth0 will assist you in authenticating a user, but it is up to you to keep track in your application of whether or not a user is logged in. You can use `localStorage` to keep track of whether a user is logged in or not, and also to store the claims of the user which was extracted from the [ID Token](/tokens/concepts/id-tokens). You can then use those claims inside of your application to display the user's information or otherwise personalize the user's experience. @@ -214,7 +214,7 @@ ${account.callback} #id_token=eyJ0... ``` -And this is an example of the decoded payload of the [ID Token](/tokens/id-token) which will be returned: +And this is an example of the decoded payload of the [ID Token](/tokens/concepts/id-tokens) which will be returned: ```json { @@ -247,7 +247,7 @@ ${account.callback} #id_token=eyJ0... ``` -The name and profile picture will be available in the `name` and `picture` claims of the returned [ID Token](/tokens/id-token): +The name and profile picture will be available in the `name` and `picture` claims of the returned [ID Token](/tokens/concepts/id-tokens): ```json { @@ -289,7 +289,7 @@ ${account.callback} #id_token=eyJ0... ``` -The user's name and profile attributes, such as the name, nickname and picture will be available in the `name`, `nickname` and `picture` claims of the returned [ID Token](/tokens/id-token). You will also notice that the `sub` claim contains the User's unique ID returned from GitHub: +The user's name and profile attributes, such as the name, nickname and picture will be available in the `name`, `nickname` and `picture` claims of the returned [ID Token](/tokens/concepts/id-tokens). You will also notice that the `sub` claim contains the User's unique ID returned from GitHub: ```json { diff --git a/articles/application-auth/current/index.md b/articles/application-auth/current/index.md index 65d8cac690..685c9b3586 100644 --- a/articles/application-auth/current/index.md +++ b/articles/application-auth/current/index.md @@ -1,7 +1,7 @@ --- classes: topic-page title: Application Authentication -description: Introduction to the various application authentication flows. +description: Introduction to authentication and the various application authentication flows. topics: - authentication - oauth2 @@ -10,16 +10,26 @@ useCase: - add-login --- -# Application Authentication +# Authentication -Auth0 uses [OpenID Connect](/protocols/oidc) and [OAuth 2.0](/protocols/oauth2) to authenticate users and get their authorization to access protected resources. +Authentication refers to the process of confirming identity. While often used interchangeably with [authorization](/authorization), authentication represents a fundamentally different function. -We support scenarios for mobile, desktop, server-side, or client-side applications. +In authentication, a user or application proves they are who they say they are by providing valid credentials for verification. Authentication is often proved through a username and password, sometimes combined with other elements called _factors_, which fall into three categories: what you know, what you have, or what you are. -You can get more details on implementing these flows by following one of the following links: +* **Single-Factor Authentication** relies on a password. Example: a school website that only requires validating a password against a username. +* **Two-Factor Authentication** relies on a piece of confidential information in addition to a username and password. Example: a banking website that validates a password against a username and then requires the user to enter a PIN known to only the user. +* **Multi-Factor Authentication (MFA)** uses two or more security factors from independent categories. Example: a hospital system that requires a username and password, a security code received on the user's smartphone, and fingerprint. + +For a comparison of authentication and authorization, see [Authentication vs. Authorization](/authorization/concepts/authz-and-authn). + +# Application Authentication Flows + +Auth0 uses [OpenID Connect](/protocols/oidc) and [OAuth 2.0](/protocols/oauth2) to authenticate users and verify their identity. + +We support scenarios for mobile, desktop, server-side, or client-side applications. You can get more details on implementing these flows by exploring: <%= include('../../_includes/_topic-links', { links: [ - 'application-auth/current/mobile-desktop', - 'application-auth/current/server-side-web', - 'application-auth/current/client-side-web' + 'flows/guides/auth-code-pkce/add-login-auth-code-pkce', + 'flows/guides/implicit/add-login-implicit', + 'flows/guides/auth-code/add-login-auth-code' ] }) %> diff --git a/articles/application-auth/current/mobile-desktop.md b/articles/application-auth/current/mobile-desktop.md index 0a1919b135..183b936bb5 100644 --- a/articles/application-auth/current/mobile-desktop.md +++ b/articles/application-auth/current/mobile-desktop.md @@ -38,7 +38,7 @@ If you would like to implement this functionality using either Lock or one of th Auth0 exposes endpoints that you can use to authenticate users and get their authorization. -You can call these endpoints through an embedded browser in your **native** application. After authentication completes, you can return an [ID Token](/tokens/id-token) (which contains information about the identity of the user) and an [Access Token](/tokens/access-token). +You can call these endpoints through an embedded browser in your **native** application. After authentication completes, you can return an [ID Token](/tokens/concepts/id-tokens) (which contains information about the identity of the user) and an [Access Token](/tokens/concepts/access-tokens). ::: note Instead of following this tutorial, you can use any of Auth0's client libraries. They encapsulate all the logic required and make it easier for your to implement authentication. Please refer to our [Native Quickstarts](/quickstart/native) to get started. @@ -46,7 +46,7 @@ Instead of following this tutorial, you can use any of Auth0's client libraries. ## Register your application -If you haven't already created a new [Application](/applications) in Auth0, you'll need to do so before implementing your authentication flow. The Auth0 Application maps to your application and allows your application to use Auth0 for authentication purposes. +If you haven't already created a new [application](/applications) in Auth0, you'll need to do so before implementing your authentication flow. The Auth0 Application maps to your application and allows your application to use Auth0 for authentication purposes. Go to the [Auth0 Dashboard](${manage_url}) and click on [Applications](${manage_url}/#/applications) in the left-hand navigation bar. Click **Create Application**. @@ -83,7 +83,7 @@ Once you've created the `code_verifier` and the `code_challenge`, you'll need to * Authenticating the user; * Redirecting the user to an Identity Provider to handle authentication; -* Checking for active SSO sessions. +* Checking for active Single Sign-on (SSO) [sessions](/sessions). To authorize the user, your application must send the user to the [authorization URL](/api/authentication#authorization-code-grant-pkce-) (which includes the `code_challenge` you generated in the previous step, as well as the method you used to generate the `code_challenge`). Your URL should follow this format: @@ -133,11 +133,32 @@ Using the authorization code obtained in step 2, you can obtain the ID Token by "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"code_verifier\": \"YOUR_GENERATED_CODE_VERIFIER\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"https://${account.namespace}/mobile\" }" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "code_verifier", + "value": "YOUR_GENERATED_CODE_VERIFIER" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "https://${account.namespace}/mobile" + } + ] } } ``` @@ -177,7 +198,7 @@ Once you've decoded the ID Token, you can extract user information from it. The } ``` -For additional details, please see our docs [on the ID Token and its claims](/tokens/id-token#id-token-payload). +For additional details, please see our docs [on the ID Token and its claims](/tokens/id-tokens#id-token-payload). ::: note For a list of libraries you can use to verify and decode tokens refer to [JWT.io](https://jwt.io/#libraries-io). @@ -214,11 +235,32 @@ Using the authorization code, you can obtain the ID Token by making a `POST` cal "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"code_verifier\": \"YOUR_GENERATED_CODE_VERIFIER\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"${account.namespace}/mobile\" }" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "code_verifier", + "value": "YOUR_GENERATED_CODE_VERIFIER" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "https://${account.namespace}/mobile" + } + ] } } ``` @@ -284,11 +326,32 @@ Using the authorization code, you can obtain the ID Token by making a `POST` cal "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"code_verifier\": \"YOUR_GENERATED_CODE_VERIFIER\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"${account.namespace}/mobile\" }" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "code_verifier", + "value": "YOUR_GENERATED_CODE_VERIFIER" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "https://${account.namespace}/mobile" + } + ] } } ``` diff --git a/articles/application-auth/current/server-side-web.md b/articles/application-auth/current/server-side-web.md index caa033a191..026aa3dab9 100644 --- a/articles/application-auth/current/server-side-web.md +++ b/articles/application-auth/current/server-side-web.md @@ -15,13 +15,13 @@ useCase: # Authentication for Server-side Web Apps -You can use the Auth0 Authentication API to create server-side web applications that uses OAuth 2.0 and OpenID Connect to authenticate users and get their authorization to access protected resources. +You can use the Auth0 Authentication API to create server-side web applications that uses OAuth 2.0 and OpenID Connect (OIDC) to authenticate users and get their authorization to access protected resources. ## Overview Auth0 exposes endpoints that you can use to authenticate users and get their authorization. -You can redirect the user from your web application to these endpoints in the web browser. Auth0 will handle the authentication of the user, and then redirect the user back to a pre-configured callback URL, returning an authorization code in the query string parameters of the callback URL. This code can then be exchanged for an [ID Token](/tokens/id-token) (which contains information about the identity of the user) and an [Access Token](/tokens/access-token). +You can redirect the user from your web application to these endpoints in the web browser. Auth0 will handle the authentication of the user, and then redirect the user back to a pre-configured callback URL, returning an authorization code in the query string parameters of the callback URL. This code can then be exchanged for an [ID Token](/tokens/concepts/id-tokens) (which contains information about the identity of the user) and an [Access Token](/tokens/concepts/access-tokens). ## The Authentication Flow @@ -29,12 +29,12 @@ The OAuth 2.0 Authorization Framework allows for different kinds of authorizatio The Authorization Code flow is initiated by redirecting the user in the web browser to the Auth0 `/authorize` endpoint. Auth0 will then display the Auth0 Lock dialog, allowing the user to enter their credentials or alternatively sign in with any other configured [Identity Provider](/identityproviders). -After the user has authenticated, Auth0 will redirect the browser back to the **Redirect URI** (also called **Callback URL**), passing along a `code` parameter in the query string of the Callback URL. This `code` can then be exchanged for an [ID Token](/tokens/id-token) by making a request to the `/oauth/token` endpoint. +After the user has authenticated, Auth0 will redirect the browser back to the **Redirect URI** (also called **Callback URL**), passing along a `code` parameter in the query string of the Callback URL. This `code` can then be exchanged for an [ID Token](/tokens/concepts/id-tokens) by making a request to the `/oauth/token` endpoint. -The ID Token is a [JSON Web Token (JWT)](/jwt) and contains various attributes regarding the user, such as the user's name, email address, profile picture and so on. These attributes are referred to as **Claims** and they can be extracted from the ID Token and used in your application (for example, to display a user's name and profile image). +The ID Token is a [JSON Web Token (JWT)](/tokens/concepts/jwts) and contains various attributes regarding the user, such as the user's name, email address, profile picture and so on. These attributes are referred to as **Claims** and they can be extracted from the ID Token and used in your application (for example, to display a user's name and profile image). ::: note -You will also receive an [Access Token](/tokens/access-token) which you can use to call the [Authentication API's `/userinfo` endpoint](/api/authentication#get-user-info) or your own APIs. For more information on calling APIs web apps running on the server, see [Calling APIs from Server-side Web Apps](/api-auth/grant/authorization-code) +You will also receive an [Access Token](/tokens/concepts/access-tokens) which you can use to call the [Authentication API's `/userinfo` endpoint](/api/authentication#get-user-info) or your own APIs. For more information on calling APIs web apps running on the server, see [Calling APIs from Server-side Web Apps](/api-auth/grant/authorization-code) ::: ![Authentication flow for server-side web apps](/media/articles/client-auth/server-side-web/server-side-web-flow.png) @@ -69,7 +69,7 @@ Save the Settings. ## Call the Authorization URL -The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any SSO session is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. +The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any Single Sign-on (SSO) [session](/sessions) is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. This endpoint supports the following query string parameters: @@ -100,11 +100,32 @@ You application will need to handle the request to this callback URL, extract th "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"client_secret\": \"YOUR_CLIENT_SECRET\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"${account.callback}\"}" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "https://${account.callback}" + } + ] } } ``` @@ -120,7 +141,7 @@ The response from `/oauth/token` contains `access_token`, `expires_in`, `id_toke } ``` -The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/jwt) containing information about the user. You will need to decode the ID Token in order to read the claims (or attributes) of the user. The [JWT section of our website](/jwt) contains more information about the structure of a JWT. +The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/tokens/concepts/jwts) containing information about the user. You will need to decode the ID Token in order to read the claims (or attributes) of the user. The [JWT section of our website](/tokens/concepts/jwts) contains more information about the structure of a JWT. You can refer to the [libraries section on the JWT.io website](https://jwt.io/#libraries-io) in order to obtain a library for your programming language of choice which will assist you in decoding the ID Token. diff --git a/articles/application-auth/legacy/client-side-web.md b/articles/application-auth/legacy/client-side-web.md index 62f658ce92..da677b5d3a 100644 --- a/articles/application-auth/legacy/client-side-web.md +++ b/articles/application-auth/legacy/client-side-web.md @@ -18,7 +18,7 @@ useCase: This document covers an outdated version of the Auth0 authentication pipeline. We recommend you use the current version, using the dropdown. For more on the latest authentication pipeline refer to [Introducing OIDC Conformant Authentication](/api-auth/intro). ::: -The Auth0 OAuth 2.0 authentication endpoints support Client-side Web Applications. These applications are also referred to as JavaScript or Single Page Applications. +The Auth0 OAuth 2.0 authentication endpoints support Client-side Web Applications. These applications are also referred to as JavaScript or Single-Page Applications. ## Overview @@ -30,7 +30,7 @@ The OAuth 2.0 Authorization Framework allows for different kinds of authorizatio The Implicit Grant flow is initiated by redirecting the user in the web browser to the Auth0 `/authorize` endpoint. Auth0 will then display the Auth0 Lock dialog, allowing the user to enter their credentials or alternatively sign in with any other configured [Identity Provider](/identityproviders). -After the user has authenticated, Auth0 will redirect the browser back to the **Redirect URI** (also called **Callback URL**), passing along an `id_token` parameter in the [hash fragment](https://en.wikipedia.org/wiki/Fragment_identifier). The ID Token is a [JSON Web Token (JWT)](/jwt) and contains various attributes - referred to as _Claims_ - regarding the user, such as the user's name, email address, profile picture and so on. +After the user has authenticated, Auth0 will redirect the browser back to the **Redirect URI** (also called **Callback URL**), passing along an `id_token` parameter in the [hash fragment](https://en.wikipedia.org/wiki/Fragment_identifier). The ID Token is a [JSON Web Token (JWT)](/tokens/concepts/jwts) and contains various attributes - referred to as _Claims_ - regarding the user, such as the user's name, email address, profile picture and so on. The ID Token can be decoded to extract the claims and you are free to use these inside of your application, to display a user's name and profile image for example. @@ -47,7 +47,7 @@ The first thing you need to do is to create a new application in Auth0. An Auth0 Navigate to the [Auth0 Dashboard](${manage_url}) and click on the [Applications](${manage_url}/#/applications) menu option on the left. Create a new Application by clicking on the **Create Application** button. -The **Create Application** window will open, allowing you to enter the name of your new application. Choose **Single Page Web Applications** as the **Application Type** and click on the **Create** button to create the new application. +The **Create Application** window will open, allowing you to enter the name of your new application. Choose **Single-Page Web Applications** as the **Application Type** and click on the **Create** button to create the new application. ![](/media/articles/client-auth/client-side-web/create-client.png) @@ -59,7 +59,7 @@ This URL must be part of your application, as your application will need to extr ## Call the Authorization URL -The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any SSO session is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. +The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any Single Sign-on (SSO) [session](/sessions) is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. This endpoint supports the following query string parameters: @@ -85,9 +85,9 @@ After the user has authenticated, Auth0 will call back to the URL specified in t https://YOUR_APP/callback#id_token=eyJ0...&token_type=Bearer ``` -The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/jwt) containing information about the user. You can access the hash fragment using the `window.location.hash` property and then use basic JavaScript string manipulation to access the ID Token. +The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/tokens/concepts/jwts) containing information about the user. You can access the hash fragment using the `window.location.hash` property and then use basic JavaScript string manipulation to access the ID Token. -As mentioned, the ID Token is a JWT and you will need to decode this token in order to read the claims (or attributes) of the user. The [JWT section of our website](/jwt) contains more information about the structure of a JWT. +As mentioned, the ID Token is a JWT and you will need to decode this token in order to read the claims (or attributes) of the user. The [JWT section of our website](/tokens/concepts/jwts) contains more information about the structure of a JWT. Once the JWT is decoded, you can extract the information about the user from the Payload of the ID Token. This is a JSON structure and will contain the claims (attributes) about the user as well as some other metadata. diff --git a/articles/application-auth/legacy/mobile-desktop.md b/articles/application-auth/legacy/mobile-desktop.md index 8bb1f2d43e..04b9497aee 100644 --- a/articles/application-auth/legacy/mobile-desktop.md +++ b/articles/application-auth/legacy/mobile-desktop.md @@ -32,7 +32,7 @@ The OAuth 2.0 Authorization Framework allows for different kinds of authorizatio The Implicit Grant flow is initiated by redirecting the user in an embedded web browser inside of your application to the Auth0 `/authorize` endpoint. Auth0 will then display the Auth0 Lock dialog, allowing the user to enter their credentials or alternatively sign in with any other configured [Identity Provider](/identityproviders). -After the user has authenticated, Auth0 will redirect the browser back to the `redirect_uri` (also known as the **Callback URL**), passing along an `id_token` parameter in the [hash fragment](https://en.wikipedia.org/wiki/Fragment_identifier) or the URL. The ID Token is a [JSON Web Token (JWT)](/jwt) and contains various attributes - referred to as _Claims_ - regarding the user, such as the user's name, email address, profile picture and so on. +After the user has authenticated, Auth0 will redirect the browser back to the `redirect_uri` (also known as the **Callback URL**), passing along an `id_token` parameter in the [hash fragment](https://en.wikipedia.org/wiki/Fragment_identifier) or the URL. The ID Token is a [JSON Web Token (JWT)](/tokens/concepts/jwts) and contains various attributes - referred to as _Claims_ - regarding the user, such as the user's name, email address, profile picture and so on. The ID Token can be decoded to extract the claims and you can use these inside of your application, to display a user's name and profile image for example. @@ -59,7 +59,7 @@ Once the application has been created you can navigate to the **Settings** tab o ## Call the Authorization URL -The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any SSO session is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. +The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any Single Sign-on (SSO) [session](/sessions) is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. This endpoint supports the following query string parameters: @@ -84,9 +84,9 @@ After the user has authenticated, Auth0 will call back to the URL specified in t https://${account.namespace}/mobile#id_token=eyJ0...&token_type=Bearer ``` -The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/jwt) containing information about the user. You can extract both of these values from the URL using basic string manipulation techniques in whatever programming language you are using. +The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/tokens/concepts/jwts) containing information about the user. You can extract both of these values from the URL using basic string manipulation techniques in whatever programming language you are using. -As mentioned, the ID Token is a JWT and you will need to decode this token in order to read the claims (or attributes) of the user. The [JWT section of our website](/jwt) contains more information about the structure of a JWT. +As mentioned, the ID Token is a JWT and you will need to decode this token in order to read the claims (or attributes) of the user. The [JWT section of our website](/tokens/concepts/jwts) contains more information about the structure of a JWT. You can also refer to the [libraries section on the JWT.io website](https://jwt.io/#libraries-io) in order to obtain a library for your programming language of choice which will assist you in decoding the ID Token. diff --git a/articles/application-auth/legacy/server-side-web.md b/articles/application-auth/legacy/server-side-web.md index ad0776d3dc..5cb0b0ac58 100644 --- a/articles/application-auth/legacy/server-side-web.md +++ b/articles/application-auth/legacy/server-side-web.md @@ -6,7 +6,7 @@ topics: - oauth2 - authentication - server-side-apps -contentType: +contentType: - concept - how-to useCase: @@ -32,7 +32,7 @@ The Authorization Code flow is initiated by redirecting the user in the web brow After the user has authenticated, Auth0 will redirect the browser back to the **Redirect URI** (also called **Callback URL**), passing along an `authorization_code` parameter in the query string of the Callback URL. This code can then be exchanged for an ID Token by making a request to the `/oauth/token` endpoint. -The ID Token is a [JSON Web Token (JWT)](/jwt) and contains various attributes - referred to as _Claims_ - regarding the user, such as the user's name, email address, profile picture and so on.. The ID Token can be decoded to extract the claims and you are free to use these inside of your application, to display a user's name and profile image for example. +The ID Token is a [JSON Web Token (JWT)](/tokens/concepts/jwts) and contains various attributes - referred to as _Claims_ - regarding the user, such as the user's name, email address, profile picture and so on.. The ID Token can be decoded to extract the claims and you are free to use these inside of your application, to display a user's name and profile image for example. ![](/media/articles/client-auth/server-side-web/server-side-web-flow.png) @@ -60,7 +60,7 @@ This URL must be part of your application, as your application will need to retr ## Call the Authorization URL -The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any SSO session is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. +The URL used when authenticating a user is `https://${account.namespace}/authorize`. This is the initial endpoint to which a user must be redirected. This will handle checking whether any Single Sign-on (SSO) [session](/sessions) is active, authenticating the user and also potentially redirect the user directly to any Identity Provider to handle authentication. This endpoint supports the following query string parameters: @@ -77,7 +77,7 @@ This endpoint supports the following query string parameters: Be sure to add the **redirect_uri** URL to the list of **Allowed Callback URLs** in the **Settings** tab of your Application inside the [Auth0 Dashboard](${manage_url}). ::: -## Exhange the `access_code` for an ID Token +## Exchange the `access_code` for an ID Token After the user has authenticated, Auth0 will call back to the URL specified in the `redirect_uri` query string parameter which was passed to the `/authorize` endpoint. When calling back to this URL, Auth0 will pass along an `access_token` in the `code` query string parameter of the URL, such as @@ -92,11 +92,32 @@ You application will need to handle the request to this callback URL, extract th "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"client_secret\": \"YOUR_CLIENT_SECRET\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"${account.callback}\"}" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "client_secret", + "value": "YOUR_CLIENT_SECRET" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "https://${account.callback}" + } + ] } } ``` @@ -111,7 +132,7 @@ The response from `/oauth/token` contains an `access_token`, `id_token` and `tok } ``` -The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/jwt) containing information about the user. You will need to decode the ID Token in order to read the claims (or attributes) of the user. The [JWT section of our website](/jwt) contains more information about the structure of a JWT. +The `token_type` will be set to **Bearer** and the `id_token` will be a [JSON Web Token (JWT)](/tokens/concepts/jwts) containing information about the user. You will need to decode the ID Token in order to read the claims (or attributes) of the user. The [JWT section of our website](/tokens/concepts/jwts) contains more information about the structure of a JWT. You can refer to the [libraries section on the JWT.io website](https://jwt.io/#libraries-io) in order to obtain a library for your programming language of choice which will assist you in decoding the ID Token. diff --git a/articles/applications/_configure.md b/articles/applications/_configure.md deleted file mode 100644 index 54f385b1ea..0000000000 --- a/articles/applications/_configure.md +++ /dev/null @@ -1,19 +0,0 @@ -Navigate to the [dashboard](${manage_url}) and click on the [Applications](${manage_url}/#/applications) menu option on the left. Clicking the **+ Create Application** button. - -The *Create Application* window opens. Set a descriptive name for your application and select ${application_type_create}. - -![Create Application window](/media/articles/applications/create-client-popup.png) - -After you set the name and application type, click **Create**. - -A new ${application_type} application will be created and you will be redirected to this application's view that has the four tabs described below. -## Quick Start - -The Quick Start tab shows all the available examples for ${application_type} applications. - -## Addons - -Add-ons are extensions associated with applications. They are typically third-party APIs used by the application(s) for which Auth0 generates Access Tokens. For more details refer to: [Addons](/applications/addons). -## Connections - -Connections are sources of users. They are categorized into Database, Social and Enterprise and can be shared among different applications. For more details refer to: [Connections](/applications/connections). For a detailed list on the supported Identity Providers refer to: [Identity Providers Supported by Auth0](/identityproviders). diff --git a/articles/applications/addons.md b/articles/applications/addons.md deleted file mode 100644 index 4e397c385f..0000000000 --- a/articles/applications/addons.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -description: Explains what Add-ons are and how they are associated with Auth0 Applications. -topics: - - applications - - add-ons -contentType: reference -useCase: - - build-an-app - - integrate-third-party-apps ---- - -# Application Add-ons - -Add-ons are plugins associated with an application in Auth0. Usually, they are third-party APIs used by the application(s) that Auth0 generates Access Tokens for (for example, Salesforce, Azure Service Bus, Azure Mobile Services, SAP and more). - -To view all the available add-ons for an application navigate to [Dashboard > Applications > Addons](${manage_url}/#/applications/${account.clientId}/addons). - -![Application Addons List](/media/articles/applications/addons-dashboard-list.png) - -Some typical scenarios for using add-ons include: - -* **Accessing External APIs**: Using the Delegation endpoint, you can exchange an application's Access Token for a third-party service's (such as Salesforce or Amazon) Access Token. - -* **Integrating with Applications Using SAML2/WS-Federation**: Add-ons allow you to integrate with any custom or SSO integration that does not currently enjoy built-in Auth0 support, since they allow you to configure every aspect of the SAML2/WS-Federation integration. - -![Addons Example Diagram](/media/articles/applications/applications-addon-types.png) diff --git a/articles/applications/application-grant-types.md b/articles/applications/application-grant-types.md deleted file mode 100644 index 9b976bc7fb..0000000000 --- a/articles/applications/application-grant-types.md +++ /dev/null @@ -1,187 +0,0 @@ ---- -description: Using the Grant Types property on Applications -toc: true -topics: - - applications - - grant-types -contentType: - - reference - - concept - - how-to -useCase: - - build-an-app ---- -# Application Grant Types - -Auth0 provides many different authentication and authorization flows to suit your needs. For example, if you are securing a mobile app, you'd use the [Authorization Code using Proof Key for Code Exchange (PKCE) OAuth 2.0 Grant](/api-auth/grant/authorization-code-pkce), or if you're securing a client-side app (such as a mobile app that's *not* native), you'd use the [Implicit Grant](api-auth/grant/implicit). - -However, you might want to limit the use of certain flows (which we'll refer to as "grant types" in this doc) depending on the type of app you're securing. You can set and manage these limitations using the `grant_types` property that each Application has. - -In this doc, we'll talk about: - -* What grant types are -* The grant types available -* How to set the Applications's `grant_type` property -* What grant types are available based on the Applications's `grant_type` property value - -## What Grant Types Are - -OAuth 2.0 is a protocol that allows you to grant limited access to your resources to another entity without exposing credentials. By using Auth0, you can support different OAuth 2.0 flows without worrying about the technical aspects/implementation. - -OAuth 2.0 supports several types of grants, which are methods by which you can gain Access Tokens (string values that represent the permissions granted). Different grant types allow different types of access, and based on the needs of your app, some grant types are more appropriate than others. Auth0 allows you to indicate which sets of permissions are appropriate based on the `grant_type` property. - -::: note -Not sure which grant type is appropriate for your use case? Refer to [Which OAuth 2.0 flow should I use?](/api-auth/which-oauth-flow-to-use) for help. -::: - -## Grant Types Available - -The following is a list of grant types valid for Auth0 Applications. The grant types can be divided into three different categories: - -* Grants that conform with specifications (such as [OpenID Connect](https://openid.net/specs/openid-connect-core-1_0.html)) -* [Auth0 extension grants](https://tools.ietf.org/html/rfc6749#section-4.5) -* Auth0 legacy grants - -The following `grant_types`, are either: - -* OIDC-conformant (that is, their implementation conforms to the [OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html)) -* Auth0 extension grants - -| `grant_type` | More info | -|:-----|:----| -| `implicit` | [Implicit Grant](/api-auth/grant/implicit) | -| `authorization_code` | [Authorization Code Grant](/api-auth/grant/authorization-code) | -| `client_credentials` | [Client Credentials Grant](/api-auth/grant/client-credentials) | -| `password` | [Resource Owner Password Grant](/api-auth/grant/password) | -| `refresh_token` | [Use a Refresh Token](/tokens/refresh-token/current#use-a-refresh-token) | -| `http://auth0.com/oauth/grant-type/password-realm` | [Use an extension grant similar to the Resource Owner Password Grant that includes the ability to indicate a specific realm](/api-auth/grant/password#realm-support) | -| `http://auth0.com/oauth/grant-type/mfa-oob` | [Multi-factor Authentication OOB Grant Request](/api-auth/tutorials/multifactor-resource-owner-password#mfa-oob-grant-request) | -| `http://auth0.com/oauth/grant-type/mfa-otp` | [Multi-factor Authentication OTP Grant Request](/api-auth/tutorials/multifactor-resource-owner-password#mfa-otp-grant-request) | -| `http://auth0.com/oauth/grant-type/mfa-recovery-code` | [Multi-factor Authentication Recovery Grant Request](/api-auth/tutorials/multifactor-resource-owner-password#mfa-recovery-grant-request) | - -The following are legacy grant types: - -* `http://auth0.com/oauth/legacy/grant-type/ro` -* `http://auth0.com/oauth/legacy/grant-type/ro/jwt-bearer` -* `http://auth0.com/oauth/legacy/grant-type/delegation/refresh_token` -* `http://auth0.com/oauth/legacy/grant-type/delegation/id_token` -* `http://auth0.com/oauth/legacy/grant-type/access_token` - -## How to Edit the Application's `grant_types` Property - -You can set the the `grant_types` property for your Auth0 Application using the Management Dashboard. - -::: warning -As of 8 June 2017, new Auth0 customers **cannot** add *any* of the legacy grant types to their Applications. Only customers as of 8 June 2017 can add legacy grant types to their existing Applications. -::: - -Begin by navigating to the [Applications page](${manage_url}/#/applications) of the Management Dashboard. - -![Auth0 Applications](/media/articles/clients/client-grant-types/clients.png) - -Click on the cog icon next to the Application you're interested in to launch its settings page. - -![Auth0 Application Settings](/media/articles/clients/client-grant-types/client-settings.png) - -Scroll down to the bottom of the settings page, and click **Advanced Settings**. - -![Auth0 Application Advanced Settings](/media/articles/clients/client-grant-types/client-advanced-settings.png) - -Switch to the **Grant Types** tab and enable or disable the respective grants for this application. Click **Save Changes**. - -![Auth0 Application Grant Types](/media/articles/clients/client-grant-types/grant-types.png) - -### Use the Management API - -In addition to setting the `grant_types` value using the Dashboard, you can make a [`PATCH` call to the Update an Application endpoint](/api/management/v2#!/Clients/patch_applications_by_id) of the Management API to update the `grant_types` field. - -### Errors - -Attempting to use any flow with a Application lacking the appropriate `grant_types` for that flow (or with the field empty) will result in the following error: - -```text -Grant type `grant_type` not allowed for the client. -``` - -## Information for Existing and New Auth0 Customers - -As of 8 June 2017, all Auth0 Applications have a `grant_types` property that **must** be populated. Here's how Auth0 will handle this change based on whether you're a current customer with an existing Application or a new customer. - -### Existing Applications - -To avoid changes in functionality for current Auth0 customers, we will populate the `grant_types` property for all existing Applications as of 8 June 2017 with **all** Auth0 legacy, Auth0 extension, and specification-conformant grant types. - -### New Applications - -Depending on whether a newly-created Application is [public](/applications/client-types#public-applications) or [confidential](/applications/client-types#confidential-applications), the Application will have varying access to grant types. Trusted first-party applications have access to additional grant types. - -#### Public Applications - -Public Applications, indicated by the `token_endpoint_auth_method` flag set to `none`, are those created in the Dashboard for Native and Single Page Applications. - -::: panel Token Endpoint Authentication Method -The `Token Endpoint Authentication Method` defines how a Application authenticates against the [token endpoint](/api/authentication#authorization-code). Its valid values are: - -* `None`, for a public application without a client secret -* `Post`, for a application using HTTP POST parameters -* `Basic`, for a application using HTTP Basic parameters - -You can find this field at the [Application Settings page](${manage_url}/#/applications/${account.clientId}/settings) of the [Auth0 Dashboard](${manage_url}). -::: - -By default, Public Applications are created with the following `grant_types`: - -* `implicit` -* `authorization_code` -* `refresh_token` - -::: note -Public Applications **cannot** utilize the `client_credentials` grant type. To add this grant type to a Application using the [Management API](/api/management/v2#!/Clients/patch_clients_by_id), set the **token_endpoint_auth_method** to `client_secret_post` or `client_secret_basic`. Either of these will indicate the Application is confidential, not public. -::: - -#### Confidential Applications - -Confidential Applications, indicated by the `token_endpoint_auth_method` flag set to anything *except* `none`, are those created in the Dashboard for Regular Web Applications or Machine to Machine Applications. Additionally, any Application where `token_endpoint_auth_method` is unspecified is confidential. By default, Confidential Applications are created with the following `grant_types`: - -* `implicit`; -* `authorization_code`; -* `refresh_token`; -* `client_credentials`. - -#### Trusted First-Party Applications - -Trusted first-party applications can additionally use the following `grant_types`: - -* `password` -* `http://auth0.com/oauth/grant-type/password-realm` -* `http://auth0.com/oauth/grant-type/mfa-oob` -* `http://auth0.com/oauth/grant-type/mfa-otp` -* `http://auth0.com/oauth/grant-type/mfa-recovery-code` - -::: note -If you are using the [Dashboard](${manage_url}) to enable or disable these grant types, note that all the Password and MFA grant types are enabled when you add the `Password` or `MFA` grant type on your Application. You cannot select these individually. -::: - -## Secure Alternatives to the Legacy Grant Types - -If you're currently using a legacy grant type, refer to the chart below to see which of the secure alternatives you should use instead. - -| Legacy Grant Type | Alternative | -|:-----|:----| -|`http://auth0.com/oauth/legacy/grant-type/ro` | Use the [/oauth/token](/api/authentication#authorization-code) endpoint with a grant type of `password`. See [Resource Owner Password Credentials Exchange](/api-auth/tutorials/adoption/password) and [Executing the Resource Owner Password Grant](/api-auth/tutorials/password-grant) for additional information. | -| `http://auth0.com/oauth/legacy/grant-type/ro/jwt-bearer` | This feature is disabled by default. If you would like this feature enabled, please [contact support](https://support.auth0.com/) to discuss your use case and prevent the possibility of introducing security vulnerabilities. | -| `http://auth0.com/oauth/legacy/grant-type/delegation/refresh_token` | Use the `oauth/token` endpoint to obtain Refresh Tokens. See [OIDC-conformant Refresh Tokens](/api-auth/tutorials/adoption/refresh-tokens) for more info. | -| `http://auth0.com/oauth/legacy/grant-type/delegation/id_token` | This feature is disabled by default. If you would like this feature enabled, please [contact support](https://support.auth0.com/) to discuss your use case and prevent the possibility of introducing security vulnerabilities. | -| `http://auth0.com/oauth/legacy/grant-type/access_token` | Use browser-based social authentication. | - -::: note -Those implementing Passwordless Authentication should use [Universal Login](/hosted-pages/login) instead of the `oauth/ro` endpoint. -::: - -## Enable a Legacy Grant Type - -::: warning -As of 8 June 2017, new Auth0 customers cannot add any of the legacy grant types to their applications. Legacy grant types are only available for previous customers while they migrate to new flows, to avoid breaking changes. To find the secure alternative for your case refer to [Secure Alternatives to the Legacy Grant Types](#secure-alternatives-to-the-legacy-grant-types). -::: - -To enable a legacy grant type, you will need to update the `grant_types` property for you Application appropriately. For details on how to do so, refer to [Edit the grant_types Property](#edit-available-grant_types). diff --git a/articles/applications/application-settings/_adv-settings-mobile.md b/articles/applications/application-settings/_adv-settings-mobile.md index 4939237bc1..fb14954545 100644 --- a/articles/applications/application-settings/_adv-settings-mobile.md +++ b/articles/applications/application-settings/_adv-settings-mobile.md @@ -1,8 +1,8 @@ -#### Mobile Settings +#### Device Settings If you're developing a mobile application, you can provide the necessary iOS/Android parameters here. When developing iOS apps, you'll provide your **Team ID** and **App Bundle Identifier**. -When developing Android apps, you'll provide your **App Package Name** and your **Key Hashes**. \ No newline at end of file +When developing Android apps, you'll provide your **App Package Name** and your **Key Hashes**. diff --git a/articles/applications/application-settings/_adv-settings.md b/articles/applications/application-settings/_adv-settings.md index cef87c4c61..f86aa43c4a 100644 --- a/articles/applications/application-settings/_adv-settings.md +++ b/articles/applications/application-settings/_adv-settings.md @@ -18,7 +18,7 @@ You can create up to 10 sets of metadata. Set the OAuth-related settings on this tab: -* By default, all apps/APIs can make a delegation request, but if you want to explicitly grant permissions to selected apps/APIs, you can do so in **Allowed APPs/APIs**. +* By default, all apps/APIs can make a delegation request, but if you want to explicitly grant permissions to selected apps/APIs, you can do so in **Allowed Apps/APIs**. * Set the algorithm used (**HS256** or **RS256**) for signing your JSON Web Tokens. diff --git a/articles/applications/application-settings/_settings-pt2.md b/articles/applications/application-settings/_settings-pt2.md index 9e256688dd..cbd497d7b3 100644 --- a/articles/applications/application-settings/_settings-pt2.md +++ b/articles/applications/application-settings/_settings-pt2.md @@ -10,8 +10,8 @@ You can provide up to 100 URLs in the **Allowed Callback URLs**, **Allowed Web O - **Allowed Origins (CORS)**: Set of URLs that will be allowed to make requests from JavaScript to Auth0 API (typically used with CORS). This prevents same-origin policy errors when using Auth0 from within a web browser. By default, all your callback URLs will be allowed. This field allows you to enter other origins if you need to. You can specify multiple valid URLs by comma-separating them. For production environments, verify that the URLs do not point to localhost. You can use the star symbol as a wildcard for subdomains (`*.google.com`). Notice that paths, querystrings and hash information are not taken into account when validating these URLs (and may, in fact, cause the match to fail). -- **JWT Expiration (seconds)**: The amount of time (in seconds) before the Auth0 ID Token expires. The default value is `36000`, which maps to 10 hours. +- **ID Token Expiration (seconds)**: The amount of time (in seconds) before the Auth0 ID Token expires. The default value is `36000` seconds which is 10 hours. -- **Use Auth0 instead of the IdP to do Single Sign On**: If enabled, this setting prevents Auth0 from redirecting authenticated users with valid sessions to the identity provider (such as Facebook, ADFS, and so on). +- **Use Auth0 instead of the IdP to do Single Sign-on**: If enabled, this setting prevents Auth0 from redirecting authenticated users with valid [sessions](/sessions) to the identity provider (such as Facebook, ADFS, and so on). **Legacy tenants only.** ![Application Settings Page](/media/articles/applications/settings.png) diff --git a/articles/applications/application-types.md b/articles/applications/application-types.md deleted file mode 100644 index 8f60a4550a..0000000000 --- a/articles/applications/application-types.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Application Types -description: Read about the the different applications types - public vs confidential, and first vs third-party -toc: true -topics: - - applications - - application-types -contentType: reference -useCase: - - build-an-app ---- -# Application Types - -<%= include('../_includes/_pipeline2') %> - -When working with Auth0 applications, which are used to represent your applications, there are several terms you should know in terms of how applications are classified: - -* [Confidential vs public](#confidential-vs-public-applications) -* [First vs third-party](#first-vs-third-party-applications) - -## Confidential vs public applications - -The OAuth 2.0 specification [defines two types of applications](https://tools.ietf.org/html/rfc6749#section-2.1): public and confidential. - -When creating an application through the [Dashboard](${manage_url}/#/applications), Auth0 will ask you what type of application you want the application to represent and use that information to determine the application type. - -### Check your application type - -You can use the Management API's [Get a Client endpoint](/api/management/v2#!/Clients/get_clients_by_id) to check your existing Application's type. If the application is first party, the `is_first_party` equals `true`, else `false`. Be sure to replace `CLIENT_ID` with the ID of your application. - -```har -{ - "method": "GET", - "url": "https://${account.namespace}/api/v2/clients/CLIENT_ID?fields=is_first_party&include_fields=true", - "headers": [{ - "name": "Authorization", - "value": "Bearer MGMT_API_ACCESS_TOKEN" - }] -} -``` - -::: note -See [How to Get an Access Token for the Management API](/api/management/v2/tokens) for instructions on obtaining the Access Token required to call the Management API. -::: - -### Confidential applications - -Confidential applications are able to hold credentials (such as a client ID and secret) in a secure way without exposing them to unauthorized parties. This means that you will need a trusted backend server to store the secret(s). - -The following application types use confidential applications: - -* A web application with a secure backend using the [Authorization Code grant](/api-auth/grant/authorization-code), [Password](/api-auth/grant/password) or [Password Realm](/api-auth/tutorials/password-grant#realm-support) grants -* A machine to machine application using the [Client Credentials grant](/api-auth/grant/client-credentials) - -All of these grants require applications to authenticate by specifying their client ID and secret when calling the token endpoint. - -Since confidential applications are capable of holding secrets, you can choose to have ID Tokens issued to them that have been signed in one of two ways: - -* Symmetrically using their client secret (`HS256`) -* Asymmetrically using a private key (`RS256`) - -### Public applications - -Public applications **cannot** hold credentials securely. The following application types use public applications: - -* Native desktop or mobile applications using the [Authorization Code grant with PKCE](/api-auth/grant/authorization-code-pkce) -* JavaScript-based client-side web applications (such as single-page apps) using the [Implicit](/api-auth/grant/implicit) grant - -Since public applications are unable to hold secrets, [ID Tokens](/tokens/id-token) issued to them must be: - -* Signed asymmetrically using a private key (`RS256`) -* Verified using the public key corresponding to the private key used to sign the token - -## First vs third-party applications - -First-party and third-party refer to the ownership of the application. This has implications in terms of who has administrative access to your Auth0 domain. - -### First-party applications - -First-party applications are those controlled by the same organization or person who owns the Auth0 domain. For example, if you wanted to access the Contoso API, you'd use a first-party applications to log into `contoso.com`. - -All applications created via the [Dashboard](${manage_url}/#/applications) are first-party by default. - -### Third-party applications - -Third-party applications are controlled by someone who most likely should *not* have administrative access to your Auth0 domain. Third-party applications enable external parties or partners to access protected resources behind your API securely. For example, if you were to create a developer center that allows users to obtain credentials to integrate their apps with your API (this functionality is similar to those provided by well-known APIs such as Facebook, Twitter, and GitHub), you would use a third-party applications. - -Third-party applications must be created through the [Management API](/api/management/v2#!/Clients/post_clients) by setting `is_first_party` to `false`. - -Third party applications have the following characteristics: - -- They cannot skip user consent when consuming APIs. This is for security purposes, as anyone can create an applications, but each applications relies on the final user to provide consent. -- The [ID Tokens](/tokens/id-token) generated for these applications, hold minimum user profile information. -- They can use only tenant level connections (domain connections). These are sources of users, configured in the tenant's [dashboard](${manage_url}) as connections. These connections are enabled for every third party applications and can be also enabled for selected first party (standard) applications. -- To authenticate users using [Lock](/libraries/lock), you will have to use a version greater than `10.7`. - - [PSaaS Appliance](/appliance) users must use `https://{config.auth0Domain}/` as the value for [the `configurationBaseUrl` option](https://github.com/auth0/lock#other-options). -- They cannot use [ID Tokens](/tokens/id-token) to invoke [Management APIv2](/api/management/v2) endpoints. Instead, they should get a Management APIv2 Token (see the *How to get a Management APIv2 Token* panel for details). Note that the applications should be granted the `current_user_*` scopes, as required by each endpoint. - - `read:current_user`: [List or search users](/api/management/v2#!/Users/get_users), [Get a user](/api/management/v2#!/Users/get_users_by_id), [Get user Guardian enrollments](/api/management/v2#!/Users/get_enrollments) - - `update:current_user_metadata`: [Update a user](/api/management/v2#!/Users/patch_users_by_id), [Delete a user's multi-factor provider](/api/management/v2#!/Users/delete_multifactor_by_provider) - - `create:current_user_device_credentials`: [Create a device public key](/api/management/v2#!/Device_Credentials/post_device_credentials) - - `delete:current_user_device_credentials`: [Delete a device credential](/api/management/v2#!/Device_Credentials/delete_device_credentials_by_id) - - `update:current_user_identities`: [Link a user account](/api/management/v2#!/Users/post_identities), [Unlink a user identity](/api/management/v2#!/Users/delete_provider_by_user_id) - -::: panel How to get a Management APIv2 Token -In order to access the [Management APIv2](/api/management/v2) endpoints from a third party applications, you need a Management APIv2 Token. To get one you can use any of the [API Authorization Flows](/api-auth), with the following request parameters: -- `audience=https://${account.namespace}/api/v2/` -- `scope=read:current_user update:current_user_metadata` -::: diff --git a/articles/applications/concepts/app-types-confidential-public.md b/articles/applications/concepts/app-types-confidential-public.md new file mode 100644 index 0000000000..8a5e97d787 --- /dev/null +++ b/articles/applications/concepts/app-types-confidential-public.md @@ -0,0 +1,63 @@ +--- +description: Understand the difference between confidential and public application types. +toc: true +topics: + - applications + - application-types +contentType: concept +useCase: + - build-an-app +--- +# Confidential and Public Applications + +According to the [OAuth 2.0 spec](https://tools.ietf.org/html/rfc6749#section-2.1), applications can be classified as either confidential or public. The main difference relates to whether or not the application is able to hold credentials (such as a client ID and secret) securely. + +When you create an application using the Dashboard, Auth0 will ask you what [Auth0 application type](/applications) you want to assign to the new application and use that information to determine whether the application is confidential or public. + +To check whether your application is confidential or public, see [View Application Type: Confidential or Public](/dashboard/guides/applications/view-app-type-confidential-public). + +## Confidential applications + +Confidential applications can hold credentials in a secure way without exposing them to unauthorized parties. They require a trusted backend server to store the secret(s). + +### Grant types + +Because they use a trusted backend server, confidential applications can use grant types that require them to authenticate by specifying their client ID and secret when calling the token endpoint. + +The following are considered to be confidential applications: + +* A web application with a secure backend that uses the [Authorization Code Flow](/flows/concepts/auth-code), [Password grant](/api-auth/grant/password), or [Password grant with Realm support](/api-auth/tutorials/password-grant#realm-support) +* A machine-to-machine (M2M) application that uses the [Client Credentials Flow](/flows/concepts/client-credentials) + +### ID Tokens + +Because confidential applications are capable of holding secrets, you can have ID Tokens issued to them that have been signed in one of two ways: + +* Symmetrically, using their client secret (`HS256`) +* Asymmetrically, using a private key (`RS256`) + +## Public applications + +Public applications **cannot** hold credentials securely. + +### Grant types + +Public applications can only use grant types that do not require the use of their client secret. + +The following are public applications: + +* A native desktop or mobile application that uses the [Authorization Code Flow with PKCE](/flows/concepts/auth-code-pkce) +* A JavaScript-based client-side web application (such as a single-page app) that uses the [Implicit Flow](/flows/concepts/implicit) grant + +### ID Tokens + +Because public applications are unable to hold secrets, [ID Tokens](/tokens/concepts/id-tokens) issued to them must be: + +* Signed asymmetrically using a private key (`RS256`) +* Verified using the public key corresponding to the private key used to sign the token + +## Keep reading + +* [View Application Type](/dashboard/guides/applications/view-app-type-confidential-public) +* [First-Party and Third-Party Applications](/applications/concepts/app-types-first-third-party) +* [Auth0 Grant Types Mapping](/applications/reference/grant-types-auth0-mapping) diff --git a/articles/applications/concepts/app-types-first-third-party.md b/articles/applications/concepts/app-types-first-third-party.md new file mode 100644 index 0000000000..1412c22625 --- /dev/null +++ b/articles/applications/concepts/app-types-first-third-party.md @@ -0,0 +1,43 @@ +--- +description: Understand the difference between confidential and public application types. +topics: + - applications + - application-types +contentType: concept +useCase: + - build-an-app +--- +# First-Party and Third-Party Applications + +Applications can be classified as either first-party or third-party, which refers to the ownership of the application. The main difference relates to who has administrative access to your Auth0 domain. + +## First-party applications + +First-party applications are those controlled by the same organization or person who owns the Auth0 domain. For example, let's say you created both a Contoso API and an application that logs into `contoso.com` and consumes the Contoso API. You would register both the API and application under the same Auth0 domain, and the application would be a first-party application. By default, all applications created via the [Auth0 Dashboard](${manage_url}/#/applications) are first-party applications. + +## Third-party applications + +Third-party applications are controlled by someone who most likely should *not* have administrative access to your Auth0 domain. Third-party applications enable external parties or partners to securely access protected resources behind your API. An example of this is with Facebook, let's say you created an application to get a client ID and secret to integrate with your service. That application is considered third-party because it is not owned by Facebook but a third-party that wants to integrate with Facebook APIs and services. + +::: note +All applications created through [Dynamic Client Registration](/api-auth/dynamic-client-registration) will be third-party. + +Third-party applications cannot be created using the Dashboard, but must be created through the [Auth0 Management API](/api/management/v2#!/Clients/post_clients) by setting `is_first_party` to `false`. +::: + +Third-party applications have the following unique characteristics: + +- **User Consent**: You must require user consent when consuming APIs because anyone can create an application. Requiring the user to provide consent improves security. + +- **ID Tokens**: [ID Tokens](/tokens/concepts/id-tokens) generated for third-party applications hold only minimum user profile information. + +- **Connections**: You can only use tenant-level connections or *domain connections*. For more informations, see [Enable Third-party Applications](/applications/guides/enable-third-party-apps). + +## Keep reading + +* [View Application Ownership](/api/management/guides/applications/view-ownership) +* [Applications](/applications) +* [Confidential and Public Applications](/applications/concepts/app-types-confidential-public) +* [Auth0 Grant Types Mapping](/applications/reference/grant-types-auth0-mapping) +* [User consent and third-party applications](/api-auth/user-consent) + \ No newline at end of file diff --git a/articles/applications/concepts/application-grant-types.md b/articles/applications/concepts/application-grant-types.md new file mode 100644 index 0000000000..76ced1103e --- /dev/null +++ b/articles/applications/concepts/application-grant-types.md @@ -0,0 +1,32 @@ +--- +title: Application Grant Types +description: Learn about the concept of grant types and how they relate to applications. +topics: + - applications + - grant-types +contentType: + - concept +useCase: + - build-an-app +--- +# Application Grant Types + +Application grant types (or _flows_) are methods through which applications can gain [Access Tokens](/tokens/concepts/access-tokens) and by which you grant limited access to your resources to another entity without exposing credentials. The [OAuth 2.0 protocol](/protocols/oauth2) supports several types of grants, which allow different types of access. + +Based on the needs of your application, some grant types are more appropriate than others. Auth0 provides many different authentication and authorization flows and allows you to indicate which grant types are appropriate based on the `grant_types` property of your Auth0-registered Application. + +For example, let's say you are securing a mobile app. In this case, you'd use the [Authorization Code using Proof Key for Code Exchange (PKCE) Grant](/flows/concepts/auth-code-pkce). + +Alternatively, if you were securing a client-side app (such as a single-page app), you'd use the [Implicit Grant](/flows/concepts/implicit). + +::: note +Not sure which grant type is appropriate for your use case? Refer to [Which OAuth 2.0 flow should I use?](/api-auth/which-oauth-flow-to-use) for help. +::: + +## Keep Reading + +* [Available Grant Types](/applications/reference/grant-types-available) +* [Auth0 Grant Types Mapping](/applications/reference/grant-types-auth0-mapping) +* [Update Grant Types Using the Dashboard](/dashboard/guides/applications/update-grant-types) +* [Update Grant Types Using the Management API](/api/management/guides/applications/update-grant-types) +* [Legacy Grant Types](/applications/concepts/grant-types-legacy) diff --git a/articles/applications/concepts/client-secret.md b/articles/applications/concepts/client-secret.md new file mode 100644 index 0000000000..3c97f7efa3 --- /dev/null +++ b/articles/applications/concepts/client-secret.md @@ -0,0 +1,17 @@ +--- +title: Client Secret +description: Learn about client secrets. +topics: + - applications + - client-secrets +contentType: + - concept +useCase: + - build-an-app +--- + +# Client Secret + +A client secret is a secret known only to your application and the authorization server. It protects your resources by only granting [tokens](/tokens) to authorized requestors. + +Protect your client secrets and never include them in mobile or browser-based apps. If your client secret is ever compromised, you should [rotate to a new one](/dashboard/guides/applications/rotate-client-secret) and update all authorized apps with the new client secret. \ No newline at end of file diff --git a/articles/applications/concepts/grant-types-legacy.md b/articles/applications/concepts/grant-types-legacy.md new file mode 100644 index 0000000000..795ad11152 --- /dev/null +++ b/articles/applications/concepts/grant-types-legacy.md @@ -0,0 +1,36 @@ +--- +title: Legacy Grant Types +description: Learn about legacy grant types and more secure alternatives. +topics: + - applications + - client-secrets +contentType: concept +useCase: + - build-an-app +--- + +# Legacy Grant Types + +Legacy grant types are traditional grant types supported for legacy customers only. If you are a legacy customer, we highly recommend moving to a more secure alternative. + +::: warning +As of 8 June 2017, all Auth0 Applications were given a `grant_types` property that **must** be populated. To avoid changes in functionality for Auth0 customers at that time, we populated the `grant_types` property for all existing Applications with **all** Auth0 legacy, Auth0 extension, and specification-conforming grant types. + +At this time, new Auth0 customers were no longer able to add legacy grant types to their applications. Legacy grant types are only available for previous customers while they migrate to new flows, to avoid breaking changes. If you were a customer prior to 8 June 2017, you can [use the Dashboard](/dashboard/guides/applications/update-grant-types) or [use the Management API](/api/management/guides/applications/update-grant-types) to enable a legacy grant type. +::: + +## Secure Alternatives + +If you're currently using a legacy grant type, refer to the chart below to see which of the secure alternatives you should use instead. + +| Legacy Grant Type | Alternative | +|:-----|:----| +|`http://auth0.com/oauth/legacy/grant-type/ro` | Use the [/oauth/token](/api/authentication#authorization-code) endpoint with a grant type of `password`. See [Resource Owner Password Credentials Exchange](/api-auth/tutorials/adoption/password) and [Executing the Resource Owner Password Grant](/api-auth/tutorials/password-grant) for additional information. | +| `http://auth0.com/oauth/legacy/grant-type/ro/jwt-bearer` | This feature is disabled by default. If you would like this feature enabled, please [contact support](https://support.auth0.com/) to discuss your use case and prevent the possibility of introducing security vulnerabilities. | +| `http://auth0.com/oauth/legacy/grant-type/delegation/refresh_token` | Use the `oauth/token` endpoint to obtain Refresh Tokens. See [OIDC-conformant Refresh Tokens](/api-auth/tutorials/adoption/refresh-tokens) for more info. | +| `http://auth0.com/oauth/legacy/grant-type/delegation/id_token` | This feature is disabled by default. If you would like this feature enabled, please [contact support](https://support.auth0.com/) to discuss your use case and prevent the possibility of introducing security vulnerabilities. | +| `http://auth0.com/oauth/legacy/grant-type/access_token` | Use browser-based social authentication. | + +::: note +Those implementing Passwordless Authentication should use [Universal Login](/universal-login) instead of the `oauth/ro` endpoint. +::: diff --git a/articles/applications/connections.md b/articles/applications/connections.md deleted file mode 100644 index 9067673aad..0000000000 --- a/articles/applications/connections.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -description: Explains what Connections are and how they are associated with Auth0 Applications. -crews: crew-2 -topics: - - applications - - connections -contentType: concept -useCase: - - build-an-app - - customize-connections ---- -# Application Connections - -Connections are sources of users. They are categorized into Database, Social, Enterprise and Passwordless and can be shared among different applications. - -You can configure any number of connections for your applications to use in your Dashboard. To view all the connections that you have configured or create new ones navigate to [Dashboard](${manage_url}/#/) and select the connection type you want: -- [Database](${manage_url}/#/connections/database) -- [Social](${manage_url}/#/connections/social) -- [Enterprise](${manage_url}/#/connections/enterprise) -- [Passwordless](${manage_url}/#/connections/passwordless) - -For more details on the connections you can configure refer to: [Identity Providers Supported by Auth0](/identityproviders). - -## Example multi-tenant configuration - -If you have two separate domains (for example, public facing and internal), or two groups of connections you'd like to allow users, the best solution is to create a second Auth0 tenant via the settings menu in the top right on the [Dashboard](${manage_url}). This will allow you to have separate sets of users, applications, and connections for the two groups of users and applications you need to support. - -Let's suppose that you have two applications: an internal timesheets application and a customer portal. Users should login to the timesheets application either using their Active Directory credentials or their Google apps social connection. The customer portal on the other hand should be accessible via Facebook, Google, or LinkedIn authentication. - -You can configure this in Auth0 as follows: - -- Create a tenant `Fabrikam-Internal` for your internal domain, and an application within it `Fabrikam Employee Timesheets` for timesheets. -- Create a second tenant `Fabrikam-Public` for your public-facing domain, and an application within it `Fabrikam Customer Portal` for the customer portal. -- Configure the following [Enterprise connections](${manage_url}/#/connections/enterprise) for the `Fabrikam-Internal` tenant: Active Directory / LDAP, and Google Apps; once each is set up, check the **Applications** tab to enable them. -- Configure the following [Enterprise connection](${manage_url}/#/connections/enterprise) for the `Fabrikam-Public` tenant: Google Apps; once it is set up, check the **Applications** tab to enable it. -- Configure the following [Social connections](${manage_url}/#/connections/social) for the `Fabrikam-Public` tenant: Facebook, LinkedIn; once each is set up, check the **Applications** tab to enable it. diff --git a/articles/applications/enable-android-app-links.md b/articles/applications/enable-android-app-links.md deleted file mode 100644 index 5557a48ad7..0000000000 --- a/articles/applications/enable-android-app-links.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -description: How to enable Android App Links support for your Auth0 application -topics: - - applications - - android - - app-links -contentType: how-to -useCase: - - build-an-app - - enable-mobile-auth ---- - -# Enable Android App Links Support for your Auth0 Application - -The following document outlines how to configure [Android App Links](https://developer.android.com/training/app-links/index.html) for your Auth0 application. - -Android App Links allow an application to designate itself as the default handler of a given type of link. For example, clicking a URL in an email would open the link in the designated application. - -## Provide Your App's Package Name and Certificate Fingerprint - -You can establish the app link with Auth0 using [Applications](${manage_url}/#/applications) page of the [Auth0 Dashboard](${manage_url}). - -Select the Application you want to link with your Android application. You will see the **Settings** page for the Application. - -![](/media/articles/applications/settings.png) - -Scroll to the bottom of the **Settings** page and click **Show Advanced Settings.** - -![](/media/articles/applications/advanced-settings.png) - -Select the **Mobile Settings** tab, then provide the [App Package Name](https://developer.android.com/studio/build/application-id.html) and the SHA256 fingerprints of your app’s signing certificate for your Android application. - -You can generate the fingerprint using the Java keytool in your terminal: - -```bash -keytool -list -v -keystore my-release-key.keystore -``` - -::: note -For more information on signing certificates, check out the [Sign Your App](https://developer.android.com/studio/publish/app-signing.html) page of the Android developer documentation. -::: - -![](/media/articles/applications/mobile-settings.png) - -Click **Save Changes** when done. - -## Test Your App Link - -You can test your app link by navigating to the following URL using your browser: - -`https://${account.namespace}/.well-known/assetlinks.json` - -If the link is successful, you will return the following JSON (formatted for readability): - -```json -[{ - "relation": ["delegate_permission/common.handle_all_urls"], - "target": { - "namespace": "android_app", - "package_name": "com.mycompany.app1", - "sha256_cert_fingerprints": - ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"] - } -}] -``` - -::: note -See [Verify Android App Links](https://developer.android.com/training/app-links/verify-site-associations.html#testing) for further information on testing your app link. -::: diff --git a/articles/applications/enable-universal-links.md b/articles/applications/enable-universal-links.md deleted file mode 100644 index 1387ead7bf..0000000000 --- a/articles/applications/enable-universal-links.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -description: How to enable Universal Links support for your Auth0 app in Xcode -topics: - - applications - - ios - - universal-links -contentType: how-to -useCase: - - build-an-app - - enable-mobile-auth ---- - -# Enable Universal Links Support for your Auth0 Application in Xcode - -Because universal links establish a *verified relationship between domains and applications*, both your Auth0 Application settings and your iOS application need to be in sync. To do this, you need to provide Auth0 with the following information: - -* `Team ID`; -* `Bundle identifier`. - -## Find Your Apple `Team ID` and `Bundle Identifier` - -To find your Apple `Team ID`, go to your [Apple developer account summary page](https://developer.apple.com/membercenter/index.action#accountSummary). - -To find your iOS application's `Bundle identifier`, go to its [Xcode project settings](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html) page: - -![](/media/articles/applications/bundle-id.png) - -## Provide Your Apple `Team ID` and `Bundle Identifier` to Auth0 - -You can establish the universal link from the Auth0 side using [Applications](${manage_url}/#/clients) page of the [Management Dashboard](${manage_url}). - -Select the Application you want to link with your iOS application. You will see the *Settings* page for the Application. - -![](/media/articles/applications/settings.png) - -Scroll to the bottom of the *Settings* page and click *Show Advanced Settings.* - -![](/media/articles/applications/advanced-settings.png) - -Select the *Mobile Settings* tab and provide the **Team ID** and the **App bundler identifier** values for your iOS application. - -![](/media/articles/applications/mobile-settings.png) - -Click **Save Changes** when done. - -## Test Your Universal Link - -To test this, check whether the universal links apple app site association file is available for your application. Go to your browser and open: https://YOURACCOUNT.auth0.com/apple-app-site-association (replace YOURACCOUNT with your Auth0 account name). - -You can test your universal link by navigating to the following URL using your browser: - -`${account.namespace}/apple-app-site-association` - -If the link is successful, you will return the following JSON (formatted for readability): - -```json -{ - "applinks": { - "apps": [], - "details": [{ - "appID": "86WQXF56BC.com.auth0.Passwordless-Email", - "paths": ["/ios/com.auth0.Passwordless-Email/*"] - }] - } -} -``` diff --git a/articles/applications/guides/enable-third-party-apps.md b/articles/applications/guides/enable-third-party-apps.md new file mode 100644 index 0000000000..bcd3c1712c --- /dev/null +++ b/articles/applications/guides/enable-third-party-apps.md @@ -0,0 +1,91 @@ +--- +title: Enable Third-Party Applications +description: Learn how to enable third-party applications for your tenant. +topics: + - applications + - application-types + - third-party-applications +contentType: + - how-to +useCase: + - build-an-app +--- +# Enable Third-Party Applications + +You can enable third-party applications for your tenant. See [First-Party and Third-Party Applications](/applications/concepts/app-types-first-third-party) for details on the differences between the two types of applications. + +1. [Update your application's ownership to third-party](/api/management/guides/applications/update-ownership) in Auth0. + + By default, applications registered in Auth0 are first-party applications. If you want your application to be a third-party application, you must update its ownership. + +2. [Promote the connections you will use with third-party applications to domain level](/api/management/guides/connections/promote-connection-domain-level) in Auth0. + + Third-party applications can only authenticate users from [connections](/connections) flagged as domain-level connections. Domain-level connections can be enabled for selected first-party applications while also being open to all third-party application users for authentication. + +3. Update your application's login page. If you use [Lock](/libraries/lock/v11) in the [Universal Login Page](/universal-login/classic), you must also: + + - Upgrade to Lock version 11 or later + - Set the `__useTenantInfo: config.isThirdPartyClient` flag when instantiating Lock + - *For [Private Cloud](/private-cloud) users only*: Set the [`configurationBaseUrl` option](https://auth0.com/docs/libraries/lock/v11/configuration#configurationbaseurl-string-) to `https://{config.auth0Domain}/` when instantiating Lock + +## Access Token `current_user_*` scopes + +Neither first- nor third-party applications can use [ID Tokens](/tokens/concepts/id-tokens) to invoke [Management API](/api/management/v2) endpoints. Instead, they should get [Access Tokens](/api/management/v2/tokens) with the following `current_user_*` scopes required by each endpoint: + +| Scope | Endpoint | +| - | - | +| `read:current_user` | [List or search users](/api/management/v2#!/Users/get_users) | +| | [Get a user](/api/management/v2#!/Users/get_users_by_id) | +| | [Get user MFA enrollments](/api/management/v2#!/Users/get_enrollments) | +| `update:current_user_metadata` | [Update a user](/api/management/v2#!/Users/patch_users_by_id) | +| | [Delete a user's multi-factor provider](/api/management/v2#!/Users/delete_multifactor_by_provider) | +| `create:current_user_device_credentials` | [Create a device public key](/api/management/v2#!/Device_Credentials/post_device_credentials) | +| `delete:current_user_device_credentials` | [Delete a device credential](/api/management/v2#!/Device_Credentials/delete_device_credentials_by_id) | +| `update:current_user_identities` | [Link a user account](/api/management/v2#!/Users/post_identities) | +| | [Unlink a user identity](/api/management/v2#!/Users/delete_user_identity_by_user_id) | + +## Sample script + +```html + +... + +``` + +## Keep reading +* [View Application Ownership](/api/management/guides/applications/view-ownership) +* [Applications](/applications) +* [Confidential and Public Applications](/applications/concepts/app-types-confidential-public) +* [Auth0 Grant Types Mapping](/applications/reference/grant-types-auth0-mapping) +* [User consent and third-party applications](/api-auth/user-consent) diff --git a/articles/applications/how-to-rotate-client-secret.md b/articles/applications/how-to-rotate-client-secret.md deleted file mode 100644 index 33db73aa19..0000000000 --- a/articles/applications/how-to-rotate-client-secret.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -description: This page lists different ways of how to update your application's secret. -crews: crew-2 -topics: - - applications - - client-secrets -contentType: how-to -useCase: - - build-an-app ---- - -# Rotate the Client Secret - -The client secret protects your resources by only granting tokens to requestors if they're authorized. Protect your client secrets; if any are ever compromised, you should rotate to a new one. Please remember that all authorized apps will therefore need to be updated with the new client secret. - -## Rotate the Client Secret in the Dashboard - -You can rotate your client secret under [Applications in the Dashboard](${manage_url}/#/applications). Choose the application you wish to edit by clicking on its name *or* the **Settings** gear icon associated with the application. - -![](/media/articles/clients/change-client-secret/clients.png) - -On the **Settings** page, the **Client Secret** will be the fourth parameter listed. To the right, click on the **rotation** icon to rotate your secret. You can view you your new secret by checking the box next to **Reveal client secret**. - -Scroll to the bottom of the Settings page, and click **Save Changes**. - -![](/media/articles/clients/change-client-secret/client-settings.png) - -## Rotate the Client Secret Using the Management API - -You can rotate your application's secret by making a `POST` call to the [Rotate a Client Secret endpoint](/api/management/v2#!/Clients/post_rotate_secret) of the Management API. The global client secret can also be rotated via the Management API. Your global client ID can be found in your [Advanced Tenant Settings](${manage_url}/#/tenant/advanced). - -Be sure to replace `YOUR_CLIENT_ID` and `MGMT_API_ACCESS_TOKEN` placeholder values with your client ID and Access Token, respectively. - -::: note -To make calls to the Management API, you must [get and use a valid Access Token](/api/management/v2/tokens). -::: - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/api/v2/clients/YOUR_CLIENT_ID/rotate-secret", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [{ - "name": "Authorization", - "value": "Bearer MGMT_API_ACCESS_TOKEN" - }], - "queryString": [], - "postData": {}, - "headersSize": -1, - "bodySize": -1, - "comment": "" -} -``` - -## Update Authorized Applications - -Once you've rotated your client secret, you must update any authorized applications with the new value. - -To make sure that you see as little downtime as possible when connecting your apps to your Auth0 application, we suggest you store the new client secret as a fallback to the previous secret. Then, if the connection doesn't work with the old secret, your app will use the new secret. - -Secrets can be stored in a list (or similar structure) to track keys until they're no longer needed. Once you're sure that an old secret is obsolete, you can remove its value from your app. diff --git a/articles/applications/index.md b/articles/applications/index.md index 8041379225..2f3bf9a89a 100644 --- a/articles/applications/index.md +++ b/articles/applications/index.md @@ -1,78 +1,52 @@ --- -description: Explains the basics of creating and using Auth0 Applications. -toc: true +description: Understand the basics of creating and using Auth0 Applications. topics: - applications contentType: - - index - - reference - - how-to - concept useCase: - build-an-app --- -# Applications +# Applications in Auth0 -An Auth0 **Application** represents your application in Auth0. You first need to define the Application in Auth0 to then be able to add authentication to it. +The term *application* or *app* in Auth0 does not imply any particular implementation characteristics. For example, it could be a native app that executes on a mobile device, a single-page app that executes on a browser, or a regular web app that executes on a server. -The term application does not imply any particular implementation characteristics. Your application can be a native app that executes on a mobile device, a single page app that executes on a browser, or a regular web app that executes on a server. The key point is that applications are primarily meant for human interaction, as opposed to APIs, which provide data to applications through a standardized messaging system. +Auth0 categorizes apps based on these characteristics: -## Application Types +* **What type of app is it?**: To add authentication to your app, you must register it in the Auth0 Dashboard and select from one of the following app types: + - [Regular web app](/dashboard/guides/applications/register-app-regular-web): Traditional web apps that perform most of their application logic on the server (such as Express.js or ASP.NET). + - [Single-page app (SPA)](/dashboard/guides/applications/register-app-spa): JavaScript apps that perform most of their user interface logic in a web browser, communicating with a web server primarily using APIs (such as AngularJS + Node.js or React). + - [Native app](/dashboard/guides/applications/register-app-native): Mobile or Desktop apps that run natively in a device (such as iOS or Android). + - [Machine-to-machine (M2M) app](/dashboard/guides/applications/register-app-m2m): Non-interactive apps, such as command-line tools, daemons, IoT devices, or services running on your back-end. Typically, you use this option if you have a service that requires access to an API. -There are four application types in Auth0: +* **Can the app securely hold credentials?**: According to the [OAuth 2.0 spec](https://tools.ietf.org/html/rfc6749#section-2.1), apps can be classified as either *public* or *confidential*; confidential apps can hold credentials securely, while public apps cannot. See [Confidential and Public Applications](/applications/concepts/app-types-confidential-public) for details. -- [Native](/applications/native): Used for mobile, desktop or hybrid apps, than run natively in a device, like Android, iOS, Ionic, Windows, OS/X. +* **Who owns the app?**: Whether an app is classified as first- or third-party depends on the app ownership and control. First-party apps are controlled by the same organization or person that owns the Auth0 domain. Third-party apps enable external parties or partners to securely access protected resources behind your API. See [First-Party and Third-Party Applications](/applications/concepts/app-types-first-third-party) for details. -- [Single Page Web Applications](/applications/spa): Used for JavaScript front-end apps that run on a browser, like Angular, jQuery or React. +## Manage app settings -- [Regular Web Applications](/applications/webapps): Used for traditional web applications that run on a server, like ASP .NET, Java, Ruby on Rails or Node.js. +You register apps on the [Dashboard > Applications > Settings](${manage_url}/#/applications/${account.clientId}/settings) page. See [Application Settings](/dashboard/reference/settings-application) for details. -- [Machine to Machine Applications](/applications/machine-to-machine): Used for server to server applications like command-line tools, daemons, IoT devices, or services running on your backend. Typically you would use this option if you have a service that requires access to an API. +In addition to setting up apps in the Dashboard, you can also set up apps programmatically as described in the [OpenID Connect (OIDC) Dynamic Client Registration 1.0 ](https://openid.net/specs/openid-connect-registration-1_0.html) specification. See [Dynamic Client Registration](/api-auth/dynamic-client-registration) for details. -Follow the links above to get more information on how to configure each one. - -::: note -After creating your first application, set the environment for your tenant to: development, staging, or production. For more information refer to [Set Up Multiple Environments](/dev-lifecycle/setting-up-env#set-the-environment). -::: - -Auth0 also differentiates between [public and private applications](/applications/application-types#confidential-vs-public-applications), as well as [first- vs. third-party applications](/applications/application-types#first-vs-third-party-applications). - -## How to Delete an Application - -Navigate to the [Application Settings](${manage_url}/#/applications/${account.clientId}/settings) and scroll to the end of the page. Under the *Danger Zone* section you can find the **Delete Application** button. This operation cannot be undone. - -Once you click on the button a pop-up window will ask you to confirm the action. Click **Yes, delete application** to permanently remove the application. - -::: note -You can also delete an application using the [DELETE /api/v2/clients/{id} endpoint](/api/management/v2#!/Clients/delete_clients_by_id) of the Management API. +::: panel Multi-Tenancy +You can set up up a more complex configuration that allows users to log in differently for different apps. See [Using Auth0 to Secure Your Multi-Tenant Applications](/design/using-auth0-with-multi-tenant-apps) and [Create Multiple Tenants](/dashboard/guides/tenants/create-multiple-tenants). ::: -## Application Auditing - -Auth0 stores log data of both actions taken in the dashboard by the administrators, as well as authentications made by your users. The logs include many of the actions performed by the user like failing to login to an application or requesting a password change. For more details refer to: [Logs](/logs). - -If you use a third-party application for log management, like Sumo Logic, Splunk or Loggly, you can use Auth0 Extensions to export your logs there. For details on the available extensions and how to configure them refer to: [Extensions](/extensions). - -## Dynamic Client Registration - -You can use the Auth0 to programmatically create applications, as described in the [OIDC Dynamic Client Registration 1.0 specification](https://openid.net/specs/openid-connect-registration-1_0.html). For more details please refer to [Dynamic Client Registration](/api-auth/dynamic-client-registration). - -## Next Steps +By default, Auth0 enables all connections associated with your tenant when you create a new application. To change this, [update application connections](/dashboard/guides/applications/update-app-connections) in the Application Settings in the Dashboard. -Once you have configured your Application, some common next steps to take are: +## Monitor apps -- **Configure a Connection** and enable it for your Application. For details refer to [Application Connections](/applications/connections). For a list of the supported Identity Providers refer to [Identity Providers Supported by Auth0](/identityproviders). +You can [monitor apps](/monitoring/guides/monitor-applications) and perform end-to-end testing using your own tests. Auth0 stores [log data](/logs) including Dashboard administrator actions, successful and failed user authentications, and password change requests. You can use Auth0 [Extensions](/extensions) to export your log data and use tools like Sumo Logic, Splunk, or Loggly to analyze and store your log data. -- **Configure your app** to use your Auth0 Application. For detailed instructions and samples for a variety of technologies, refer to our [quickstarts](/quickstarts). There you can find information on how to implement login and logout (using [Lock](/libraries/lock) or [Auth0.js](/libraries/auth0js)), handle your user sessions, retrieve and display user profile information, add [Rules](/rules) to customize your flow, and more. +## Remove apps - ::: note - For background theory on application authentication flows, refer to [Application Authentication](/application-auth). - ::: +You can [remove an application using the Auth0 Dashboard](/dashboard/guides/applications/remove-app) or the [Management API](/api/management/guides/applications/remove-app). -- Use our latest [API Authorization](/api-auth) features to **call an API**. +## Manage client secrets -- **Use [our APIs](/api/info)**. +You can [rotate an app's Client Secret](/dashboard/guides/applications/rotate-client-secret) using the Auth0 Dashboard or the [Management API](/api/management/guides/applications/rotate-client-secret). - - The [Authentication API](/api/authentication) handles all the primary identity related functions (login, logout, get user profile, and so forth). Most users consume this API through our [Quickstarts](/quickstarts), the [Auth0.js library](/libraries/auth0js) or the [Lock widget](/libraries/lock). However, if you are building all of your authentication UI manually you will have to interact with this API directly. +## Grant types - - The [Management API](/api/management/v2) can be used to automate various tasks in Auth0 such as creating users. +Auth0 provides many different authentication and authorization grant types or *flows* and allows you to indicate which grant types are appropriate based on the `grant_types` property of your Auth0-registered app. See [Application Grant Types](/applications/concepts/application-grant-types) for more details. diff --git a/articles/applications/machine-to-machine.md b/articles/applications/machine-to-machine.md deleted file mode 100644 index 6b75260f7b..0000000000 --- a/articles/applications/machine-to-machine.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -description: Explains the basics of creating and using Auth0 Machine to Machine Applications. -toc: true ---- -# Machine to Machine Applications - -You can use machine-to-machine applications when you want to invoke an API using a non-interactive application, such as a service, command line tool, or IoT device using the [OAuth 2.0 Client Credentials Grant](/api-auth/grant/client-credentials). - -## Create a new Machine to Machine Application - -To create a new Machine to Machine Application: - -1. Log in to the Dashboard and navigate to [Applications](${manage_url}/#/applications). - -2. Click **Create Application**. When asked what type of application you'd like to create, select **Machine to Machine Application**. Click **Create** to proceed. - -![Create an Application](/media/articles/applications/m2m-create.png) - -2. Select the API you want to call from the application. - -*If you haven't created an API yet, learn [how to configure an API in Auth0](/apis#how-to-configure-an-api-in-auth0).* - -::: note -There will already be an **Auth0 Management API** that represents Auth0's APIv2. You can authorize applications to request tokens from this API. -::: - -![Select an API](/media/articles/applications/m2m-select-api.png) - -3. Select the scopes you want to grant to the Machine to Machine Application. - -A **scope** is a claim that may be issued as part of the Access Token. With this information, the API can enforce fine-grained authorization. You can define scopes in the [API's scopes tab](/scopes/current#define-scopes-using-the-dashboard). - -![Select Scopes](/media/articles/applications/m2m-select-scopes.png) - -At this point, you're ready to call your API using the Machine to Machine Application.The Quick Start tab will show you how you can call your API using technologies. - -![M2M Quickstarts](/media/articles/applications/m2m-quickstart.png) - -To learn how to accept and validate Access Tokens in your API implementation, see the [Backend Quickstarts](/quickstart/backend). - -## Settings - -The Settings tab lets you edit different application settings: - -<%= include('./application-settings/_settings') %> - -- **Application Type**: The type of application you are implementing. Select **Machine to Machine Application**. - -<%= include('./application-settings/_token-endpoint-auth-method') %> - -<%= include('./application-settings/_settings-pt2') %> - -### Advanced Settings - -<%= include('./application-settings/_adv-settings') %> - -<%= include('./application-settings/_trust-token-endpoint-ip-header') %> - -## APIs - -The **APIs** tab: - -* Lists all available APIs for the tenant -* Shows the ones that the Machine to Machine Application is authorized to call -* Lets you authorize additional APIs - -![M2M APIs](/media/articles/applications/m2m-apis.png) - -For example, you can authorize the same Machine to Machine Application to call both your own API and the Auth0 Management API. - -::: note -Customers can see their [Machine to Machine usage report in the Support Center](${env.DOMAIN_URL_SUPPORT}/reports/quota). Please note that this is not a *user* count, but the number of Access Tokens issued by Auth0 for the Client Credentials grant per calendar month for a given tenant. -::: diff --git a/articles/applications/native.md b/articles/applications/native.md deleted file mode 100644 index f6186a7bba..0000000000 --- a/articles/applications/native.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -description: Explains the basics of creating and using Auth0 Native applications. -toc: true ---- -# Native Applications - -You'll need to create a Native Application if you want to integrate Auth0 with mobile, desktop, or hybrid apps that run natively on devices using Android, iOS, Windows, macOS, and so on. - -<%= include('./_configure', { application_type: 'Native', application_type_create: 'Native' }) %> - -## Settings - -<%= include('./application-settings/_settings') %> - -- **Application Type**: The type of application you are implementing. For desktop or mobile apps running natively on the device, you'll want to create a Native Application. - -<%= include('./application-settings/_settings-pt2') %> - -### Advanced Settings - -<%= include('./application-settings/_adv-settings') %> - -<%= include('./application-settings/_adv-settings-mobile') %> - diff --git a/articles/applications/reference/grant-types-auth0-mapping.md b/articles/applications/reference/grant-types-auth0-mapping.md new file mode 100644 index 0000000000..d0808c59d3 --- /dev/null +++ b/articles/applications/reference/grant-types-auth0-mapping.md @@ -0,0 +1,61 @@ +--- +title: Auth0 Grant Types Mapping +description: Learn which grant types are available to which application types with Auth0. +toc: true +topics: + - applications + - application-types + - grant-types +contentType: reference +useCase: + - build-an-app +--- + +# Auth0 Grant Types Mapping + +When registered, Auth0 Applications have access to different grant types based on [application](/applications) type. The biggest deciding factor is whether the application is [confidential or public](/applications/concepts/app-types-confidential-public). + +Additionally, trusted first-party applications have access to additional grant types. + +## Public applications + +When a **Native App** or **Single-Page App** is registered in the Dashboard, it is automatically flagged as a public application, which is indicated by a `token_endpoint_auth_method` flag set to `none`. + +By default, Auth0 creates public applications with the following `grant_types` enabled: + +* `implicit` +* `authorization_code` +* `refresh_token` + +**Native Apps** can also use the `device_code` grant type. + +::: note +Public applications **cannot** use the `client_credentials` grant type. To use this grant type, you must indicate that the application is confidential rather than public. Use the [Management API](/api/management/v2#!/Clients/patch_clients_by_id) to set the **token_endpoint_auth_method** to `client_secret_post` or `client_secret_basic`. +::: + +## Confidential applications + +When a **Regular Web App** or **Machine-to-Machine (M2M) App** is registered in the Dashboard, it is automatically flagged as a confidential application, which is indicated by a `token_endpoint_auth_method` flag set to anything *except* `none`. + +By default, Auth0 creates confidential applications with the following `grant_types` enabled: + +* `implicit` +* `authorization_code` +* `refresh_token` +* `client_credentials` + +## Trusted first-party applications + +Trusted first-party applications have the same `grant_types` enabled as confidential applications, plus the following: + +* `password` +* `http://auth0.com/oauth/grant-type/password-realm` +* `http://auth0.com/oauth/grant-type/mfa-oob` +* `http://auth0.com/oauth/grant-type/mfa-otp` +* `http://auth0.com/oauth/grant-type/mfa-recovery-code` + +::: note +If you are using the [Dashboard](${manage_url}) to enable or disable these grant types, be aware that all the Password and MFA grant types are enabled when you add the `Password` or `MFA` grant type to your Application. You cannot select them individually. +::: + +For more info about first-party and third-party applications, see [First-Party and Third-Party Applications](/applications/concepts/app-types-first-third-party). diff --git a/articles/applications/reference/grant-types-available.md b/articles/applications/reference/grant-types-available.md new file mode 100644 index 0000000000..f4f2946b74 --- /dev/null +++ b/articles/applications/reference/grant-types-available.md @@ -0,0 +1,55 @@ +--- +title: Available Grant Types +description: Learn which grant types are available with Auth0. +toc: true +topics: + - applications + - grant-types +contentType: reference +useCase: + - build-an-app +--- +# Available Grant Types + +Various grant types are valid when registering Auth0 Applications. These can be divided into the following categories: + +* **[Spec-conforming grants](#spec-conforming-grants)**: Grants defined by and conforming to external specifications (such as OpenID Connect (OIDC)). +* **[Auth0 extension grants](#auth0-extension-grants)**: Auth0-specific grants that conform to the [OAuth extension mechanism](https://tools.ietf.org/html/rfc6749#section-4.5) to support additional clients or to provide a bridge between OAuth and other trust frameworks. +* **[Auth0 legacy grants](#auth0-legacy-grants)**: Traditional grant types supported for legacy customers only. If you are a legacy customer, we highly recommend moving to a more secure alternative. For info on working with legacy grant types and their alternatives, see [Legacy Grant Types](/applications/concepts/grant-types-legacy). + +## Spec-conforming grants + +| `grant_type` | More info | +|:-----|:----| +| `implicit` | [Implicit Grant](/flows/concepts/implicit) | +| `authorization_code` | [Authorization Code Grant](/flows/concepts/auth-code) | +| `client_credentials` | [Client Credentials Grant](/flows/concepts/client-credentials) | +| `password` | [Resource Owner Password Grant](/api-auth/grant/password) | +| `refresh_token` | [Use Refresh Tokens](/tokens/guides/use-refresh-tokens) | +| `urn:ietf:params:oauth:grant-type:device_code` | [Device Authorization Grant](/flows/concepts/device-auth) | + +## Auth0 extension grants + +| `grant_type` | More info | +|:-----|:----| +| `http://auth0.com/oauth/grant-type/password-realm` | [Use an extension grant similar to the Resource Owner Password Grant that includes the ability to indicate a specific realm](/api-auth/grant/password#realm-support) | +| `http://auth0.com/oauth/grant-type/mfa-oob` | [Multi-factor Authentication OOB Grant Request](/mfa/guides/mfa-api/multifactor-resource-owner-password#mfa-oob-grant-request) | +| `http://auth0.com/oauth/grant-type/mfa-otp` | [Multi-factor Authentication OTP Grant Request](/mfa/guides/mfa-api/multifactor-resource-owner-password#mfa-otp-grant-request) | +| `http://auth0.com/oauth/grant-type/mfa-recovery-code` | [Multi-factor Authentication Recovery Grant Request](/mfa/guides/mfa-api/multifactor-resource-owner-password#mfa-recovery-grant-request) | +| `http://auth0.com/oauth/grant-type/passwordless/otp` | [Embedded Passwordless Login Grant Request](/connections/passwordless#implementing-login) | + +## Auth0 legacy grants + +Legacy grants include: + +* `http://auth0.com/oauth/legacy/grant-type/ro` +* `http://auth0.com/oauth/legacy/grant-type/ro/jwt-bearer` +* `http://auth0.com/oauth/legacy/grant-type/delegation/refresh_token` +* `http://auth0.com/oauth/legacy/grant-type/delegation/id_token` +* `http://auth0.com/oauth/legacy/grant-type/access_token` + +For info on working with legacy grant types and their alternatives, see [Legacy Grant Types](/applications/concepts/grant-types-legacy). + +## Keep reading + +* To learn which grant types are enabled for different application types, see [Auth0 Grant Types Mapping](/applications/reference/grant-types-auth0-mapping). diff --git a/articles/applications/reference/wildcard-subdomains.md b/articles/applications/reference/wildcard-subdomains.md new file mode 100644 index 0000000000..74f968b6d1 --- /dev/null +++ b/articles/applications/reference/wildcard-subdomains.md @@ -0,0 +1,35 @@ +--- +title: Wildcards for Subdomains +description: Describes wildcards for subdomains function in application configuration. +toc: true +topics: + - applications +contentType: reference +useCase: + - build-an-app +--- +# Wildcards for Subdomains + +You can use wildcards for subdomain URL registration in your application configuration in the Dashboard with these fields: + +* **Allowed Callback URLs**: Set of URLs to which Auth0 is allowed to redirect users after they authenticate. +* **Allowed Logout URLs**: List of URLs to which you can redirect users after they log out from Auth0. +* **Allowed Origins (CORS)**: Set of URLs that will be allowed to make requests from JavaScript to Auth0 API (typically used with CORS). + +::: warning +Avoid using wildcards for subdomains in application callbacks and allowed origins as it can make your application vulnerable to attacks. See [Application Settings Best Practices](/best-practices/application-settings) for this and other recommended settings. +::: + +You can use the star symbol (`*`) as a wildcard for subdomains, but it must be used in accordance with the following rules in order to properly function: + +* The protocol of the URL **must** be `http:` or `https:`. `com.example.app://*.example.com` will not work. + +* The wildcard **must** be located in a subdomain within the hostname component. `https://*.com` will not work. + +* The wildcard **must** be located in the subdomain furthest from the root domain. `https://sub.*.example.com` will not work. + +* The URL **must not** contain more than one wildcard. `https://*.*.example.com` will not work. + +* A wildcard **may** be prefixed and/or suffixed with additional valid hostname characters. `https://prefix-*-suffix.example.com` will work. + +* A URL with a valid wildcard **will not** match a URL more than one subdomain level in place of the wildcard. `https://*.example.com` will not work with `https://sub1.sub2.example.com`. diff --git a/articles/applications/spa.md b/articles/applications/spa.md deleted file mode 100644 index 9a4c23ea05..0000000000 --- a/articles/applications/spa.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -description: Explains the basics of creating and using Auth0 Single Page applications. -toc: true ---- -# Single Page Applications - -You'll need to define a Single Page Application if you want to integrate Auth0 with front-end apps (built using technologies like Angular, jQuery, or React) that run in a browser. - -<%= include('./_configure', { application_type: 'Single Page Web', application_type_create: 'Single Page Web Applications' }) %> - -## Settings - -<%= include('./application-settings/_settings') %> - -- **Application Type**: The type of application you are implementing. For apps with a JavaScript front-ends that utilizes APIs, create an SPA. - -<%= include('./application-settings/_settings-pt2') %> - -### Advanced Settings - -<%= include('./application-settings/_adv-settings') %> - - diff --git a/articles/applications/webapps.md b/articles/applications/webapps.md deleted file mode 100644 index 044f05ed3b..0000000000 --- a/articles/applications/webapps.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -description: Explains the basics of creating and using Auth0 Regular Web Applications applications. -toc: true ---- -# Regular Web Applications - -You'll need to define a Regular Web Application if you want to integrate Auth0 with traditional web applications (using technologies like ASP.NET, Java, Ruby on Rails, or Node.js) running on a server. - -<%= include('./_configure', { application_type: 'Regular Web', application_type_create: 'Regular Web Applications' }) %> - -## Settings - -- **Application Type**: The type of application you are implementing. If you're working with a traditional web app that has the ability to refresh its pages, use a Regular Web Applications. - -<%= include('./application-settings/_token-endpoint-auth-method') %> - -<%= include('./application-settings/_settings-pt2') %> - -### Advanced Settings - -<%= include('./application-settings/_adv-settings') %> - -<%= include('./application-settings/_trust-token-endpoint-ip-header') %> diff --git a/articles/architecture-scenarios/_includes/_api-authentication-and-authorization.md b/articles/architecture-scenarios/_includes/_api-authentication-and-authorization.md index c72a89b650..7c95f9b91b 100644 --- a/articles/architecture-scenarios/_includes/_api-authentication-and-authorization.md +++ b/articles/architecture-scenarios/_includes/_api-authentication-and-authorization.md @@ -9,9 +9,9 @@ An Access Token is obtained by authenticating the user with an Authorization Ser ::: panel What is an Access Token? An Access Token (also referred to as `access_token`) is an opaque string representing an authorization issued to the application. It may denote an identifier used to retrieve the authorization information or may self-contain the authorization information (for example, the user's identity, permissions, and so forth) in a verifiable manner. -It is quite common for Access Tokens to be implemented as [JSON Web Tokens](/jwt). +It is quite common for Access Tokens to be implemented as [JSON Web Tokens](/tokens/concepts/jwts). -For more information on Auth0 Access Tokens refer to [Access Token](/tokens/access-token). +For more information on Auth0 Access Tokens refer to [Access Token](/tokens/concepts/access-tokens). ::: An API can enforce fine-grained control over who can access the various endpoints exposed by the API. These permissions are expressed as scopes. @@ -30,7 +30,7 @@ When a client asks the API to create a new timesheet entry, then the Access Toke For more information on scopes refer to [Scopes](/scopes). ::: -By using the OAuth 2.0 authorization framework, you can give your own applications or third-party applications limited access to your APIs on behalf of the application itself. Using Auth0, you can easily support different flows in your own APIs without worrying about the OAuth 2.0/OpenID Connect specification, or the many other technical aspects of API authorization. +By using the OAuth 2.0 authorization framework, you can give your own applications or third-party applications limited access to your APIs on behalf of the application itself. Using Auth0, you can easily support different flows in your own APIs without worrying about the OAuth 2.0/OpenID Connect (OIDC) specification, or the many other technical aspects of API authorization. ::: panel OAuth Roles In any OAuth 2.0 flow we can identify the following roles: diff --git a/articles/architecture-scenarios/_includes/_api-configure-scopes.md b/articles/architecture-scenarios/_includes/_api-configure-scopes.md index 571c464d01..148a374c9a 100644 --- a/articles/architecture-scenarios/_includes/_api-configure-scopes.md +++ b/articles/architecture-scenarios/_includes/_api-configure-scopes.md @@ -1,7 +1,7 @@ -### Configure the Scopes +### Configure the Permissions -Once the application has been created you will need to configure the Scopes which applications can request during authorization. +Once the application has been created you will need to configure the Permissions which applications can request during authorization. -In the settings for your API, go to the **Scopes** tab. In this section you can add all four of the scopes which were discussed before, namely `read:timesheets`, `create:timesheets`, `delete:timesheets`, `approve:timesheets`. +In the settings for your API, go to the **Permissions** tab. In this section you can add all four of the scopes which were discussed before, namely `read:timesheets`, `create:timesheets`, `delete:timesheets`, `approve:timesheets`. -![Add Scopes](/media/articles/architecture-scenarios/mobile-api/add-scopes.png) \ No newline at end of file +![Add Scopes](/media/articles/architecture-scenarios/mobile-api/add-permissions.png) \ No newline at end of file diff --git a/articles/architecture-scenarios/_includes/_api-implement.md b/articles/architecture-scenarios/_includes/_api-implement.md index 086b8b8824..3a217a0af4 100644 --- a/articles/architecture-scenarios/_includes/_api-implement.md +++ b/articles/architecture-scenarios/_includes/_api-implement.md @@ -36,7 +36,7 @@ The validations that the API should perform are: Part of the validation process is to also check the Client permissions (scopes), but we will address this separately in the next paragraph of this document. -For more information on validating Access Tokens, refer to [Verify Access Tokens](/api-auth/tutorials/verify-access-token). +For more information on validating Access Tokens, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). ::: note See the implementation in [Node.js](/architecture-scenarios/application/mobile-api/api-implementation-nodejs#2-secure-the-api-endpoints) diff --git a/articles/architecture-scenarios/_includes/_api-signing-algorithms.md b/articles/architecture-scenarios/_includes/_api-signing-algorithms.md index 9860ac274f..26c06a5eaf 100644 --- a/articles/architecture-scenarios/_includes/_api-signing-algorithms.md +++ b/articles/architecture-scenarios/_includes/_api-signing-algorithms.md @@ -3,7 +3,7 @@ When you create an API you have to select the algorithm your tokens will be signed with. The signature is used to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed along the way. ::: note -The signature is part of a JWT. If you are not familiar with the JWT structure please refer to: [JSON Web Tokens (JWTs) in Auth0](/jwt#what-is-the-json-web-token-structure-). +The signature is part of a JWT. If you are not familiar with the JWT structure please refer to: [JSON Web Token Structure](/tokens/references/jwt-structure). ::: To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. That algorithm, which is part of the JWT header, is the one you select for your API: `HS256` or `RS256`. @@ -17,6 +17,3 @@ The most secure practice, and our recommendation, is to use __RS256__. Some of t - Under HS256, If the private key is compromised you would have to re-deploy the API with the new secret. With RS256 you can request a token that is valid for multiple audiences. - With RS256 you can implement key rotation without having to re-deploy the API with the new secret. -::: note -For a more detailed overview of the JWT signing algorithms refer to: [JSON Web Token (JWT) Signing Algorithms Overview](https://auth0.com/blog/json-web-token-signing-algorithms-overview/). -::: \ No newline at end of file diff --git a/articles/architecture-scenarios/_includes/_architecture/_custom-domains.md b/articles/architecture-scenarios/_includes/_architecture/_custom-domains.md new file mode 100644 index 0000000000..0f2d1ea2a4 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_architecture/_custom-domains.md @@ -0,0 +1,16 @@ +When you setup your Auth0 tenant, the URL for accessing that tenant will be of the form `https://${account.tenant}.auth0.com`. Providing a [Custom Domain](/custom-domains) (also known as a vanity URL), for your Auth0 tenant is not only an important factor for supporting your Branding requirements, but more importantly will also provide you with security benefits too: + +* Some browsers will, by default, make it [difficult to communicate in an iFrame if you don't have a shared domain](/api-auth/token-renewal-in-safari). +* A vanity URL makes phishing more difficult as the phisher must also create a vanity URL to mimic yours. For example, with a custom domain you can use your own certificate to get an "Extended Validation", making phishing even harder. + +::: note +You are allowed only one custom domain per Auth0 Tenant. This is because a tenant in Auth0 is intended to represent a “domain” of users. If you need more than one vanity URL, then you likely have more than one domain of users and should be using multiple tenants. +::: + +Your custom domain name should also give the user confidence that this is the appropriate place to enter their credentials, and we recommend that you create your custom domain in all environments early on to ensure that you are testing consistently between environments. **It's extremely important to train your users to to look for suspicious URLs when entering their credentials!** + +::: panel Best Practice +Create a custom domain (a.k.a. `CNAME`) for your Auth0 tenant, and also create one in development too so you can ensure you have managed the `CNAME` correctly. For example, you could create a `CNAME` which maps `login.mycompany.com` to `mycompany-prod.auth0.com`. +::: + +In almost all cases, customers have been most successful when adopting a strategy of a centralised domain for authentication across multiple product or service brands. This strategy provides users with a consistent UX, and also mitigates the complexity of deploying and maintaining multiple Auth0 tenants in a production environment. If you are considering having multiple domains for different brands, please refer to the [Branding](/architecture-scenarios/implementation/${platform}/${platform}-branding) guidance before you begin implementing. diff --git a/articles/architecture-scenarios/_includes/_architecture/_introduction.md b/articles/architecture-scenarios/_includes/_architecture/_introduction.md new file mode 100644 index 0000000000..ab22539da6 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_architecture/_introduction.md @@ -0,0 +1,37 @@ +Understanding your application is key to understanding how Auth0 can be leveraged to meet your needs. From experience, our most successful customers start with a visualization of their proposed - or in many cases existing - architecture and use this as a basis for reference as they progress. Understanding where your application fits within your organization is also important; Auth0 [Accounts and Tenants](/getting-started/the-basics#account-and-tenants) form the basis for the grouping and structuring of Auth0 assets, and it may be that you’ll need to leverage an existing Auth0 deployment in order to integrate with [Single Sign-on (SSO)](/sso/current/introduction), centralized user [Profile Management](/architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt), consolidated billing, or the like. + +::: panel Best Practice +If you do have multiple applications, and you need to leverage SSO, then we recommend you check out our [How to Implement Single Sign-On](https://auth0.com/learn/how-to-implement-single-sign-on/) training guidance before continuing. +::: + +The value of investing time on the landscape of the architecture up-front is something that we have found pays dividends in the long run, and there are a number of things you will want to consider when looking at functionality and workflow: + +* What should the URL look like when Auth0 needs to present a web page to a user? +* How can Auth0 be structured to support your SDLC (Software Development Lifecycle)? +* How can you ensure that your Auth0 tenants are appropriately associated with your contract? +* What do you need to consider if there are other projects in your organization integrating with Auth0? Particularly projects that target their own, or a different domain of users (for example, applications that only employees will use)? +<% if (platform === "b2b") { %> +* How can you align the structure and domain of your customers’ organization with your Auth0 deployment? +<% } %> + +Organizations often service more than one domain of user - customers, employees, and affiliates being the most frequently encountered, with typically little to no cross-over: employees, say, don’t use the same applications as customers and vice-versa. In some cases there can also be a need to partition further within a domain - separate groups of customers, say, who use different and unconnected products. Auth0 provides a way to segregate your users and the associated collateral, and [tenant provision](#tenant-provision) covers this in more detail. If you need to provision an independent tenant then you’ll also want to [associate this with your existing Auth0 account](#tenant-association), so that you can take full advantage of the benefits provided at your organization’s contracted subscription level. + +::: panel Best Practice +It’s not uncommon for companies to have identity requirements that address multiple user communities: customers, partners, employees, etc. So be sure to consider other projects or future requirements when designing your architecture. +::: + +In addition, you’ll undoubtedly have an established set of processes and procedures as part of your Software Development Lifecycle (SDLC). So you’ll want to check out our [SDLC support](#sdlc-support) guidance regarding Auth0 Tenant provision in support of that too. + +For customer-facing applications, we typically see [OpenID Connect (OIDC)](/protocols/oidc) as being the most frequently used protocol. OIDC makes use of web based workflows with browser URLs that are presented to the user. Out-of-the-box, client facing URLs as part of Auth0 OIDC support are Auth0 branded, however we recommend using the Auth0 [custom domain](#custom-domains) capability to provide for consistent corporate identity and to also address potential user confidence concerns before they arise. + +::: panel Best Practice +Other groups within your organization may also be working with Auth0; it’s not uncommon for our customers to have disparate departments that serve different user communities. Identifying these will potentially influence your design choices, and doing so early could mitigate decisions that might prove costly later on. +::: + +<% if (platform === "b2b") { %> +If your customers' organizations support the use of multiple IdPs, then we recommend that you can create separate Auth0 tenants for that organization; see [Tenant provision for complex organizations](#tenant-provision-for-complex-organizations) for further details. This allows you to keep the rest of your setup much simpler by maintaining a one-to-one connection relationship between your organization and all your customer organizations within your main tenant. +<% } %> + +::: panel Get Started with Auth0 Video +Watch this short video [Architecture: Your Tenant](/videos/get-started/01-architecture-your-tenant) to learn what an Auth0 tenant is and how to configure it in the Auth0 Dashboard. Understand why you may want more than one tenant if you have different user communities, and also how you can use more than one tenant to support your Software Development Life Cycle (SDLC). Understand the importance of tenant naming and custom domain usage best practices. Also learn how to set up additional tenant administrators and how to associate tenants with your Auth0 account. +::: \ No newline at end of file diff --git a/articles/architecture-scenarios/_includes/_architecture/_sdlc-support.md b/articles/architecture-scenarios/_includes/_architecture/_sdlc-support.md new file mode 100644 index 0000000000..bddb0fea0d --- /dev/null +++ b/articles/architecture-scenarios/_includes/_architecture/_sdlc-support.md @@ -0,0 +1,17 @@ +Every company has some form of Software Development Life Cycle (SDLC), and throughout the development process you will want to align with that strategy. For instance, you need to be able to test your integration with Auth0 in a similar fashion as you test the applications themselves. It is therefore important to [structure Auth0 tenants to support your SDLC](/dev-lifecycle/setting-up-env), and there is a consistent pattern which our customers typically follow when it comes to the best practices associated with tenant layout for doing so: + +| Environment | Sample Tenant Name | Description | +| - | - | - | +| Development | **company-dev** | A shared environment where most of your development work occurs | +| QA/Testing | **company-qa** or **company-uat** | An environment for formal testing of the changes you've made | +| Production | **company-prod** | The production tenant | + +In some cases you may also want to create one or more sandboxes (e.g., **company-sandbox1**, **company-sandbox2**) so that you can test changes without compromising your development environment. This might be where you test deployment scripts and the like. + +::: panel Best Practice +You can also take advantage of our [Implementation Checklists](/architecture-scenarios/checklists) that you can download and customize to meet your implementation project needs. +::: + +::: warning +Though Auth0 allows you to create as many free tenants as you'd like, you may be limited for the number of tenants where all paid features are enabled. If elegible, you can be provided with up to **three** tenants where all features are shared. +::: diff --git a/articles/architecture-scenarios/_includes/_architecture/_tenant-association.md b/articles/architecture-scenarios/_includes/_architecture/_tenant-association.md new file mode 100644 index 0000000000..dc2739a4cf --- /dev/null +++ b/articles/architecture-scenarios/_includes/_architecture/_tenant-association.md @@ -0,0 +1 @@ +To ensure that your [tenants are all associated with your Auth0 contractual agreement](/dev-lifecycle/child-tenants) and have the same features, ensure all your tenants are associated with your company account. If you have individual developers that want to create their own sandboxes for testing, make sure they get associated with your account so they have the same permissions too. To do this you should contact your Auth0 representative or the Auth0 Support Center at ${env.DOMAIN_URL_SUPPORT}. diff --git a/articles/architecture-scenarios/_includes/_architecture/_tenant-provision.md b/articles/architecture-scenarios/_includes/_architecture/_tenant-provision.md new file mode 100644 index 0000000000..f502ca08a7 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_architecture/_tenant-provision.md @@ -0,0 +1,7 @@ +Everything starts with an Auth0 tenant. This is where you will be configuring your use of Auth0, and the where Auth0 assets - such as [Applications](/applications), [Connections](/connections) and [user profiles](/architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt) are defined, managed and stored. Access to an Auth0 tenant is performed via the Auth0 [Dashboard](/dashboard), and via the Dashboard you can also create additional, associated tenants; you’re allowed to create more than one Auth0 tenant so that you can structure your tenants in a way that will isolate different domains of users and also support your [Software Development Life Cycle](#sdlc-support) (SDLC). + +::: warning +Tenant names cannot be changed, nor reused once deleted. So, make sure you're happy with your name(s) before you create your Auth0 tenants. +::: + +Determining the level of isolation you require when it comes to your user domains is an important step, and together with your branding requirements will subsequently help you determine the number of Auth0 tenants that will be required in your production environment. As we recommend you create a full suite of [SDLC supporting tenants](#sdlc-support) for every Auth0 tenant you will run in a production environment, the number of Auth0 tenants you will need to manage can quickly grow. Therefore you should consider carefully before creating multiple Auth0 tenants for production, and should consult our guidance on [Branding](/architecture-scenarios/implementation/${platform}/${platform}-branding) before making your final decision. diff --git a/articles/architecture-scenarios/_includes/_authentication/_application-integration.md b/articles/architecture-scenarios/_includes/_authentication/_application-integration.md new file mode 100644 index 0000000000..8580bb8809 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_application-integration.md @@ -0,0 +1,60 @@ +Once you've figured out how you want to authenticate your users, the next step is to determine how you will initiate that authentication. Each application will typically have its own starting point. + +::: warning +Native mobile applications (and desktop applications) should use the system browser for authentication, or they open themselves up to additional security risks. See [Native vs. Browser Login on Mobile](/design/browser-based-vs-native-experience-on-mobile) for more information. +::: + +As discussed, we've found that most of our customers use [OpenID Connect (OIDC)](/protocols/oidc) as the industry-standard protocol when it comes to their customer-facing applications. Figuring out which [OIDC flow](/api-auth/intro) to use is your first task, and you will want to start by reviewing the our [grant mapping](/applications/reference/grant-types-auth0-mapping) guidance in the first instance. + +If you want to allow anonymous users access to any part of our application then you need to determine if you will be redirecting right away or prompting your users to redirect only when required (or perhaps some combination of both; see [Redirect Users After Login Authentication](/users/guides/redirect-users-after-login) for further discussion). If users can [deep link](#deep-linking-to-protected-endpoints) to a protected version (or area) of your site then you will need to determine the links to your application that will result in an automatic redirect to Auth0. + +### Anonymous access + +It is important to consider the user experience when someone first comes to your application. If your application supports anonymous user access (quite common for eCommerce applications) there are different scenarios to consider: + +* Are they returning to the application after having already logged in, or +* If this is the first time they are accessing the application: + * Have they already accessed a different application that uses the same Auth0 tenant, + * Have they ever (or perhaps not in a long time) authenticated on this device or browser. + +When an anonymous user accesses your application, it can often be desirable for the application to discover if the user has already logged into a different application in the same family, or to remember this user even if the application is a [SPA](/quickstart/spa) with no state. For example, if you can determine that the user is already logged in, you might decide to have the UI header in the application skip displaying a login button and instead have an account or profile menu for the user. To accomplish this you will want to utilize "[silent authentication](/api-auth/tutorials/silent-authentication)". Silent authentication will allow you to check to see if the user is logged in without prompting them to log in if they are not. Then the application can present a login button if necessary. If the user is logged in already, however, then you will receive tokens and will not have to present the user with a login button again. + +::: warning +Checking for a login session by redirecting to Auth0 can be really helpful for your application, but if this will result in a lot of requests it is important to employ some sort of throttling mechanism to avoid latency and/or rate limiting. <%= include('../../_includes/_rate-limit-policy.md') %> +::: + +### Deep linking to protected endpoints + +There are a variety of reasons why someone might link directly to a particular page within your application that is only accessible by authenticated users. If this is possible for your application you should automatically redirect your user to Auth0 if they are not authenticated. Once they authenticate and the authorization server returns them to your application, you can [redirect them](/users/guides/redirect-users-after-login) to where they intended to go in the first place. + +::: panel Best Practice +Most modern authentication frameworks support middleware for redirecting to an authorization server such as Auth0. Ensure yours: + +* Is configurable +* Can check expirations +* Supports Refresh Tokens (for confidential clients) +::: + +### Authenticating the user + +Authentication is the process of determining user identity. The result of authentication in an OIDC context is an ID Token. This token contains information about the user and should only be able to be obtained if the user authenticates using one or more factors as defined by the authorization server (the most common form being [user ID and password](#username-and-password-authentication)). There are a few things you may also need to consider in addition to obtaining an ID Token: + +* Do we also need an [Access Token](/tokens/concepts/access-tokens) in order to call a shared API? +* Is your application a single-page application and only requires an [ID Token](/tokens/concepts/id-tokens)? See [Implicit Grant](/api-auth/tutorials/implicit-grant) for more information. +* Is your application a native application (mobile or desktop) and/or do you need a [Refresh Token](/tokens/concepts/refresh-tokens)? See [Authorization Code Grant with PKCE](/api-auth/tutorials/authorization-code-grant-pkce) for more information. + +::: warning +Before you go live, you should ensure that **only** the grants that you are using for each application are enabled in your [configuration for your Application](/dashboard/guides/applications/update-grant-types). +::: + +### Implicit grant + +If all your application needs is the ID Token and the application is browser-based, then you can always use the [implicit grant](/api-auth/tutorials/implicit-grant) to get your ID Token. This is a simple authentication flow and should be supported by your SDK (depending on the language you are developing in). + +::: warning +If you need a [Refresh Token](/tokens/concepts/refresh-tokens) so that you can obtain a new Access Token or ID Token without having to re-authenticate the user, then you must use the [authorization code grant](/api-auth/tutorials/authorization-code-grant). +::: + +### Authorization code grant (with or without PKCE) + +If your SDK only supports the Authorization Code grant, or you need an Access Token or Refresh Token, then Authorization Code grant (with or without [PKCE](/flows/concepts/auth-code-pkce)) can also be used to retrieve an ID Token. The Authorization Code grant includes an additional API call to exchange the code for a token which can result in additional unnecessary latency if all you need is the ID Token. In many cases the [hybrid flow](/api-auth/tutorials/hybrid-flow) is implemented to provide optimum access to the ID Token while still leveraging Authorization Code grant workflow for the secure and safe retrieval of Access and Refresh Tokens. diff --git a/articles/architecture-scenarios/_includes/_authentication/_attack-protection.md b/articles/architecture-scenarios/_includes/_authentication/_attack-protection.md new file mode 100644 index 0000000000..42aeb1a83b --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_attack-protection.md @@ -0,0 +1,5 @@ +The reason that authentication systems are important is to prevent bad actors from accessing applications and user data that they should not. We want to place as many barriers as possible between those bad actors and access to our systems. One of the easiest ways to do this is to ensure that your [attack protection](/attack-protection) with Auth0 is configured correctly, so take a moment to read the guidance on this subject and ensure that it's working correctly for you. + +::: panel Best Practice +Attack protection is handled behind the scenes by Auth0 and provides a great security feature for your product. If you're going to utilize it, ensure that you have set up your [Email Provider](/architecture-scenarios/implementation/${platform}/${platform}-operations#email-provider-setup) and configured your [Email Templates](/architecture-scenarios/implementation/${platform}/${platform}-branding#email-template-customization) before turning on email delivery to your users. +::: diff --git a/articles/architecture-scenarios/_includes/_authentication/_introduction.md b/articles/architecture-scenarios/_includes/_authentication/_introduction.md new file mode 100644 index 0000000000..1921e46883 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_introduction.md @@ -0,0 +1,46 @@ +In order to provide services to your users, you must be able to identify who those users are. This process is called User Authentication. There are a number of ways to perform authentication of a user - via social media accounts, username and password, passwordless - and it's often recommended that you go beyond a first factor for authenticating the user by enabling multi-factor authentication (MFA). + +::: panel Best Practice +It's important to consider both security and user experience when designing how you will authenticate your users. Providing for multiple primary factors, and/or enforcing more than one factor during authentication, are ways that you can provide both. +::: + +There are a number of things you will want to consider when looking at functionality and workflow: + +* Where will users enter their credentials? +* How will you keep user credentials safe? +* How will you maintain your authentication system? +* How can you provide password authentication for your users? +* How can you prevent hackers from trying to log in as your users? +* How will you implement authentication in different kinds of applications? +* How can you make login easy for your users when they come from different language backgrounds? +* How will you provide a good user experience as you migrate away from any legacy authentication system? +* What should you consider when integrating applications with Auth0? +<% if (platform === "b2c") { %> +* Can users log in using their existing social (e.g., Facebook or Google) accounts? +<% } %> +* Do you need to provide multi-factor authentication? +* What do you do if you have a service that doesn't have a way for the user to log in ahead of time? +* Can you pass the same user access token from one API to another? +<% if (platform === "b2b") { %> +* What do you do if you need to isolate users by organization? +* How will you handle identifying which organization users belong to? +* What’s the benefit of providing enterprise connections for your organizations? +<% } %> + +Auth0 [Universal Login](#universal-login) provides users with a safe and secure experience - no matter whether you choose to provide for user ID/password credentials sign in, or allow the so-called Bring Your Own Identity scenarios provided via [Social Login](https://auth0.com/learn/social-login/). There are also brand recognition benefits to centralizing the login experience with Universal Login, even if you feel you will also have product-specific [branding](/architecture-scenarios/implementation/${platform}/${platform}-branding) requirements. The Auth0 UI widgets typically used with Universal Login also provide out-of-the-box support with regards to [internationalization](/libraries/lock/v11/i18n) for users with different language requirements, and out-of-the-box support for Auth0 features such as [MFA](#multi-factor-authentication-mfa-) and [attack protection](#attack-protection) allow you to put barriers in place in order to prevent hackers attempting to access users' accounts. + +Allowing users to sign in via user ID/password credentials means that you're not reliant on the status of third-party identity providers for your users to access your system. You also have the means require the credentials used to align with your corporate policies. Auth0 assists with this by providing you with multiple options in support of user ID/password logins, and the [guidance provided](#username-and-password-authentication) will help you understand you can leverage these options. Adding [social](#social-authentication) support at some stage, as an additional primary authentication factor, gives you added flexibility and can help you better understand your users without the need to question them further by leveraging the information already stored by the various social login [providers](/connections/identity-providers-social). + +If you have an existing legacy identity store, you’ll also want to see [User Migration](/architecture-scenarios/implementation/${platform}/${platform}-provisioning#user-migration). This section discusses the advantages of migrating to Auth0’s managed identity storage in terms of safety and security. + +For customer facing applications, OpenID Connect ([OIDC](/protocols/oidc)) is the most frequently used industry standard protocol, and OIDC has first-class citizen support in Auth0. Auth0 provides support for various different approaches for integrating various different applications, so you'll want to see the section on [application integration](#application-integration) for the information you'll need to make an informed choice. + +When calling one API from another API, or from any situation where there is no authenticated user context - such as one or more cron jobs, report generators, or continuous integration/delivery systems - you will need a way to authorize the _application_ instead of a _user_. This is a one step process where the application is authenticated (using a client ID and secret) and then authorized in one call. You can learn more about this in our authorization workstream under [machine-to-machine (m2m) authorization](/architecture-scenarios/implementation/${platform}/${platform}-authorization#machine-to-machine-m2m-authorization). + +<% if (platform === "b2b") { %> +Often companies need to segregate their users by organization and sometimes users can have access to more than one organization. Knowing which of these scenarios is relevant to your company will help define how to determine in which connection a user exists: whether you need to do it, when you need to do it, and how to accomplish it. See [Home Realm Discovery](#home-realm-discovery) to determine if this is something relevant to your company. +<% } %> + +::: panel Get Started with Auth0 Videos +Watch these two short videos [Authenticate: How It Works](/videos/get-started/04_01-authenticate-how-it-works) and [Authenticate: SPA Example](/videos/get-started/04_01-authenticate-spa-example) to learn about the differences between authentication, authorization, and access control. Understand when and why you might use each type of authentication method: first factors, second factors, and multi-factor. Learn about the OpenID Connect (OIDC) authentication protocol. See an example using the Auth0 Quickstart for a single-page application (SPA) implementation. +::: diff --git a/articles/architecture-scenarios/_includes/_authentication/_mfa.md b/articles/architecture-scenarios/_includes/_authentication/_mfa.md new file mode 100644 index 0000000000..ec67e73549 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_mfa.md @@ -0,0 +1,16 @@ +In an era where misuse of user credentials is at an all-time high, protecting _your_ systems when it’s so common for hackers to steal users identity information in general is a challenge. One of the most effective ways though is to provide users with the ability to configure a second factor for protecting their account. More commonly referred to as [Multi-Factor Authentication](/mfa). This will ensure that only a valid user can access their account, even if they use a username and password that may have been compromised from a different application. + +::: panel Best Practice +It's quite common for customer facing applications to provide users with an _option_ for adding a second factor rather than _forcing_ them to use a second factor. For more information regarding this, see [providing your users with an option to add MFA](https://auth0.com/learn/multifactor-authentication-customers/). +::: + +Auth0 supports a number of different options when it comes to enabling MFA for protecting user account access, and there are several practices to ensure that you will truly be providing a flexible second factor barrier to access: + +* Auth0 [Guardian](https://auth0.com/multifactor-authentication): a service that provides both _Push_ notification generation and an application for allowing or denying requests. _Push_ sends notification to a user’s pre-registered device - typically a mobile or tablet - from which a user can immediately allow or deny account access via the simple press of a button. +* Time-based One-Time Password (TOTP): allows you to register a device - such as Google Authenticator - that will generate a one-time password which changes over time and which can be entered as the second factor to validate a user’s account. +* SMS: for sending a one-time code over SMS which the user is then prompted to enter before they can finish authenticating. +* Voice: for delivering a one-time code through a phone call which the user is then prompted to enter before they can finish authenticating. +* Duo: allows you to use your Duo account for multi-factor authentication. +* Email: allows you to use your email account for multi-factor authentication. + +Whilst MFA workflow using technologies such as Guardian or Google Authenticator is typically provided via a separate application that runs on a mobile or tablet device, if you don’t want your customers to have to download a separate application Auth0 also provides you with an SDK that you can use to build second factor workflow right in your existing mobile device application(s). diff --git a/articles/architecture-scenarios/_includes/_authentication/_social-authentication.md b/articles/architecture-scenarios/_includes/_authentication/_social-authentication.md new file mode 100644 index 0000000000..262ba3477c --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_social-authentication.md @@ -0,0 +1,13 @@ +The “bring your own identity” scenario offered by Facebook, Google, etc., is a valuable way of simplifying the user authentication experience without compromising security, and using [Universal Login](#universal-login) makes it easy to start adding support for [Social Connections](/connections/identity-providers-social) with minimal disruption. + +::: warning +Auth0 provides a simple way to test social connections using [pre-configured developer keys](/connections/social/devkeys). However, these have [limitations](/connections/social/devkeys#limitations-of-developer-keys), and before going into production, you’ll need to set up your own application-specific keys by following the [instructions](/connections/identity-providers-social) for your chosen social provider(s). +::: + +With [social](https://auth0.com/learn/social-login/) support, user identities and credentials are managed by the social provider, as are certain identity claims—which Auth0 will use to populate the user [profile](/architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt). Auth0 can also provide access to Social Identity Providers' (Social IdPs') [Access Tokens](/tokens/overview-idp-access-tokens), so that your application can also call 3rd-party Social IdP APIs on behalf of the user. + +::: panel Best Practice +Social is a great feature to provide, but when you offer more than one way to sign in, you need to consider the possibility that your customers will actually use more than one way to sign in. By default, every user identity in Auth0 has its own user profile, so you’ll probably want to consider Auth0's capability to [link user accounts](/users/concepts/overview-user-account-linking) to provide an effective way of associating one user profile with multiple identities. +::: + +Auth0 [Custom Social Connections](/connections/social/oauth2) extend social authentication even further by allowing you to connect with any OAuth2 identity provider not supported out-of-box. For example, support for the government-issued-identity provider [SwissID](https://www.swissid.ch/) can be configured in Auth0 by using a Custom Social Connection. diff --git a/articles/architecture-scenarios/_includes/_authentication/_sso-legacy.md b/articles/architecture-scenarios/_includes/_authentication/_sso-legacy.md new file mode 100644 index 0000000000..58df288183 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_sso-legacy.md @@ -0,0 +1,10 @@ +In a large scale re-structure it's not always possible—or practical—to update all your applications at once. In fact, our recommended best practice is to plan for an iterative-style approach when it comes to integrating with Auth0. If your applications already participate in Single Sign-on (SSO), and your legacy identity system supports protocols such as OIDC or SAML, then you have a couple of options available if you want to continue to provide SSO as you integrate with Auth0: + +* Update your existing identity provider in your legacy SSO system to redirect to Auth0 for login (e.g., using [SAML](/protocols/saml/saml-configuration/auth0-as-identity-provider)), or +* Have Auth0 redirect to your legacy SSO system to login. This requires configuring your legacy system as an IdP in Auth0 (i.e., either using [SAML](/protocols/saml/saml-configuration/auth0-as-service-provider) or [OIDC](/connections/social/oauth2)). + +::: panel Best Practice +Supporting an SSO experience with your legacy system can add complexity, but may be worth it to generate a more seamless user experience as you integrate with Auth0. If you intend to go down this path, planning for it early can help ensure that it is possible to achieve. If you don't already have SSO at a centralized service, then the complexity to add it will unlikely be worth the benefits. +::: + +This is a complex topic that will likely need some additional investigation depending on your current legacy architecture, and we recommend you only look into this if you currently have SSO support in your legacy system. Note: if you are currently redirecting from your applications to a centralized system to authenticate your users and that system only asks for credentials if you don’t already have a session with the centralized system, then you have a legacy SSO implementation. diff --git a/articles/architecture-scenarios/_includes/_authentication/_universal-login.md b/articles/architecture-scenarios/_includes/_authentication/_universal-login.md new file mode 100644 index 0000000000..57dc6a92d7 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_universal-login.md @@ -0,0 +1,11 @@ +Do you have, or will you have, more than one application in your system? If the answer to this question is yes, then you will want a centralized sign in experience. To achieve a seamless Single Sign-on (SSO) experience between multiple applications, it is critical to have a centralized location to redirect your users for authentication. This allows you a way to provide your users with a consistent experience if you add social authentication in the future, add third party applications to your system, or add multi-factor authentication as an option (or requirement) for your users - and also allow you to take advantage of new features for improving your users’ experience with little, if any, added development effort. + +::: panel Best Practice +If you have more than one application, the best practice is to redirect to a [centralized location](/universal-login) to authenticate the user. With Auth0, this means taking advantage of [Universal Login](/universal-login), which provides many security and user experience benefits out-of-the-box, including [SSO](/sso/current). +::: + +Auth0 Universal Login makes authenticating users a short, easy process which can be accomplished in three easy steps (all of our Quickstarts demonstrate this and our SDKs hide the complexity for you too): + +1. Determine how and when you want to [redirect from your application](#application-integration). +2. Set up the appropriate [branding](/architecture-scenarios/implementation/${platform}/${platform}-branding) and/or customized HTML in your Auth0 configuration. +3. Set up your application to [receive and handle the response](#application-integration) from the Authorization Server. diff --git a/articles/architecture-scenarios/_includes/_authentication/_username-and-password-authentication.md b/articles/architecture-scenarios/_includes/_authentication/_username-and-password-authentication.md new file mode 100644 index 0000000000..6668a0c76d --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authentication/_username-and-password-authentication.md @@ -0,0 +1,9 @@ +Nearly every B2C application provides the ability for their customers to create a new set of credentials. This is a common form of authentication that all users are familiar with. + +Username password authentication comes in multiple flavors at Auth0. If your application is a green-field application with no existing user base, then a simple Auth0 out-of-the-box [Database Connection](/connections/database) will give you everything you need to start authenticating your users. However, if you have a legacy user store (such as your own database of users or an existing LDAP system) you have a couple of different options for migrating your users as discussed in our guidance on [User migration](/architecture-scenarios/implementation/${platform}/${platform}-provisioning#user-migration). + +However you end up provisioning the users for your database connection, the authentication of those users is quite similar. It requires you to present users with a form to enter their username and password. As mentioned in the guidance concerning [Universal Login](#universal-login), the simplest and safest way to authenticate users with a username and password is to redirect them to a centralized login page and collect their username and password there. This allows Auth0 to determine whether they have already authenticated and skip the login form entirely when it's not needed. + +::: panel Best Practice +Collecting credentials only at the centralized login page will reduce the surface area for potential leak of user secrets. It will also reduce the need to collect credentials unnecessarily. See [Universal Login](#universal-login) for more information. +::: diff --git a/articles/architecture-scenarios/_includes/_authorization/_api-integration.md b/articles/architecture-scenarios/_includes/_authorization/_api-integration.md new file mode 100644 index 0000000000..879f473836 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authorization/_api-integration.md @@ -0,0 +1,37 @@ +In this scenario your Auth0 tenant can provide an OAuth2 [Access Token](/tokens/concepts/access-tokens), typically expressed as a [JWT](/tokens/concepts/jwts), which [can be used by your API to restrict access to certain parties](/api-auth). In addition, Auth0 provides support for what is notionally described as both [First-Party and Third-Party Applications](/applications/concepts/app-types-first-third-party). + +Acting as the authorization server, and with the consent of the user (the resource owner), your Auth0 tenant can be used to provide an Access Token - typically expressed as a [JWT](/tokens/concepts/jwts) - to an application (client) so that it can access a protected resources hosted by a resource server on behalf of the resource owner. The issued Access Token is typically passed as the Bearer token in the HTTP Authorization header sent to an API. + +Whether you have a single API, or perhaps a suite of logically related [microservice APIs](/api-auth/tutorials/represent-multiple-apis), you can leverage the Access Tokens that Auth0 provides in order to secure access to your service(s). Though relatively easy to set this up in the [Auth0 Dashboard](/apis) or through the [Auth0 Management API](/api/management/v2#!/Resource_Servers/post_resource_servers), it's important to review the different application scenarios and API layouts to determine the best architecture for your system. + +::: note +OAuth2 Access Tokens are primarily designed for use in securing public facing APIs; when expressed as a JWT, an Access Token is a self contained entity which can be verfied without the need to make any additional 3rd party API call. If your APIs do not fall into this category - i.e they are part of an application itself (as in only called by that application) or are sat behing your firewall - then protecting them with tokens may well be overkill, and your existing cookie based (et al) workflow may well suffice. +::: + +OAuth2 was designed specifically with third-party access in mind, For example, a scenario might be that a user (resource owner) wants to use an application (a client) that does not belong to the same organization as the service that provides the user's data (the reseource server). In this case, when the application needs to access data that the user owns, it redirects to the organization where the user’s data resides, which in turn authenticates the user and then prompts the user to give the application permission to access their data. This prompting for permission is referred to as providing *[consent](/api-auth/user-consent)* and is a large part of what providing support for [third party applications](/scopes/current/api-scopes#example-an-api-called-by-a-third-party-application) entails. If you are planning to integrate third-party applications, then it's important you [mark them as third-party](/api-auth/user-consent) early on so that Auth0 will handle prompting for user consent. + +On the other hand, if your organization *owns* the application(s), the user data itself and the API(s) through which that data is accessed, then consent is not typically required as the interactions are all [first-party](/scopes/current/api-scopes#example-an-api-called-by-a-first-party-application). If you're only creating first-party applications, then you can ensure that you are not presenting your users with any unnecessary consent screen(s) by [allowing user consent to be skipped](/apis#api-settings) as part of any resource service definition. + +::: warning +Though you can configure your applications to be first-party and subsequently configure your APIs to allow first-party clients to ignore consent, if you are using `localhost` then Auth0 cannot verify that the application is truly a first-party app so your users will be prompted for consent anyway. To work around this constraint, when testing on your local machine during development, create a [fake local hostname and use that instead](https://community.auth0.com/t/how-do-i-skip-the-consent-page-for-my-api-authorization-flow/6035). +::: + +Alternatively, you may have data relating to a user for which additional [functionality is provided](/scopes/current/api-scopes#example-an-api-called-by-a-back-end-service) and for which explicit user consent cannot be obtained (i.e. there is no authenticated user who can provide it). In this scenario, a [list of applications for which Client Credentials grant is enabled](/flows/concepts/client-credentials) can be defined. + +### Access Token claims + +As is the case with ID Tokens, you can [add custom claims to Access Tokens](/scopes/current/sample-use-cases#add-custom-claims-to-a-token) using Auth0 Rule extensibility. Once added, your API can then verify an Access Token for the necessary claims and either allow or prevent access to certain functionality as required. + +::: panel Best Practice +When you are considering adding custom claims, we recommend that you store any access control data you may need to include within claims as part of the user's [`app_metadata`](/users/concepts/overview-user-metadata). Firstly, this prevents you from needing to call an external API to fetch the data, which can negatively impact performance and scalability. Secondly `app_metadata` **cannot** be modified by a user - so the user cannot directly circumvent any access control restrictions by modifying their own metadata. Also remember to check out our [metadata best practices](architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt#metadata) guidance too. +::: + +### Access Token scopes + +[OAuth2 Scopes](/scopes/current/api-scopes) are typically used as the mechanism by which an API can determine what actions can be performed on behalf of a user. Scopes can be added on a per API basis to [define specific access permissions](/dashboard/guides/apis/add-permissions-apis) in the Auth0 Dashboard or through the Auth0 Management API). Scopes can also be manipulated via Auth0 extensibility (e.g. via a Rule, as in this [example](/architecture-scenarios/spa-api/part-2#create-a-rule-to-validate-token-scopes)). The scopes an application requests for accessing an API should depend on what functionality the application needs the user to give permission for the application to use. Once the requested scopes are authorized, they will be returned in the Access Token which can be subsequently verified by said [API](/tokens/guides/validate-access-tokens). A good example of this is when you log in to an application that is using a social provider for login: the social provider API requires that the application specifies whether the user will want the application to post items on your behalf. This allows the user to accept or deny this request. This example demonstrates how the user is delegating permission to the application - which is different than the API restricting access based on a user's role, and should be handled differently. + +::: panel Best Practice +Even though you have the ability to fully manipulate Access Token Scopes via Auth0 extensibility, as a security best practice you should only remove scopes which are not authorized and refrain from adding scopes that were not requested. +::: + +Though scopes are often used as a way to enforce access permissions for a user, there are situations where it can become tricky when you use them in this manner. We therefore recommend that you use scopes for their intended purpose (i.e. delegating permission to an application) and use [custom claims](#access-token-claims) for your role-based or other access control scenarios. diff --git a/articles/architecture-scenarios/_includes/_authorization/_application-integration.md b/articles/architecture-scenarios/_includes/_authorization/_application-integration.md new file mode 100644 index 0000000000..bf785f09e1 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authorization/_application-integration.md @@ -0,0 +1,17 @@ +In this scenario, your Auth0 tenant provides a token as an indicator of authorized access to an application. For applications utilizing [OpenID Connect (OIDC)](/protocols/oidc), the industry-standard protocol we typically find most utilized when it comes to customer facing applications, this would be an ID Token expressed as a [JWT](/tokens/concepts/jwts). + +### ID Token claims + +Using Rule extensibility, Auth0 allows you to easily [add custom claims to an ID Token](/scopes/current/sample-use-cases#add-custom-claims-to-a-token) based on, for example, a user’s [Metadata](/users/concepts/overview-user-metadata) content. Your application can then verify the ID Token for the necessary claims, and either allow or prevent access to certain functionality as required. Note that though the process of adding custom claims via Rule is streamlined, the Rule engine is flexible and allows you to write custom code that may have negative effects. Therefore it’s important to follow our [rules best practice](/best-practices/rules) guidance anytime you use this extensibility feature. + +::: panel Best Practice +When you are considering adding custom claims, we recommend that you store any access control data you may need to include within claims as part of the user's [`app_metadata`](/users/concepts/overview-user-metadata). Firstly, this prevents you from needing to call an external API to fetch the data, which can negatively impact the performance and scalability of the login sequence. Secondly `app_metadata` **cannot** be modified by a user - so the user cannot directly circumvent any access control restrictions by modifying their own metadata. Also remember to check out our [metadata best practices](architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt#metadata) guidance too. +::: + +<% if (platform === "b2b") { %> +If you are creating different instances of your application for your customer organizations, a common practice is to create a custom claim in your ID token to represent the user's organization. For example, `context.idToken["http://yourdomain.com/claims/organization"]= "organization A";` +<% } %> + +### ID Token scopes + +[OIDC Scopes](/scopes/current/oidc-scopes) are typically used by an application to obtain consent for authorized access to a user's details during authentication. Each of the pre-defined scopes returns the set of [standard claims](/scopes/current/oidc-scopes#standard-claims) where defined, and as described in the [OIDC specification](https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims). The scopes an application requests depend on which user attributes the application needs. Once the requested scopes are authorized by the user, the claims are returned in the ID Token and are also made available via the [/userinfo](https://auth0.com/docs/api/authentication#get-user-info) endpoint. diff --git a/articles/architecture-scenarios/_includes/_authorization/_introduction.md b/articles/architecture-scenarios/_includes/_authorization/_introduction.md new file mode 100644 index 0000000000..b1720ae98f --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authorization/_introduction.md @@ -0,0 +1,47 @@ +Let's start by taking a step back and talking about Access Control. There isn't one clear cut definition of Access Control in the industry, but if you spend some time searching and reading you'll see that most authoritative sources agree that it is the umbrella concept that puts all of Authentication, Authorization, Consent, and Policy Enforcement together to ensure that only the right people and services have access to your applications and APIs. Next, let's look more closely into the distinctions between Authentication, Authorization, Consent, and Policy Enforcement. Your Auth0 tenant (your Authorization Server) is typically responsible for Authentication and Consent, and some or all of Authorization and Policy Enforcement. Additionally, an Application or API itself almost always is the primary enforcer of policies, especially where contextual access is required: + +* **Authentication**: the process of determining if a principal (a user or application) is who or what they say they are. +* **Authorization**: the process of determining what is allowed, based on the principal, what permissions they have been given, and/or the set of contextually specific access criteria. +* **Consent**: what permissions the user (Resource Owner) has given permission to an application to do on its behalf. This is generally a requirement of delegated authorization. The user has to give permission to the Client to access the user's data in a different system. +* **Policy Enforcement**: The act of enforcing the policies of the application or API, rejecting or allowing access based on a user's authentication and/or authorization information. + +In general we typically group different types of access control into three distinct categories so that it's easier to understand a) which actor is responsible for storing the information, b) which actor is responsible for making decisions, and c) which is responsible for enforcing the restrictions. + +* The first category is where access is either granted or denied to an application or an API in its entirety. Both the data required to enforce this and the enforcement process is typically defined in the context of the Authorization Server For example, by using [`app_metadata`](/users/concepts/overview-user-metadata) associated with a user and a [Rule](/rules) defined in your Auth0 tenant. + +* The second category is where access is either granted or denied to a specific subset of application or API functionality. The data required to enforce this is typically stored in the Authorization Server For example, by using [`app_metadata`](/users/concepts/overview-user-metadata) on a user in your Auth0 tenant with the enforcement process performed in the application or API itself. In this scenario, the data is typically communicated as one or more custom claims in an [`id`](/tokens/concepts/id-tokens) or [`access`](/tokens/concepts/access-tokens) token. + +* The third category is where access is either granted or denied depending on what the principal (subject) can operate on within the context of an application or API. Both the data required to enforce this, and the enforcement process is typically defined in the context of the application or API. In this scenario, the data communicated as one or more custom claims in an [`id`](/tokens/concepts/id-tokens) or [`access`](/tokens/concepts/access-tokens) token may be consumed with or without data from an external source that is not Auth0. + +In addition, Role-based Access Control (RBAC) and Attribute-based Access Control (ABAC) mechanisms can be applied in any of the Access Control categories described above. Whatever your use case then, there are a number of things you will want to consider when looking at the functionality and workflow you require: + +* Are there scenarios where access to an entire application or API should be rejected? +* Will you be providing APIs that can be accessed by third-party applications? +* Will your APIs also be accessed by your own (first-party) applications? +* Will your application be calling a third-party API? +* Should your applications and/or APIs be enforcing access control based on user claims? +<% if (platform === "b2b") { %> +* What if I need to know which organization an access token or id token is associated with? +<% } %> + +Auth0 supports access restriction for either applications or APIs based on certain conditions. In certain scenarios, you may want to create a [Rule](/rules) that returns an `UnauthorizedError` when, for example, a user attempts access to an application or an API at an incorrect time (as described in this [example](/authorization/concepts/sample-use-cases-rules#allow-access-only-on-weekdays-for-a-specific-application)) - or if the user doesn’t have the right claim(s) contained in their [`app_metadata`](/users/concepts/overview-user-metadata). For an _application_ using [OpenID Connect (OIDC)](/protocols/oidc), this would prevent the allocation of the [ID Token](/tokens/concepts/id-tokens) used to authorize access. Similarly, for an _API_, allocation of any OAuth2 [Access Token](/tokens/concepts/access-tokens) (used when calling the API), could be prevented as described in this [example](/api-auth/restrict-access-api#example-deny-access-to-anyone-calling-the-api). + +::: panel Best Practice +In the main, we have found that [OIDC](/protocols/oidc) is the most commonly used industry-standard protocol used by Auth0 customers when it comes to authentication in their applications. We have also found that, even though [OAuth2](protocols/oauth2) was created as a delegation protocol, it is commonly used within first party applications when there is an API that does not have a shared session with the application. +::: + +Auth0 also can provide the information needed so that an application can enforce restrictions. For [application level integration](#application-integration), Auth0 allows you to add [custom claims](#id-token-claims) to an ID Token, which your application can then verify and subsequently use to perform policy enforcement. In this case you will need to decide what information you require for your application to make enforcement decisions. If you need to make decisions at an API instead of in your application, you will likely need to use an Access Token instead of an ID token. Continue reading for more information. + +::: warning +When deciding what data to include in your ID token and/or access token, consider token size, especially if you are passing the token in the URL. Even if you are not passing tokens in the URL, you will also need to consider the potential of exposing sensitive PII (Personally Identifiable Information). Token information is not encrypted, so although it isn't generally a security issue for an ID token to be leaked, it can become a privacy issue depending on the data that is included in the token. +::: + +For [API level integration](#api-integration), Auth0 supports both [custom claims](#access-token-claims) as well as [scope](#access-token-scopes) re-configuration, both within the context of an Access Token. Again, you will need to decide what information will be required in order for your API to make access decisions, and your API will need to enforce that by validating the contents of the Access Token. + +::: panel Best Practice +When deciding whether you should use permissions through custom claims or scopes, you should make sure you understand the nature and purpose of scopes. +::: + +<% if (platform === "b2b") { %> +For multi-organization scenarios, it can often be important to know which organization an access token (or even an ID token) applies to. Taking care to follow the [best practices](#organization-data-in-an-access-token) can save you time and effort. +<% } %> diff --git a/articles/architecture-scenarios/_includes/_authorization/_m2m.md b/articles/architecture-scenarios/_includes/_authorization/_m2m.md new file mode 100644 index 0000000000..f22d07cc27 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authorization/_m2m.md @@ -0,0 +1,13 @@ +There are many scenarios that require an application _without_ any user-interactive session to obtain an access token in order to call an API. In such scenarios you must authenticate the client instead of the user, and OAuth 2 provides the [client credentials](/flows/concepts/client-credentials) grant type to make this easy to achieve. Some common examples of where this is required include: +* A cron job or other service that needs to communicate with your API (e.g. where a daily report needs to be generated and emailed it to an administrator). +* A separate API the supports privileged access (e.g. the API is not exposed to users directly, but instead to a backend only). +* In certain microservice architectures, where some API layers need to communicate to other API layers without a user involvement, or after a user token has expired. +* A privileged API that may need to be called before a user has authenticated (i.e. from a rule or custom DB script in your Auth0 tenant) + +::: panel best practice +Traditionally, a special "service account" would have been created in order to cater for these scenarios: a user with a username and password that was configured for services which supported non-interactive use cases. That is no longer a recommended approach for many reasons, and the current best practice is to use [OAuth 2.0 Client Credentials Grant](/flows/concepts/client-credentials) in these situations. +::: + +::: warning +Though the [Client Credentials Exchange Hook](/hooks/extensibility-points/client-credentials-exchange) in Auth0 can be used to add custom claims, it's important to consider the purpose for which a token was requested and to avoid extending use of the token beyond its intended purpose. Doing otherwise can result in the creation of unintended attack vectors for attackers to exploit. +::: diff --git a/articles/architecture-scenarios/_includes/_authorization/_rbac.md b/articles/architecture-scenarios/_includes/_authorization/_rbac.md new file mode 100644 index 0000000000..68df646d59 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_authorization/_rbac.md @@ -0,0 +1 @@ +Auth0 has out-of-box support for Role Based Access Control ([RBAC](/authorization/concepts/rbac)). RBAC refers to assigning permissions to users based on their _role_ within an organization, and provides for simpler access control by offering a more manageable approach that is less prone to error. \ No newline at end of file diff --git a/articles/architecture-scenarios/_includes/_base-intro.md b/articles/architecture-scenarios/_includes/_base-intro.md new file mode 100644 index 0000000000..2dfc169d6e --- /dev/null +++ b/articles/architecture-scenarios/_includes/_base-intro.md @@ -0,0 +1,5 @@ +Customers using Auth0 for <% if (platform === "b2c") { %>Business-to-Consumer (B2C)<% } else { %>Business-to-Business (B2B)<% } %> projects typically share a common set of goals and objectives, and in the sections that follow we'll focus on our real-world customer implementation experiences to help you deliver your solution efficiently. + +::: panel Best Practice +Auth0 provides recommendations and best practice suggestions in an *ad hoc* way throughout this guide in panels like this one. You can also obtain detailed guidance regarding specific functionality by speaking with your account representative or a member of our Auth0 [Professional Services](/services) team. +::: diff --git a/articles/architecture-scenarios/_includes/_base-ways-to-integrate.md b/articles/architecture-scenarios/_includes/_base-ways-to-integrate.md new file mode 100644 index 0000000000..7089399c48 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_base-ways-to-integrate.md @@ -0,0 +1 @@ +There are many different ways Auth0 can be integrated into the <% if (platform === "b2c") { %>CIAM<% } else { %>B2B IAM<% } %> project architecture. Auth0's flexibility comprehensively supports many different use cases however your project may not require all of the capabilities provided by Auth0. Knowing what, when, and how best to implement something will help you focus on completing the necessary tasks at the right time. \ No newline at end of file diff --git a/articles/architecture-scenarios/_includes/_branding/_custom-domain-naming.md b/articles/architecture-scenarios/_includes/_branding/_custom-domain-naming.md new file mode 100644 index 0000000000..ae02a82b67 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_branding/_custom-domain-naming.md @@ -0,0 +1,15 @@ +By default, the URL associated with your tenant will include its name and possibly a region-specific identifier. For example, tenants based in the US have the a URL similar to `https://example.auth0.com` while those based in Europe have something that is of the fashion `https://example.eu.auth0.com`. A [Custom Domain](/custom-domains) offers a way of providing your users with a consistent experience by using a name that’s consistent with your organization's brand. + +::: warning +Only one custom Domain Name can be applied per Auth0 Tenant, so if you absolutely must have independent domain name branding then you will require an [architecture](/architecture-scenarios/implementation/${platform}/${platform}-architecture) where multiple Auth0 Tenants are deployed to production. +::: + +In addition, Custom Domain functionality offers you complete control over the [certificate management](/custom-domains#certificate-management) process. By default, Auth0 provides standard SSL certificates, but if you configure a custom domain, you can use Extended Validation (EV) SSL certificates or similar to provide the visual, browser-based cues that offer your visitors additional peace of mind. + +In general, we see customers having the most success when they use a centralized domain for authentication - this is especially the case if the company offers multiple products or service brands. By using a centralized domain, you can provide end users with a consistent user experience while also minimizing the need to maintain multiple production tenants in Auth0. + +<% if (platform === "b2b") { %> +::: warning +If your customer organizations will be isolated from each other, and you require that users are presented a login page for each organization via a custom domain URL, then your only option is to create a [separate tenant for each organization](/architecture-scenarios/${platform}/${platform}-architecture#tenant-provision-for-complex-organizations). +::: +<% } %> diff --git a/articles/architecture-scenarios/_includes/_branding/_email-templates.md b/articles/architecture-scenarios/_includes/_branding/_email-templates.md new file mode 100644 index 0000000000..3b3dccdf63 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_branding/_email-templates.md @@ -0,0 +1,9 @@ +Auth0 makes extensive use of email to provide both user notifications and to drive the functionality needed for secure identity management (for example, email verification, account recovery, and brute force protections), and Auth0 provides a number of templates for these. + +::: note +Before customizing email templates, please set up your [Email Provider](/architecture-scenarios/implementation/${platform}/${platform}-operations#email-provider-setup). +::: + +Out of the box, the email templates used contain standard verbiage and Auth0 branding. However, you can configure almost every aspect of these templates to reflect the verbiage and user experience you want and make changes to things like the preferred language, accessibility options, and so forth. + +Email templates are customized using [Liquid syntax](/email/liquid-syntax). If you are interested in customizing your templates based on user preferences, you will also have access to the [metadata](/users/concepts/overview-user-metadata) located in users' profiles, as well as any specific application metadata too. diff --git a/articles/architecture-scenarios/_includes/_branding/_error-page.md b/articles/architecture-scenarios/_includes/_branding/_error-page.md new file mode 100644 index 0000000000..4f74e4757a --- /dev/null +++ b/articles/architecture-scenarios/_includes/_branding/_error-page.md @@ -0,0 +1,5 @@ +If there are issues encountered during user interactive workflow (e.g. user sign up or login), Auth0 provides error messages that indicate what the problem is under the hood. The default messages are somewhat cryptic, especially to the end user, since they will likely be missing context that only you can supply. As such, we recommend [customizing your error pages](/universal-login/custom-error-pages) to provide the missing context-specific information directly to your users. Furthermore, customizing your error pages allows you to display your branding, not Auth0's, as well as provide useful information to your users as to what should be done next. This information might include a link to a FAQ or how to get in touch with your company's support team or help desk. + +::: panel Best Practice +Out-of-the-box there is no user interface for customizing Auth0 provided error pages, but you can use the [Tenant Settings endpoint of the Management API](/api/management/v2#!/Tenants/patch_settings) to configure them. Alternatively, if you can create and host your own error page, then you can have Auth0 direct users to that page instead of using the Auth0-hosted option. +::: diff --git a/articles/architecture-scenarios/_includes/_branding/_guardian.md b/articles/architecture-scenarios/_includes/_branding/_guardian.md new file mode 100644 index 0000000000..99b6009f56 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_branding/_guardian.md @@ -0,0 +1,3 @@ +The Multi-factor Authentication pages can be customized by adjusting the Universal Login branding options in the [Universal Login Settings](${manage_url}/#/login_settings) section. + +If you need further customization, you can also customize [the full HTML content](/universal-login/multifactor-authentication#customizing-the-html-for-the-mfa-page) to reflect your organization's particular UX requirements. diff --git a/articles/architecture-scenarios/_includes/_branding/_introduction.md b/articles/architecture-scenarios/_includes/_branding/_introduction.md new file mode 100644 index 0000000000..387c2dc354 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_branding/_introduction.md @@ -0,0 +1,35 @@ +Auth0 can be customized with a look and feel that aligns with your organization's brand requirements and user expectations. Branding Auth0 collateral provides a consistent user experience for your customers, and gives them peace of mind that they’re using a product from a trusted and secure provider. + +Auth0 provides support for [internationalization (I18N)](/i18n) and localization (L10N), both of which are important if you work on branding for an international clientele. Out-of-box collateral, such as the Auth0 Lock UI widget, comes ready enabled for multiple language support, with built-in extensibility for adding more languages if what you require [doesn’t already exist](/libraries/lock/v11/i18n). + +::: panel Best Practice +Almost all applications need Internationalization and/or Localization in one form or another. Auth0 makes it easy to add, but you need to account for it up front: retro-fitting localization, for example, can be a painful process if left too late. +::: + +When considering the items you want to brand, as well as how best to brand them, there are a number of things you'll want to review: + +* Do you need to brand your login page? +* Do you need to localize your login page? +<% if (platform === "b2b") { %> +* If you are sharing an Auth0 tenant across customer organizations, should you add organization-specific branding to their login experience? +<% } %> +* How can you customize emails so that they're not just branded, but vary based on user preference? +* How will users know that they're still on your domain when they see your login page? +* What do you need to do to provide additional browser security (e.g., implement Extended Validation)? +* Where do you want to direct users in the event of errors? + +Auth0 provides tremendous flexibility when it comes to customizing and configuring Auth0 pages such as [Universal Login](#universal-login-and-login-pages) and [Password Reset](#password-reset-page-customization). So you can pretty much set up whatever UX look and feel you require. For many, the out-of-the-box experience - with perhaps a little alteration - is all that's required. However, for others the value of their brand and brand awareness requires more extensive customization. This flexibility extends to not only Auth0 pages, but via extensibility can also be applied to the [email templates](/architecture-scenarios/implementation/${platform}/${platform}-branding#email-template-customization). Auth0 [Custom Domain](/architecture-scenarios/implementation/${platform}/${platform}-branding#custom-domain-naming) functionality further enhances consumer awareness by providing users with the confidence and peace of mind when it comes to safety and security. + +<% if (platform === "b2b") { %> +If you are sharing an Auth0 tenant across multiple customer organizations, providing each organization with their own domain of users and managing their credentials, you will need to consider how each user will know which credentials they should use and how they will trust that they are entering them somewhere safe and secure. See [Branding login by organization](#branding-login-by-organization) for details. +<% } %> + +While Auth0 provides for default information when it comes to error situations, out-of-the-box information can be somewhat cryptic as the context that can only be provided by you is missing. Auth0 [error page customization](/architecture-scenarios/implementation/${platform}/${platform}-branding#error-page-customization) guidance can however help mitigate that by allowing you to provide information of a more context-specific nature via your own support organization. + +::: panel Best Practice +To provide helpful resources for users who experience problems, you should also configure a friendly name and a logo, as well as provide the support email address and URL for your organization. To learn how, see [Dashboard Tenant Settings](/dashboard/reference/settings-tenant#settings). +::: + +::: panel Get Started with Auth0 Videos +Watch three short videos—[Brand: How It Works](/videos/get-started/07_01-brand-how-it-works), [Brand: Signup and Login Pages](/videos/get-started/07_02-brand-signup-login-pages), and [Brand: Emails and Error Pages](/videos/get-started/08-brand-emails-error-pages)—to learn how branding works with Auth0, how to use Auth0’s Universal Login feature to customize your sign up and login pages, and how to use Auth0 email templates and make changes to the reply email address, subject, redirect URL, and URL lifetime. +::: diff --git a/articles/architecture-scenarios/_includes/_branding/_password-reset.md b/articles/architecture-scenarios/_includes/_branding/_password-reset.md new file mode 100644 index 0000000000..c3b0785c61 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_branding/_password-reset.md @@ -0,0 +1,8 @@ +The [Password Reset](/universal-login/password-reset) page is used whenever a user takes advantage of password change functionality and, as with the login page, you can [customize it](/universal-login/password-reset#edit-the-password-reset-page) to reflect your organization's particular branding requirements. + +<% if (platform === "b2b") { %> +If your organization users will all be isolated from each other (i.e, each organization gets its own Auth0 [database connection](/connections/database)), and you are branding the [Universal Login](#universal-login-and-login-pages) pages by organization, then it's also important to brand things like the [password reset](/universal-login/password-reset) page so users know for which organization the password change is occurring. This can be done in a couple of ways: + +* Create JavaScript on the Password Reset page that can pull resources from a CDN based on the connection parameter that indicates from which organization the user is coming. +* Create a separate tenant for an organization and use Universal Login to customize what is required for that organization. +<% } %> diff --git a/articles/architecture-scenarios/_includes/_branding/_universal-login.md b/articles/architecture-scenarios/_includes/_branding/_universal-login.md new file mode 100644 index 0000000000..69e2691da7 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_branding/_universal-login.md @@ -0,0 +1,5 @@ +[Universal Login](/universal-login) is the recommended method for authenticating users, and it centers around use of the Login page. You can customize the Login page to support your organization's [branding requirements](/universal-login#customizing-universal-login). + +::: panel Best Practice +If you choose to customize the Universal Login page script, we strongly recommend that you make use of version control. To do this, you should deploy the script to your Auth0 tenant via [deployment automation](/architecture-scenarios/implementation/${platform}/${platform}-deployment) or via one of the [alternative strategies](/universal-login/version-control). +::: diff --git a/articles/architecture-scenarios/_includes/_deployment/_introduction.md b/articles/architecture-scenarios/_includes/_deployment/_introduction.md new file mode 100644 index 0000000000..c301f040e3 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_deployment/_introduction.md @@ -0,0 +1,31 @@ +In addition to adopting best practices for change management and [QA](/architecture-scenarios/implementation/${platform}/${platform}-qa), successful customers will also integrate Auth0 collateral management as part of some automated deployment process. As discussed in the Architecture section under [SDLC support](/architecture-scenarios/implementation/${platform}/${platform}-architecture#sdlc-support), you will want to ensure you configure separate Auth0 tenants for development, testing, and production environments, and you will want that configuration to be almost identical for the tenant in each environment. Using deployment automation helps ensure this, so that each environment tenant is configured the same, and you will be less likely to see bugs show up as a result of mismatched configurations between environments. + +::: panel Best Practice +However you configure deployment automation, we’d recommend you unit test your rules, custom DB scripts, and hooks prior to deployment, and run some integration tests against your tenant post-deployment too. For more details regarding this, see the [Quality Assurance](/architecture-scenarios/implementation/${platform}/${platform}-qa) guidance provided. +::: + +Auth0 provides support for a couple of different options when it comes to the deployment automation approaches you can use, and each can be used in conjunction with the other if desired: + +* The [Auth0 Deploy CLI tooling](/extensions/deploy-cli) provides you with an easy-to-use script that can help you integrate with your existing Continuous Integration/Continuous Deployment (CI/CD) pipeline. +* If you can’t integrate directly with, or for some reason you don’t have a CI/CD pipeline, then the Auth0 [Source Control Extensions](/extensions#deploy-hosted-pages-rules-and-database-connections-scripts-from-external-repositories) can provide an easy-to-set-up basic automation process with very low maintenance. + +::: warning +Note that both the Deploy CLI Tool and source control extensions can cause destructive changes; manual changes made directly in the dashboard between automated deployments could be lost! For this reason, if either is used, then **all** changes should be deployed from the source control subsystem referenced via the tooling and not made manually. +::: + +Each environment may also need some environment-specific configuration--Application Client ID’s and Client Secrets will be different between the Auth0 tenants, for example--so you’re going to want some way of being able to dynamically reference this rather than having hard-coded values. Auth0 provides support for handling environment-specific configuration information through one of the following two approaches: + +* Use [Tenant Specific Variables](#tenant-specific-variables) +* Use [keyword replacement](extensions/deploy-cli/references/environment-variables-keyword-mappings) if using the Auth0 Deploy CLI tool + +## Tenant specific variables + +Auth0 allows you to configure variables that are available from within custom [extensibility](/topics/extensibility); these can be thought of as environment variables for your Auth0 tenant. Rather than hard code references that change when moving code between development, test, and production environments, you can use a variable name that is configured in the tenant and referenced by the custom extensibility code. This makes it easier for the same custom code to function, without changes, in different tenants as the code can reference variables which will be populated with tenant-specific values at execution time: + +* For use of variables in Rules, see how to [configure values](/rules/guides/configuration#configure-values) +* For use of variables in Hooks, see how to configure [secrets](/hooks/secrets) in the editor +* For use of variables in Custom DB Scripts, see the [configuration parameters](/connections/database/custom-db/create-db-connection#step-3-add-configuration-parameters) + +::: panel Best Practice +It’s a recommended best practice to use variables to contain tenant-specific values as well as any sensitive secrets that should not be exposed in your custom code. If your custom code is deployed in GitHub/Gitlab/Bitbucket/VSTS, then using a tenant-specific variable avoids exposure of sensitive values via your repository. +::: diff --git a/articles/architecture-scenarios/_includes/_implementation-checklists.md b/articles/architecture-scenarios/_includes/_implementation-checklists.md new file mode 100644 index 0000000000..c4624b459c --- /dev/null +++ b/articles/architecture-scenarios/_includes/_implementation-checklists.md @@ -0,0 +1,13 @@ +Use the links below to download a spreadsheet that includes tasks for each phase of an Software Development Lifecycle (SDLC) project. + +Analyze Checklist + +Design Checklist + +Build Checklist + +Test Checklist + +Deploy Checklist + +Monitor Checklist diff --git a/articles/architecture-scenarios/_includes/_keep-reading.md b/articles/architecture-scenarios/_includes/_keep-reading.md new file mode 100644 index 0000000000..9697768911 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_keep-reading.md @@ -0,0 +1,37 @@ + +<% if (self !== "architecture") { %> +* [Architecture](/architecture-scenarios/implementation/${platform}/${platform}-architecture) +<% } %> +<% if (self !== "provisioning") { %> +* [Provisioning](/architecture-scenarios/implementation/${platform}/${platform}-provisioning) +<% } %> +<% if (self !== "authentication") { %> +* [Authentication](/architecture-scenarios/implementation/${platform}/${platform}-authentication) +<% } %> +<% if (self !== "branding") { %> +* [Branding](/architecture-scenarios/implementation/${platform}/${platform}-branding) +<% } %> +<% if (self !== "deployment") { %> +* [Deployment Automation](/architecture-scenarios/implementation/${platform}/${platform}-deployment) +<% } %> +<% if (self !== "qa") { %> +* [Quality Assurance](/architecture-scenarios/implementation/${platform}/${platform}-qa) +<% } %> +<% if (self !== "profile-mgmt") { %> +* [Profile Management](/architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt) +<% } %> +<% if (self !== "authorization") { %> +* [Authorization](/architecture-scenarios/implementation/${platform}/${platform}-authorization) +<% } %> +<% if (self !== "operations") { %> +* [Operations](/architecture-scenarios/implementation/${platform}/${platform}-operations) +<% } %> +<% if (self !== "logout") { %> +* [Logout](/architecture-scenarios/implementation/${platform}/${platform}-logout) +<% } %> +<% if (self !== "operations") { %> +* [Operations](/architecture-scenarios/implementation/${platform}/${platform}-operations) +<% } %> +<% if (self !== "launch") { %> +* [Launch Preparation](/architecture-scenarios/implementation/${platform}/${platform}-launch) +<% } %> diff --git a/articles/architecture-scenarios/_includes/_launch/_compliance.md b/articles/architecture-scenarios/_includes/_launch/_compliance.md new file mode 100644 index 0000000000..8538d072c5 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_launch/_compliance.md @@ -0,0 +1,37 @@ +There are several requirements related to privacy and compliance. Auth0 cannot provide legal guidance on your privacy or other regulatory obligations, but we can provide a curated list of privacy requirements below for which Auth0 offers features that may help you meet your obligations. Prior to launch, you should check that you’ve met all your privacy obligations and review the features outlined below to ensure you’re leveraging all the available Auth0 features to help you meet your privacy and compliance requirements. + +## Publish privacy policy and obtain user consent + +If you collect or process personal data about users, you should have published a privacy policy and have established procedures to ensure your operations abide by the contents of the policy. You also need to obtain a user’s consent for the collection and processing of information. Auth0 provides options for [displaying a link to your privacy policy storing user consent](/compliance/gdpr/features-aiding-compliance#conditions-for-consent). + +## Provide access to view, correct and erase data + +Privacy legislation often requires that users have the right to view and correct any data held about them. If you are a data controller, you should provide a mechanism for this. Auth0 customers can [build a self-service feature to access and correct data via the management API](/compliance/gdpr/features-aiding-compliance#right-to-access-correct-and-erase-data). + +## Provide access to data portability + +If you are a data controller, you may be obligated to provide users a means to export their data from your system in a transportable format. Auth0 provides [user data portability mechanisms](/compliance/gdpr/features-aiding-compliance#data-portability) to help you satisfy this obligation via both manual export capabilities and the Management API which enables you to implement a self-service feature for users. + +## Take steps to minimize personal data + +You should have reviewed the personal data you collect about users to ensure it is legitimately required for the purposes of the processing covered in the privacy policy and consent. You should also confirm you have [minimized the data you collect](/compliance/gdpr/features-aiding-compliance#data-minimization), and established a data retention policy. You can optionally elect to encrypt data you store in user metadata for additional protection. + +## Data retention policy enforcement automated + +You should have a published data retention policy and automate the enforcement of it. The Auth0 management API or the Auth0 dashboard can be used to facilitate [erasure of user accounts](/compliance/gdpr/features-aiding-compliance/right-to-access-data). + +## Protect personal data + +Regardless of whether you are a data controller or a data processor, you have obligations to protect the personal data you hold about users. This includes use of encryption where possible, and implementing reasonable security measures to protect user accounts. Prior to launch, you should check if you are using all the security features available from Auth0 to help with this such as Brute Force Detection, Multi-Factor Authentication (for both users and administrators), and a strong password policy if using passwords. You should also ensure you have a process ready to respond to [Brute Force attacks](/compliance/gdpr/features-aiding-compliance#protect-and-secure-user-data). + +## Supplier evaluation + +Another common compliance obligation is to perform due diligence review of the security of any third-party suppliers to which you expose personal data. For Auth0, you will find information to facilitate this task on the Auth0 [security and certifications](https://auth0.com/security/) page where you can view the security certifications Auth0 has obtained. + +## Additional resources + +Additional resurces that may be useful for your compliance requirements include: +* [Auth0 Privacy Policy](https://auth0.com/privacy) +* [Security and Compliance](https://auth0.com/security/) +* [GDPR and Compliance Frameworks](/compliance) +* [Auth0 support for customer requirements](/compliance/gdpr/features-aiding-compliance) diff --git a/articles/architecture-scenarios/_includes/_launch/_introduction.md b/articles/architecture-scenarios/_includes/_launch/_introduction.md new file mode 100644 index 0000000000..4909da3507 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_launch/_introduction.md @@ -0,0 +1 @@ +Use this guide as you prepare for the launch of your application. We’ve included reminders about some content you may have viewed earlier during your planning or development phases as well as some new content unique to the launch phase. The sections below are useful to developers and project owners to ensure that you have everything lined up for a smooth launch. There are several things to check so it may help to assign ownership of different sections to different members of your team. \ No newline at end of file diff --git a/articles/architecture-scenarios/_includes/_launch/_launch.md b/articles/architecture-scenarios/_includes/_launch/_launch.md new file mode 100644 index 0000000000..c0c5526d56 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_launch/_launch.md @@ -0,0 +1,112 @@ +## Notifications / announcements + +It helps a launch go smoothly if all stakeholders are aware of the impending launch and understand the launch plan as well as their role and responsibilities. In addition to notifying teams that will be actively involved, it can help to notify teams that might be needed if anything goes wrong. Having someone on standby during a launch can help expedite response. Be sure to identify and notify any team that might need to answer questions from customers, including on social media. + +### Parties to notify + +* Customers +* Business parters, if applicable +* Application team(s) impacted by launch +* Support teams +* Network teams (network changes, on standby, in case of issues) +* Security teams (on standby, in case of issues) +* Marketing teams (ready for announcements, response to issues) +* Social media teams (ready to monitor social media, respond) +* Sales teams (prepared to answer questions from customers) +* Customer success teams (prepared to answer questions from customers) + +## Notification plan + +Your notification plan should include elements such as the target audience, the key takeaways for the audience, the message content, the plans for distributing the notification and how to test the messaging. + +A list of elements to include in the plan are: + +* Target audience (consider both internal & external audiences) +* Message +* Timing +* Dependencies +* Responsible parties (who will send it) +* Mechanism (how it will be communicated) +* Test message and delivery (if applicable - test to ensure notifications sent) + +## Notification distribution + +A common tactic is to release notifications in batches to spread out the initial onslaught of load and reduce the scope of confusion if there are any unforeseen glitches. It’s easier to correct issues with a small group than during a big-bang launch. + +* One approach is to start with a relatively small batch of notifications, and if no issues are identified, increase the size of the batches over time. +* You can also send out batches on a rolling schedule around the globe to spread out load hitting the system at once and have notifications arrive at an optimal time within each timezone to increase the likelihood of the messages being read. +* You can do a soft-launch to a portion of users, such as individual customers, regions or some other grouping that makes sense for your application. + +## Outage windows (if needed) + +Some organizations require a formal request for an outage window if any outages or downtime is required for a launch. If your organization requires this, be sure to identify if any downtime is required for the cutover or launch (or other dependent systems) and file the necessary outage or change requests in advance of any lead-time requirements. + +## Cutover plan (if needed) + +Some launches involve cutover from a previous solution to a new solution. If your project fits this scenario, you should be sure to identify everything that needs to happen as well as any dependencies, the responsible party for each task, and necessary timing. You may wish to plan alternates for all important roles or in each region in case anyone is unexpectedly sick or otherwise unavailable. A checklist of items to consider for the cutover plan is: + +* Have you documented the cutover plan and rollback plan if needed? +* Are backups needed of anything prior to change? +* Are any preparatory data changes required? +* Any DNS records to be changed? +* Any Firewall changes? +* Any new monitoring targets? +* Any software to be deployed? + +## Go / no-go criteria + +In your overall launch plan, it is helpful to have go/no-go criteria and to have discussed in advance the types of issues which could occur and which could be worked through vs would require reverting. A launch plan can specify periodic check-in timeframes with criteria of what to assess at each checkpoint and how long to allow an issue to continue unresolved. + +For each stage of the launch, it helps to have success criteria defined, that indicate the launch is proceeding as planned and can continue. Some example criteria could be: + +* User signups growing with minimal errors +* User logins at expected rate, minimal errors +* Reported support issues below a certain threshold +* No issues identified that could lead to corrupted data + +It’s also helpful to have identified criteria which could trigger a “no-go” decision to halt the launch. The risk tolerance for each environment varies, but a few example criteria might include: + +* High percent of user signup or login resulting in errors that cannot be resolved quickly +* High number of support issues that cannot be resolved quickly +* Condition identified that could lead to data corruption +* High severity security issue discovered + +## Rollback + +It is always wise to have a plan for how to rollback or revert a launch, just in case something unforeseeable occurs which cannot be resolved. Reviewing the launch plan for every step which involves a change can help identify the tasks or changes requires to revert a launch or cutover. + +The rollback plan should include the steps to take, the sequence, how long each is likely to take and the responsible party. Understanding the cumulative time required to roll back can help to determine the timing of the final go/no-go decision to fit within any required outage window. + +If any data is migrated or changed for the launch, the plan should include how to revert it, if needed. Reverting may require running scripts to undo operational changes or restoring a data store from a backup taken before the launch process began. + +It is also necessary to plan for the case where some data is entered into a new system before it has to be reverted. Will such data / transactions need to be abandoned with the rollback or will you have a way to capture and apply them elsewhere so they aren’t lost? + +If the resolution of issues or process to revert could potentially take longer than one shift, you’ll want to ensure you have a primary and perhaps a secondary person available and prepared to handle things during each work shift. If an issue results in the need for prolonged response, significantly beyond one shift, there are limits for how long people can realistically function without a break. It can help to be prepared with resources for a follow-the-sun issue response effort if needed. + +## Standby contacts + +As the launch day approaches, it’s a good idea to identify all contacts who might be needed for troubleshooting or resolving issues and request them to be on standby and ready to help if needed. The launch leader should have contact information for each person on the standby list to expedite communications. + +If there is a physical or virtual "launch room", the people on standby should know where it is and be ready to join if needed. Having a central room or video conference prepared can expedite communications and troubleshooting across all parties if an issue occurs. + +## Success Criteria + +A lot of planning goes into a launch in order to be successful, but will you know how to evaluate the launch? If you define success criteria before the launch, you can determine what to monitor and if any additional monitoring or checks need to be in place to evaluate the launch. +For example - if one element of the success criteria is the number of sign-ups or logins - do you have a way of monitoring that and has it been tested to ensure it is accurate? + +You’ll want statistics to be able to trumpet the success of your launch. You don’t want to find out after the launch that you didn’t capture any data to quantify all the hard work your team put into the launch. + +## Risks & mitigations plan + +It’s no fun to think of things that could go wrong, but if anything happens, you’ll be glad you did as having a plan can expedite response. A few examples to plan for include: + +* Software application bug +* Application incompatibility with user browser settings +* Network failure/outage +* DoS attack +* Hosting environment failure +* Load / capacity issues +* Data / corruption issues +* Security vulnerability discovered + +If you had a beta period, it may help to review the results of the beta to identify additional possible failure scenarios. diff --git a/articles/architecture-scenarios/_includes/_launch/_operations.md b/articles/architecture-scenarios/_includes/_launch/_operations.md new file mode 100644 index 0000000000..22a43ad85d --- /dev/null +++ b/articles/architecture-scenarios/_includes/_launch/_operations.md @@ -0,0 +1,96 @@ +## Status + +You should ensure your operations staff knows how to monitor Auth0 service status and has set up a means to subscribe to updates on Auth0 status. + +<%= include('../../_includes/_operations/_service-status.md', { platform: 'b2b' }) %> + +## Email provider setup + +You should double check that you have set up your own email provider to support production volumes of emails that might be sent to customers for signup, email validation, account recovery and the like. + +<%= include('../../_includes/_operations/_email-provider.md', { platform: 'b2b' }) %> + +## Infrastructure + +<%= include('../../_includes/_operations/_infrastructure.md', { platform: 'b2b' }) %> + +## NTP + +If this is not handled automatically by your hosting environment, you should have scripts which will automatically restart NTP (Network Time Protocol) if it fails and alerts that will notify someone if NTP is not running. Authentication transactions rely on accurate system time because security tokens may be evaluated as expired when received if there are time discrepancies between sending and receiving systems. + +## LoadBalancer timeouts checked + +If you use the AD/LDAP connector, you should check the load balancer settings in your environment to see if they terminate long running connections that are inactive. If they do, you can modify the [Auth0 AD/LDAP Connection settings](/connector/modify#configuration-file) to use the `LDAP_HEARTBEAT_SECONDS` setting to send periodic heartbeat messages to keep the connection open. + +## LoadBalancer configuration + +If your application maintains server state such that it depends on sticky load balancing to route users to a particular server, it can be beneficial to double check that all load balancer configurations are correct. One load balancer in a pool that is out of sync can cause intermittent errors that are hard to troubleshoot. A quick check of load balancer configuration can avoid such issues in the first place. + +## Logs + +You should check that you have set up the ability to capture log data, that logs are covered by your data retention policy and you have mechanisms to enforce logs data retention limits. You should also make sure that your development, support, and security teams know how to access logs data for troubleshooting and forensics purposes. Exporting log files to services that provide comprehensive analytics can help you identify patterns such as usage trends and errors. + +<%= include('../../_includes/_operations/_logging.md', { platform: 'b2b' }) %> + +## Monitoring + +Be sure to set up proactive monitoring of the Auth0 service as well as end-to-end authentication through your application. + +<%= include('../../_includes/_operations/_monitoring.md', { platform: 'b2b' }) %> + +## Auth0 Notifications + +You should ensure your team is monitoring all of the following communication channels from Auth0 to stay abreast of important announcements and changes. + +<%= include('../../_includes/_operations/_notifications.md', { platform: 'b2b' }) %> + +In addition, you should periodically check the [Auth0 migrations page](/product-lifecycle/migrations) for news about upcoming deprecations that might require your team to make changes. + +## Automated Deployment, version control + +While not required, it is highly recommended that you have deployment automation set up. You can respond more efficiently if you need to make any changes after launch if you have automated the ability to deploy and revert changes to dev, test and production environments. + +<%= include('../../_includes/_deployment/_introduction.md', { platform: 'b2b' }) %> + +## Backup / Restore + +You should have a plan and mechanism in place to support any backup/restore capability needed for your project. This can be done using the Auth0 Management API for data as well as the Automated Deployment capabilities described in the automated deployment section for Auth0 configuration. + +As noted in the Auth0 [Data Tenant Restore policy](policies/restore-deleted-tenant) and [Data Transfer policy](policies/data-transfer), Auth0 does not restore deleted tenants or move data between tenants. Auth0 provides the Auth0 Management API to provide customers a completely flexible capability to backup, restore and move data as needed. Customers can write scripts to retrieve data from Auth0 for backup purposes, and similarly write scripts for use with the Automated Deployment capability to restore any aspect of their Auth0 configuration. + +## Versions Up to Date + +You should double check that all technologies in your application stack, as well as browser versions used by your users are on current, up-to-date versions as this will impact Auth0’s ability to provide support if issues arise. +* Check you are using the latest supported version of node.js in [Auth0 dashboard settings](/dashboard/dashboard-tenant-settings#extensibility). +* Check you are using a version of SDK/Libraries supported by Auth0 per the [Auth0 Support Matrix](/support/matrix). + +## Certificate rollover plan + +Certificates may be used in identity deployments. To ensure a certificate expiration does not catch you by surprise, you should have a list of certificates in your environment along with the expiration dates, how you will be notified when expiration draws near and how the certificate rollover process works. + +### SAML connections + +For SAML connections, you obtain a certificate from the IdP and upload it to a SAML connection for the IdP in your Auth0 dashboard. When one of these certificates is about to expire, Auth0 will send email to dashboard administrators warning of the upcoming expiration. You can obtain the new certificate and upload it using the connection configuration screen. + +### WS-Fed connections + +For WS-Fed connections, if you configure them by specifying an ADFS URL, any changes will be picked up by a daily update. You can trigger an update manually by visiting the connection configuration page in the Auth0 dashboard and doing a Save. If a certificate is changed at the remote IdP, Auth0 can be updated by those mechanisms or by uploading a new metadata file in the same connection configuration screen. + +## Disaster Recovery / Business Continuity Plan in place + +While not an absolute requirement prior to launch, it is useful to have a disaster recovery plan in place to ensure business continuity in the face of different types of disasters, including system outages and natural disasters hitting a region where critical staff is located. + +## Processes documented + +Another item which is not an absolute requirement, but also recommended is to ensure all processes related to Auth0 are documented. This can include the following: + +* Change management for configuration +* Deployment of new changes and any automatic deployment mechanisms used, how to revert to previous version if issues found +* Certificate rollover processes, if any +* Adding or removing new Identity Providers, if applicable +* Changes to user profile structure in Auth0 or in directories Auth0 pulls from +* Adding or removing applications or APIs +* Capturing and exporting logs +* Backup/restore process you have implemented +* User management (forgotten password, lost phone) +* Root cause analysis after an incident diff --git a/articles/architecture-scenarios/_includes/_launch/_support.md b/articles/architecture-scenarios/_includes/_launch/_support.md new file mode 100644 index 0000000000..3eea47b43a --- /dev/null +++ b/articles/architecture-scenarios/_includes/_launch/_support.md @@ -0,0 +1,61 @@ +## Review Auth0 Policies + +When starting to prepare for your launch, be sure to read through [Auth0 Policies](/policies) and prepare your production operations accordingly for any required lead times or responsibilities on your part, according to the policies. + +## Review your Support plan, SLAs, Severity definitions and Support center documentation + +You should review the specifics of the [support plan](/support#support-center) you’ve purchased and the [Service Level Agreements](/support#defect-responses) associated with it, to ensure it is adequate for your needs. If you haven’t already done so, explore the [support center](https://support.auth0.com/) and familiarize yourself with support features such as viewing suggested solutions to common issues and [filing tickets](/support/tickets) and viewing your quota usage. It will be helpful to review the [severity level definitions](/support#defect-resolution-procedures) for support tickets so that you file tickets with the correct severity. One important note is that it is not possible today in the Support Center to increase the severity of a support ticket. If you file a ticket for a medium-grade issue which later becomes a high severity issue, you should file a new urgent, high severity ticket that explains anything new that triggers the urgency and references the original ticket for details. + +You should also ensure your development and support teams are familiar with the [Auth0 community forum](https://community.auth0.com/), discussed further below. Customers can often find answers there right away to common issues, avoiding the need to file a ticket, so it should be your first stop for technical questions. + +## Review the Auth0 community forum + +The [Auth0 community forum](https://community.auth0.com/) contains a wealth of information. If you have a question, chances are someone else has already asked the question on the forum. Answers are contributed by both Auth0 staff and the larger community of Auth0 users. + +Important notices are posted to the community forum to help you stay abreast of important news. Be sure to check out the “Community” and “FAQ” categories. The Community category contains pro-active posts on product announcements, roadmap information, How-To videos as well as important information about any upcoming feature deprecations. + +It’s a good idea to check out the Auth0 Community on a regular basis, not just when you have questions. While you are there, if you see a question you’ve already solved, please contribute your wisdom to help others! + +## Gather Auth0 troubleshooting information needed for support tickets + +We recommend your support team become familiar with our [troubleshooting guides](/troubleshoot) specific to identity protocols and Auth0. This includes the questions to research and information to collect before posting a question on the Auth0 forum or filing a support ticket. Authentication transactions often span multiple systems so there are some specialized troubleshooting techniques that are helpful to learn. + +## Have troubleshooting tools ready + +Your team will doubtless have already done some troubleshooting during the development of your application, but we recommend making sure your support team is also familiar with any tools below relevant to your project. If you need to file a ticket, the Auth0 support team may ask for a HAR (HTTP Archive) file to help analyze the issue so it’s helpful for your support staff to be familiar with how to do this. + +### Capture HAR file + +A [HAR file](/troubleshoot/guides/generate-har-files) captures a sequence of browser interactions and is a commonly used tool when debugging authentication issues. The process of authenticating a user often involves redirecting the user’s browser from an application to Auth0, and possibly to another remote Identity Provider, depending on the type of connection used. You can capture the redirection and the responses and analyze it to find clues about the cause of an issue. + +### Analyze HAR file + +Analyze the [HAR file](/troubleshoot/guides/generate-har-files#analyze-har-files) to obtain valuable troubleshooting information. It shows the sequence of browser redirects involved in an authentication transaction, along with the parameters used. The HAR file also shows if the authentication process stopped mid-stream and if so where, which helps to pinpoint the location of the issue. The HAR file contains tokens returned to the application front-end, and these can be pasted into appropriate viewers to see if they contain the expected contents. + +### View JWT + +The [jwt.io](https://jwt.io) tool was written by Auth0 and allows you to view the contents of a JWT-formatted token. Applications that delegate authentication to Auth0 via OIDC will receive an ID Token from Auth0. Depending on your type of application, the ID Token may be captured in a HAR file. The ID Token is in JWT format and can be pasted into jwt.io to view the contents of the ID Token. + +### View SAML request/response + +There are many SAML decoders available. The [samltool.io](https://samltool.io) decoder was written by Auth0 and allows you to view the contents of a SAML Request or Response. Applications that delegate authentication to Auth0 via SAML or use a SAML type of connection in Auth0 will use SAML Requests and Responses. These SAML Requests and Responses may be captured in a HAR file. The requests and responses can be pasted into samltool.io or other SAML decoders to view the contents of the SAML Request or Response. + +## Review Auth0 support matrix + +One potential cause of issues is using out of date versions of SDKs or libraries. We strongly recommend your team check your software stack, browsers, SDKs and libraries against the [Auth0 support matrix](/support/matrix) to ensure you are running on up-to-date, supported versions. In the event of an issue, the Auth0 support team may ask you to upgrade to a supported version. To avoid slowing down progress on issue resolution, be sure you are on up-to-date versions. + +## Use Auth0 feedback portal + +Auth0 welcomes feedback and ideas from Auth0 customers. If you have a suggestion for our product team, you can submit product feedback directly on the [Product Feedback portal](https://auth0.com/feedback). + +## Prepare real-time webtask log extension + +For debugging and supporting custom code in Auth0, including Rules, Hooks, Custom DB Scripts, and Custom OAuth Connections, knowledge of the [Realtime Webtask Log](/extensions/realtime-webtask-logs) is essential. This enables you to view output from your custom code, including output from console.log statements. + +::: panel Best Practice +We recommend installing the real-time webtask log extension and getting familiar with using it to view log output from your custom code as a debugging and support tool. +::: + +## Troubleshooting + +You should prepare to [troubleshoot issues](/troubleshoot/basics) both during your development as well as after your application or API goes live. Make sure your development and support teams are prepared with knowledge of troubleshooting tools, and the list of common issues to check when troubleshooting an issue. diff --git a/articles/architecture-scenarios/_includes/_launch/_tenant-check.md b/articles/architecture-scenarios/_includes/_launch/_tenant-check.md new file mode 100644 index 0000000000..2f9f2ce0d5 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_launch/_tenant-check.md @@ -0,0 +1,112 @@ +## Tenant Check + +This section covers a list of configurations to check in your tenant. This should be done periodically during development and sufficiently before launch so you have time to fix anything amiss. + +### General tenant check + +#### Tenant preparation check + +Check to ensure you have [set up tenant environments](/dev-lifecycle/setting-up-env) to support your SDLC lifecycle and that Dev, Test and Prod tenants are cleanly separated so that ongoing development work after launch doesn’t negatively impact your production environment. + +<%= include('../../_includes/_architecture/_sdlc-support.md', { platform: 'b2c' }) %> + +#### Tenant association check + +<%= include('../../_includes/_architecture/_tenant-association.md', { platform: 'b2c' }) %> + +#### Specify production tenant + +To ensure Auth0 recognizes your production tenant, be sure to [set your production tenant](/dev-lifecycle/setting-up-env#set-the-environment +) with the “production” flag in the Support Center. + +#### Tenant production Check + +Auth0 provides a [Production Check](/pre-deployment) facility to detect many common errors. You should ensure this has been run and any findings from the report mitigated before launch. + +In addition, you should check the [best practice configurations advice](/pre-deployment/tests/best-practice), for which checking cannot be automated. + +#### Tenant Settings Check + +##### Tenant Settings + +Make sure to follow the [Auth0 tenant settings best practices](/best-practices/tenant-settings#set-up-branding-configuration) in configuring your logo as well as your support email and support URL so user's know how to get help if an issue occurs. You'll want to check your SSO Session Timeout settings and the list of dashboard admins with access to your production tenant as well. For further information on tenant setting, see the Auth0 dashboard [tenant settings documentation](/dashboard/dashboard-tenant-settings#settings). + +##### Error Page Customization + +<%= include('../../_includes/_branding/_error-page.md', { platform: 'b2c' }) %> + +##### Legacy feature flags off + +If you have an older tenant, you may have various legacy feature flags enabled in your [tenant settings advanced tab](/dashboard/dashboard-tenant-settings#advanced). If you have any toggles on in the “Migrations” section of this tab, you should review your usage and make plans to migrate off the legacy feature. + +##### Delegated admin extension + +While you are checking the list of users with access to your production tenant, don't forget to check any users specified in the [Delegated Admin Extension](/extensions/delegated-admin/v3). + +#### Custom Domain Naming set up + +<%= include('../../_includes/_branding/_custom-domain-naming.md', { platform: 'b2c' }) %> + +### Application and Connection settings check + +Each of your application configurations in Auth0 should be checked against the [application configuration best practices](/best-practices/application-settings). + +Each of your connection settings should be reviewed against the [connection configuration best practices](/best-practices/connection-settings). + +In addition, you should review that all connections are appropriate and that no experimental connections are left in your production tenant as they could enable unauthorized access. + +If you use SAML connections, it is a best practice to configure the connections to sign SAML requests. + +### Page customization check + +If you use the Auth0 universal login page, password reset page, or Guardian multi-factor authentication, you should check that you have adequately customized the pages displayed to the end user. + +#### Universal Login Page + +<%= include('../../_includes/_branding/_universal-login.md', { platform: 'b2c' }) %> + +#### Password Reset Page customization + +<%= include('../../_includes/_branding/_password-reset.md', { platform: 'b2c' }) %> + +#### Guardian + +<%= include('../../_includes/_branding/_guardian.md', { platform: 'b2c' }) %> + +### Authorization check + +If you are using Auth0’s [authorization feature](https://auth0.com/docs/authorization), be sure to double check all privileges granted to ensure authorizations are appropriate for your production environment. + +### API configuration check + +#### Access token expiration + +You should double check the [API access token expiration settings](/dashboard/reference/settings-api) to ensure they are appropriate for each API in your production environment. + +#### API offline access + +If your application does not request refresh tokens, this should be off. + +#### Access token signing algorithm + +It is recommended that the [API access token signing algorithm](/getting-started/set-up-api#signing-algorithms) be set to RS256 rather than HS256 to minimize exposure of the signing key. + +#### API Access token validation + +If you have any custom APIs, be sure to check that they are adequately [validating the access tokens](/api-auth/tutorials/verify-access-token) they receive before using the information in them. + +### API Scopes + +If you have applications making machine-to-machine calls to any of your APIs, you should review the scopes specified for the API to ensure they are all appropriate for your production environment. For further information see the documentation on [client credentials grant](/api-auth/config/using-the-auth0-dashboard). + +### Rules/Hooks check + +You should also have aligned your rules with Auth0 [rules best practices](/best-practices/rules). + +### Email templates customized + +<%= include('../../_includes/_branding/_email-templates.md', { platform: 'b2b' }) %> + +### Attack protection configured + +<%= include('../../_includes/_authentication/_attack-protection.md', { platform: 'b2b' }) %> diff --git a/articles/architecture-scenarios/_includes/_launch/_testing.md b/articles/architecture-scenarios/_includes/_launch/_testing.md new file mode 100644 index 0000000000..7ceb804ac1 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_launch/_testing.md @@ -0,0 +1,25 @@ +Prior to launch, you should have completed all the testing that applies to your environment. + +<%= include('../../_includes/_qa/_introduction.md', { platform: 'b2c' }) %> + +### Unit testing + +<%= include('../../_includes/_qa/_unit-testing.md', { platform: 'b2c' }) %> + +### Integration testing + +<%= include('../../_includes/_qa/_integration-testing.md', { platform: 'b2c' }) %> + +### Mock Testing + +<%= include('../../_includes/_qa/_mock-testing.md', { platform: 'b2c' }) %> + +### Pen testing (optional) + +If you will be conducting penetration tests, you should be aware of Auth0’s [penetration testing policy](/policies/penetration-testing) and abide by it. Penetration tests require advance notice to Auth0 so that your tests are not mistaken for malicious activity and shut down. + +### Load testing (optional) + +If you will be conducting load tests, you should be aware of Auth0’s [load testing policy](/policies/load-testing) and abide by it. Load tests require advance notice to Auth0. In planning your load testing, you will also need to be aware of Auth0’s [API rate limits](/policies/rate-limits). + +<%= include('../../_includes/_qa/_load-testing.md', { platform: 'b2c' }) %> diff --git a/articles/architecture-scenarios/_includes/_logout/_introduction.md b/articles/architecture-scenarios/_includes/_logout/_introduction.md new file mode 100644 index 0000000000..08510e5ea8 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_logout/_introduction.md @@ -0,0 +1,47 @@ +[Logout](/logout) is the act of terminating an authenticated session when it's no longer needed, thus minimizing the likelihood that unauthorized parties can "take over" the session. This is typically achieved by provisioning a logout option on the user interface you provide to your users. Multiple types of sessions can be created when a user logs in (e.g., local application sessions, Auth0 session, third-party Identity Provider sessions), and you will need to determine which of these sessions need to be terminated when the user clicks any **Logout** option. + +::: panel Best Practice +Your logout behavior should make it clear to a user which session(s) are being terminated, and ideally, will display a visual confirmation of logout afterward. +::: + +When configuring logout behavior, you'll need to consider: + +* Which sessions should be terminated when the user initiates logout? +* What information should you provide to users as confirmation of the sessions terminated? +* Where should users be redirected to after logout completes? +* How long do you want sessions to last in the event that users do not trigger the logout process? +<% if (platform === "b2b") { %> +* Should the End User be logged out of all of their application sessions when they log out of one? +* Should the session with an organization's IDP also be terminated at logout? +<% } %> + +Given the varying types of sessions that can be created whenever a user logs in, there are several types of logout possible. Local application logout ends the session with the application, whereas Auth0 logout [terminates the Auth0 session](/logout/guides/logout-auth0). If you have organizations that are using their own IDP, you may want to consider a [Federated Logout](#federated-logout) strategy and implement accordingly. Global, or [Single Logout](/logout/guides/logout-applications) (SLO), ends the Auth0 session and also sends a logout request/notice to applications relying on the Auth0 session. + +The functionality provided by your application, as well as your use of features like [Single Sign-on (SSO)](/sso), will inform your decision as to what type of logout is required and what visual confirmation you'll need to provide to your users. Regardless of which option you choose, the logout process you implement should make it clear to the user which sessions are being terminated, and also when the logout process has completed. + +::: warning +If the logout feature in one application terminates an Auth0 SSO session that is used by other applications, the user may lose work if they have uncommitted transactions. Be sure to add the functionality needed to handle such conditions to minimize the likelihood of lost work. +::: + +<% if (platform === "b2b") { %> +In some situations, a user may be expected to logout of all associated applications when they log out of any one of the applications you provide. This is something that can add complexity. However if you have concerns that users could leave themselves vulnerable (perhaps due to data sensitivity or the like), then you will likely need to review [Single Logout](#single-logout) and implement accordingly. + +<% } %> + +## Where to send users after logout + +Once your user logs out, they will be redirected to a specific location of your choosing. This location is specified as the **logout redirect URL**, and you can [define this as a parameter](/logout/guides/redirect-users-after-logout) via the Auth0 Dashboard. + +The URL(s) you use to redirect users after logging out must be [whitelisted in the Dashboard](/logout#redirect-users-after-logout) to mitigate open-redirect security vulnerabilities. You can whitelist them at the tenant or application levels. + +::: note +If the user logs out and you redirect them back to the application, and the application redirects to an Identity Provider that still has a valid session for the user, the user will be logged in silently to the application. This may appear to the user as if the logout process didn't function properly. +::: + +## Automatic termination of sessions + +Not all users will trigger the logout process manually, so Auth0 also provides **session timeout** to prevent overly long-lived sessions. This setting is [available and configurable via the Auth0 Dashboard](/dashboard/reference/settings-tenant#login-session-management). + +::: panel Get Started with Auth0 Video +Watch this short video [Logout](/videos/get-started/10-logout) to learn about different kinds of logout behavior and different session layers. Learn how to configure callback URLs in the application and tenant settings in the Dashboard. +::: diff --git a/articles/architecture-scenarios/_includes/_multitenancy.md b/articles/architecture-scenarios/_includes/_multitenancy.md new file mode 100644 index 0000000000..50c06de00b --- /dev/null +++ b/articles/architecture-scenarios/_includes/_multitenancy.md @@ -0,0 +1,3 @@ +Many B2B platforms implement some form of isolation and/or branding for their customers' organization, and this can add complexity to any Identity and Access Management (IAM) system. If this applies to you, then we recommend you take some time to read through our guidance and best practice advice concerning this type of environment. + +Multiple Organization Architecture (Multitenancy) Overview diff --git a/articles/architecture-scenarios/_includes/_operations/_email-provider.md b/articles/architecture-scenarios/_includes/_operations/_email-provider.md new file mode 100644 index 0000000000..8f83e0bece --- /dev/null +++ b/articles/architecture-scenarios/_includes/_operations/_email-provider.md @@ -0,0 +1,5 @@ +Auth0 sends [emails](/email) to users for events such as signup welcome, email validation, breached password, and password reset events. You can customize the email templates for each type of event, and advanced customization of email handling is also possible. Auth0 provides a test email provider with limited capacity for basic testing, but you must set up your own email provider for production use, and customization of email templates will not work until you have established your own provider. + +::: panel Best Practice +The default Auth0 email provider does not support sending production volumes of email or customization of email templates. You should therefore configure your own email provider before deploying to production. +::: diff --git a/articles/architecture-scenarios/_includes/_operations/_infrastructure.md b/articles/architecture-scenarios/_includes/_operations/_infrastructure.md new file mode 100644 index 0000000000..540e16cd72 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_operations/_infrastructure.md @@ -0,0 +1,3 @@ +### Firewalls + +If custom code executing in Auth0 (such as in a Rule, Hook, or Custom DB scripts) will call a service inside your network, or if you configure an on-premise SMTP provider in Auth0, then you may need to configure your firewall to allow [inbound traffic from Auth0](/guides/ip-whitelist#inbound-calls). The IP addresses to allow through the firewall are specific to each region and are listed on the Rules, Hooks, Custom DB scripts, and email provider configuration screens in your Auth0 dashboard (as described in [Whitelist IP Addresses](/guides/ip-whitelist)). diff --git a/articles/architecture-scenarios/_includes/_operations/_introduction.md b/articles/architecture-scenarios/_includes/_operations/_introduction.md new file mode 100644 index 0000000000..33fb73bae3 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_operations/_introduction.md @@ -0,0 +1,29 @@ +Operationalization requires configuring or setting up infrastructure to support the scalable, measurable, and quantifiable operation that’s necessary for business continuity. In Auth0, this includes configuring supporting services (such as email providers), monitoring services for your deployment, detecting anomalous situations, and making preparations to recover quickly and smoothly when something goes wrong in a production environment. + +Establishing effective operational behaviors is something that successful customers have found pays dividends, and there are a number of things you will want to consider when looking at your workflow: + +* What should you do to proactively detect failures? +* How can you obtain data on Auth0’s operational status? +* What should you do about Auth0 security bulletins related to the Auth0 service? +* Does Auth0 provide information regarding impending changes in the Auth0 service? +* How can you check for important notices from Auth0? +* What should you do with Auth0 log data so that you can analyze it and keep it for longer than Auth0’s limited data retention period? +* How can you scan Auth0 logs to determine if peak loads in your application trigger any rate limits or other errors? +* What email services should you use to support production volumes of email messages to users? Can I use Auth0's out-of-box email provider in my production environment? +* Do you need to configure your firewall and what firewall ports will you need to open for internal services that need to receive communications from Auth0 (such as custom databases, web services, and email servers)? +<% if (platform === "b2b") { %> +* How will you provision new organizations? +* Do you need to provide self-service provisioning for your customer so that they can configure their own organizational IdPs? +<% } %> + +Auth0 supports functionality for [monitoring](#monitoring) Auth0 service operation as well as providing information regarding Auth0 [service status](#service-status). In addition, Auth0 makes security-related bulletins as well as information regarding upcoming changes to the Auth0 service available via various [notifications](#notifications). Auth0 [logging](#logging) services also provide extensive functionality for tracing and identifying operational anomalies, including restrictions encountered due to rate limiting and/or excessive loading. + +Out-of-box, Auth0 provides email delivery services to help you accelerate your integration. These services, however, are not meant for scale-of-use in production environments, and do not provide for any specific service level or guarantee when it comes to email delivery. Our best practice recommendation, which customers typically follow, involves configuring your own [email service provider](#email-provider-setup). + +You may also need to make changes to [infrastructure](#infrastructure) configuration in order to support integration with Auth0 and to support use of Auth0 extensibility. For example, if you need to provide callbacks to your internal or even external infrastructure (e.g., if you need to make external API calls in Rules or Hooks, or via custom database scripts if you need to leverage existing legacy identity storage), then you may need to configure your Firewall settings. + +<% if (platform === "b2b") { %> +Once you know how you want organizations to be represented in your system, you will want too consider how you are going to provision the organization itself. See [Provisioning organizations](#provisioning-organizations) for more information. + +In addition, many of our customers have developed one or more self-service portals for use by their customers' organization admins to provide self-service capabilities for configuring their own [IdPs](#self-service-idp-provisioning). +<% } %> diff --git a/articles/architecture-scenarios/_includes/_operations/_logging.md b/articles/architecture-scenarios/_includes/_operations/_logging.md new file mode 100644 index 0000000000..41ce91d599 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_operations/_logging.md @@ -0,0 +1,15 @@ +Auth0 provides extensive capability when it comes to the logging of events, and also in the scanning of logs in order to identify event anomalies (see [logs documentation](/logs) for further details). Standard log retention period for Auth0 logs is determined by subscription level with the shortest period being 2 days and the longest period being only 30 days. Leveraging Auth0 support for integrating with external logging services will allow you to retain logs outside of this, and will also provide for log aggregation across your organization. + +::: panel Best Practice +You should leverage one of the Auth0 logs extensions to send log data to an external log analytics service. This will enable keeping data for longer periods of time and provide advanced analytics on the log data. +::: + +You should review the log data [retention period](/logs/references/log-data-retention) for your subscription level, and implement a log data export extension to send log data to an external log analytics service. Development teams can use log files for troubleshooting and detecting intermittent errors that may be hard to find via QA tests. Security teams will probably want log data in case forensic data is ever needed. Exporting log files to services that provide comprehensive analytics can help you see patterns such as usage trends and attack protection triggers. + +### Rate limits and other errors + +Auth0 provides a unique error code for errors reported when the [rate limit is exceeded](/policies/rate-limits#exceeding-the-rate-limit). You should set up automatic scanning of logs to check for rate limit errors so you can proactively address activity that hits rate limits before it causes too much trouble for your users. Auth0 also publishes error codes for other types of errors, and you will find it helpful to scan logs for [authentication errors](/libraries/error-messages) as well as errors from Auth0 Management API calls (Management API error codes are shown below each call in the [Management API Explorer](/api/management/v2)). + +::: panel Best Practice +Calling the Management API to retrieve user profile information from within a Rule is a common cause of rate limit errors because such API calls can execute for every login as well as periodic session checks. +::: diff --git a/articles/architecture-scenarios/_includes/_operations/_monitoring.md b/articles/architecture-scenarios/_includes/_operations/_monitoring.md new file mode 100644 index 0000000000..d64277752e --- /dev/null +++ b/articles/architecture-scenarios/_includes/_operations/_monitoring.md @@ -0,0 +1,5 @@ +You should establish mechanisms for [monitoring Auth0 implementations](/monitoring), so your support or operations team receives the timely information needed to proactively handle service outages. Auth0 provides monitoring endpoints that can be incorporated into your monitoring infrastructure. These endpoints are designed to provide a response suitable for consumption by monitoring services. It should be noted that they only provide data on Auth0. For complete end-to-end monitoring, which is essential for checking the ability of users to log in, we recommend that you set up synthetic transaction monitoring. This will provide greater granularity for your monitoring and enable you to detect outages unrelated to Auth0 as well as degradation of performance, so you can respond more proactively. + +::: panel Best Practice +You should set up the ability to send synthetic login transactions to facilitate end-to-end monitoring of authentication. You can do this with a simple application that uses the [Resource Owner Password Grant](/api-auth/tutorials/password-grant) in combination with a test user that has no privileges, and don’t forget about [Auth0 rate limiting policies](/policies/rate-limits) too. +::: diff --git a/articles/architecture-scenarios/_includes/_operations/_notifications.md b/articles/architecture-scenarios/_includes/_operations/_notifications.md new file mode 100644 index 0000000000..57dd93c1f9 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_operations/_notifications.md @@ -0,0 +1,21 @@ +There are several different types of notifications from Auth0 that you should watch for as they contain important information that could impact your tenant(s) and project. + +::: note +Proactive security notifications and other operational announcements are sent by Auth0 to dashboard administrators. You should ensure that the people who need to receive such messages are dashboard administrators. +::: + +### Dashboard notifications + +From time to time, Auth0 may send an important announcement related to your tenant. These announcements about your service will be sent to your Auth0 dashboard and depending on the severity of the announcement, via email to the registered Auth0 dashboard administrators. You should make a regular practice of logging in to the dashboard and checking the bell icon at the top for any important notices. In addition, you should review emails from Auth0 in a timely fashion as they may convey important information about changes or actions you need to take. + +### Auth0 security bulletins + +Auth0 regularly conducts a number of security-related tests, and if any issues are found, will proactively identify and notify customers who need to make security-related changes. Due to the extensible nature of the Auth0 product, however, it may not be possible for Auth0 to identify every impacted customer, so you should regularly check Auth0 [security bulletins](/security/bulletins). You should make sure a security contact for your organization is listed in Support Center. + +::: panel Best Practice +It is a best practice to check the Auth0 [Security Bulletins](/security/bulletins) page periodically and take the recommended action if you are impacted by any security bulletins. +::: + +### Change log + +Auth0 provides information on changes to the service in the Auth0 [change log](https://auth0.com/changelog). You should make a regular practice of reviewing Auth0 change logs to be aware of changes. Support teams researching an issue may find it useful to review the change log to determine if recent changes might be related, especially if these are [breaking changes](/migrations). Development teams will also want to review the change logs to identify new features that may be beneficial. diff --git a/articles/architecture-scenarios/_includes/_operations/_service-status.md b/articles/architecture-scenarios/_includes/_operations/_service-status.md new file mode 100644 index 0000000000..a42bdbd948 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_operations/_service-status.md @@ -0,0 +1,7 @@ +The Auth0 [status dashboard](https://status.auth0.com/) together with the Auth0 [uptime dashboard](http://uptime.auth0.com/) shows current and past status of the Auth0 service in a human-readable format. If any monitoring alerts are triggered, and as a first step in troubleshooting, your operations staff should check the status dashboard to see if there is a current outage. The public cloud status page also provides a facility for subscribing to outage notifications, and we also recommend that you check the status of any 3rd party, [external services](/monitoring/guides/check-external-services) you depend on - such as Social Providers. Having this information handy can help quickly eliminate possible causes when troubleshooting an issue and should be at the top of a troubleshooting checklist for developers as well as the helpdesk staff. + +::: panel Best Practice +Information on how to check the status of Auth0 as well as any dependent services (such as Social Providers) should be at the top of a troubleshooting checklist for both developers and helpdesk staff, and we recommend you subscribe via the Auth0 status page to set up notification of any status updates. +::: + +In the event of an outage to the public cloud service, Auth0 performs a Root Cause Analysis (RCA) and publishes the results on the [Auth0 status page](/support#auth0-status). Auth0 performs a thorough investigation after an outage--including a determination of root cause, as well as contributing factors and how to prevent the issue from occurring again--and as a result, an RCA document can take a few weeks to be published. diff --git a/articles/architecture-scenarios/_includes/_planning.md b/articles/architecture-scenarios/_includes/_planning.md new file mode 100644 index 0000000000..8ad9191355 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_planning.md @@ -0,0 +1,9 @@ +We provide planning guidance in PDF format that you can download and refer to for details about our recommended strategies. + +<% if (platform === "b2b") { %> +B2B IAM Project Planning Guide +<% } %> + +<% if (platform === "b2c") { %> +B2C IAM Project Planning Guide +<% } %> diff --git a/articles/architecture-scenarios/_includes/_profile-mgmt/_account-verification.md b/articles/architecture-scenarios/_includes/_profile-mgmt/_account-verification.md new file mode 100644 index 0000000000..0306b71049 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_profile-mgmt/_account-verification.md @@ -0,0 +1,3 @@ +You’ll also need to work with a verified user account at all times and make use of the mechanisms Auth0 provides. You should also consider regulatory compliance like [GDPR](https://eugdpr.org/) which has very specific requirements for protecting EU citizens from privacy and data breaches. + +Auth0 provides out-of-box functionality for sending a [verification email](/email/custom#verification-email) to a user's email address to verify their account. By default, Auth0 automatically sends verification emails for any [Database Connection](/connections/database) identity created as part of [self sign-up](/architecture-scenarios/implementation/${platform}/${platform}-provisioning#self-sign-up). However, Auth0 also provides a [Management API endpoint](/api/v2#!/Tickets/post_email_verification) that you can use to send verification emails in cases where email address validation is not performed by a Social Provider upon user registration. diff --git a/articles/architecture-scenarios/_includes/_profile-mgmt/_blocking-users.md b/articles/architecture-scenarios/_includes/_profile-mgmt/_blocking-users.md new file mode 100644 index 0000000000..d66954e4a6 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_profile-mgmt/_blocking-users.md @@ -0,0 +1,3 @@ +[Blocking user access](/users/guides/block-and-unblock-users) in Auth0 provides a way to prevent user login to applications under certain conditions. By default, the Auth0 Dashboard provides an out-of-the-box mechanism to give administrators the ability to both block and unblock user access to all applications, and you can implement this functionality via use of the [Auth0 Management API](/api/management/v2#!/Users/patch_users_by_id). You can also use Auth0 extensibility to [disable user access to certain applications](/users/guides/manage-user-access-to-applications) as well as provide more fine-grained [access control](/architecture-scenarios/implementation/${platform}/${platform}-authorization). + +In addition, the Auth0 Management API provides you with the ability to [unblock](/api/management/v2#!/User_Blocks/delete_user_blocks_by_id) users disabled due to excessive use of incorrect credentials. diff --git a/articles/architecture-scenarios/_includes/_profile-mgmt/_de-provisioning.md b/articles/architecture-scenarios/_includes/_profile-mgmt/_de-provisioning.md new file mode 100644 index 0000000000..cfbccfab6c --- /dev/null +++ b/articles/architecture-scenarios/_includes/_profile-mgmt/_de-provisioning.md @@ -0,0 +1,7 @@ +Your application may need to support a user’s request to remove their account (for example, you might need to meet [GDPR](https://eugdpr.org/) requirements). You can implement such a feature, along with a number of other profile-related functions, using the [Management API](/api/management/v2#!/Users). The Management API allows you to retrieve information stored about a user and update it as required. + +Auth0 is capable of supporting various privacy-related requirements including the display of links to consent notices on signup and data protection to support the rights of users to view and correct data you’ve collected about them. + +::: note +[GDPR](https://eugdpr.org/) and other privacy directives require that users have the right to view and correct data held about them. They also have the right to be “forgotten.” You can use the Management API to address these requirements and meet your legislative obligations. +::: diff --git a/articles/architecture-scenarios/_includes/_profile-mgmt/_introduction.md b/articles/architecture-scenarios/_includes/_profile-mgmt/_introduction.md new file mode 100644 index 0000000000..d0098b386d --- /dev/null +++ b/articles/architecture-scenarios/_includes/_profile-mgmt/_introduction.md @@ -0,0 +1,49 @@ +At some point, you may need to change the information stored in a user’s [profile](/users/concepts/overview-user-profile). A user’s profile (also known as the user’s account) is stored in Auth0, and changes to the information it contains may need to happen for a number of different reasons: + +* Self-served information updates +* Mandatory updates concerning your organizations T's & C’s +* Changes due to regulatory compliance + +::: warning +You cannot directly access a user profile across multiple Auth0 tenants. If you’re deploying multiple Auth0 tenants to production then this is something you need to be aware of. +::: + +An [Identity Provider](/identityproviders) populates a user’s profile using data supplied during the login process, and this is referred to as the [Normalized User Profile](/users/normalized/auth0). + +::: note +The Normalized User Profile is updated from the identity provider during login, and you can change the limited set of the information it contains through the Auth0 Management API. You can also use Auth0 extensibility, such as [Rules](/rules), as an alternative to override information in the Normalized User Profile. See [User Profile Data Modification](/users/concepts/overview-user-profile#user-profile-data-modification) for more information. +::: + +By default, there is one user profile created for each user identity, and there are a number of things to consider: + +* What should you do if you need to store information to help customize a user’s experience? +* What if you need to store user information that didn’t originate from an identity provider? +* Why would you need to store user-related information that a user cannot modify? +* What do you do if you need to store user-related information that a user cannot modify? +* What happens if a user forgets their password? +* What should a user do if they want to change their password? +<% if (platform === "b2b") { %> +* How do you provide an administrator from a third-party organization with the ability to manage their users? +<% } %> + +Auth0 provides for the storage of [Metadata](#metadata) against a user’s profile, which allows for the capture of additional information, such as preference for language and/or accessibility in order to enhance the user experience. Metadata can be used to store both information that a user can change, and also information they can’t; the latter giving you the capability of associating, for example, a user profile with records in your existing systems without modifying existing implementation. + +For users who forget their passwords or who are allowed to change their password via some existing self-service mechanism (or self-service mechanism you have planned), you can leverage Auth0-provided [Password Reset](#password-reset) functionality. This can be integrated with your existing implementation and comes already incorporated with any out-of-box Auth0 UI widgets including [Universal Login](/universal-login). + +You’ll also want to make sure that you are working with a [verified user account](#account-verification) at all times. Auth0 provides out-of-box mechanisms for doing that too. You should also consider [regulatory compliance](/compliance) such as ([GDPR](https://eugdpr.org/) which has very specific requirements when it comes to protecting EU citizens from privacy and data breaches. + +Though Auth0 doesn’t currently provide a centralized profile management portal out-of-the-box, for the purpose of self-serviced profile management, you can use the Auth0 Management API to build your own or utilize an already built UI. See our Auth0 [community guidance](https://community.auth0.com/t/how-to-allow-the-end-user-to-update-their-own-profile-information/6228)which describes the Management API endpoint. All calls to the Management API will require use of an [Access Token](/tokens/concepts/access-tokens). + +::: warning +Self-service profile management can raise security as well as data privacy concerns. For example, you may want to allow a user to change their email address, however, doing so without following best practice security guidance could result in a user locking themselves out of their account, leaking Personally Identifiable Information (PII), or worse, opening up a potential breach in security. +::: + +Alternatively, you can use the Auth0 Dashboard to [manage aspects of a user’s profile](users/guides/manage-users-using-the-dashboard). Managing a user’s profile via the Auth0 Dashboard is more of an administrative provision and **should not** be used for self-serviced profile management in a production environment. However, the interface provided by the Dashboard can be extremely useful during development as it provides a quick and simple way of manipulating a user’s profile information. + +<% if (platform === "b2b") { %> +If you need to provide a way for your customers to have an administrator manage their own users when they are storing those credentials in your system, you can either build something yourself or use an Auth0 Extension. See [Admin Portal](#admin-portal) for more information. +<% } %> + +::: panel Get Started with Auth0 Video +Watch this video [User Profiles](/videos/get-started/06-user-profiles) to learn what Auth0 User Profiles are used for and what they contain. Understand how Auth0 normalizes user profile data from various identity providers and uses metadata and root attributes. You can manage user profiles with the Auth0 Dashboard. +::: diff --git a/articles/architecture-scenarios/_includes/_profile-mgmt/_linking-accounts.md b/articles/architecture-scenarios/_includes/_profile-mgmt/_linking-accounts.md new file mode 100644 index 0000000000..572f16a38e --- /dev/null +++ b/articles/architecture-scenarios/_includes/_profile-mgmt/_linking-accounts.md @@ -0,0 +1,9 @@ +By default, there is one [user profile](/users/concepts/overview-user-profile) (user account) for each user identity. If you enable login from multiple identity providers - via Facebook or Google [social authentication](/architecture-scenarios/implementation/${platform}/${platform}-authentication#social-authentication) as well as via Auth0 [username and password authentication](/architecture-scenarios/implementation/${platform}/${platform}-authentication#username-and-password-authentication) - then each will have a separate user profile. You can use Auth0’s functionality for [linking user accounts](/users/concepts/overview-user-account-linking) to create one profile for a user as an aggregate of all their associated identities. + +The process of linking accounts merges user profiles in pairs: a primary account and a secondary account must be specified in the linking process. The number of accounts that can be linked, however, extends beyond a single pair. For example, you can use an account which already has multiple accounts merged with it as the primary, and link an additional secondary account to it. This means that one user account can have multiple identities associated with it, which provides a number of advantages: + +* Users can log in using multiple identities without creating a separate profile for each one. +* Registered users can use new login identities, but continue using their existing profile. +* Users can carry their profile around, irrespective of which identity they use for login. +* Users can link to an account with more identity information in order to provide a more complete profile. +* Your applications can retrieve connection-specific user profile data. diff --git a/articles/architecture-scenarios/_includes/_profile-mgmt/_metadata.md b/articles/architecture-scenarios/_includes/_profile-mgmt/_metadata.md new file mode 100644 index 0000000000..8fe125d585 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_profile-mgmt/_metadata.md @@ -0,0 +1,23 @@ +In addition to the Normalized User Profile information, [Metadata](/users/concepts/overview-user-metadata) can be stored in an Auth0 user profile. Metadata provides a way to store information that did not originate from an identity provider, or a way to store information that overrides what an identity provider supplies. + +::: panel Best Practice +Use of Metadata should follow Auth0 [user data storage best practices](/best-practices/user-data-storage-best-practices#metadata). Metadata storage is not designed to be a general purpose data store, and you should still use your own external storage facility when possible. Metadata size and complexity should also be kept to a minimum, and the Auth0 Management API has a strict set of guidance when it comes to updating and/or deleting metadata associated with a user. +::: + +You can manipulate metadata via both the Auth0 Management API and the Auth0 Authentication API. See [Manage User Metadata](/users/guides/manage-user-metadata) for more information. As is the case when managing the Normalized User Profile, calls to the Management API for manipulating Metadata requires use of an [Access Token](api/management/v2/tokens). + +::: warning +<%= include('../../_includes/_rate-limit-policy.md') %> +::: + +### User metadata + +User metadata (also referred to as `user_metadata`) is information that can be stored against a user profile and that a user can read and update as part of any self-service profile management. Metadata of this nature may be something like salutation for a user, or a user’s preferred language which could be used to [customize the emails](/email/templates#common-variables) sent by Auth0. + +::: panel Best Practice +Store any information that you want use to customize Auth0 emails in metadata and preferably `user_metadata` if the user is allowed to change it, such as information used to determine the language for an email. +::: + +### App metadata + +App metadata (also referred to as `app_metadata`) is, on the other hand, information that can be stored with a user profile but can **only be read or updated with appropriate authorization**; `app_metadata` is not directly accessible to a user. This type of metadata could be something like a flag to indicate that the last set of valid terms and conditions was accepted by the user, and a date to indicate when the user accepted them. diff --git a/articles/architecture-scenarios/_includes/_profile-mgmt/_password-reset.md b/articles/architecture-scenarios/_includes/_profile-mgmt/_password-reset.md new file mode 100644 index 0000000000..0407264659 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_profile-mgmt/_password-reset.md @@ -0,0 +1,9 @@ +For users who forget their passwords or who are allowed to change their password via some existing self-service mechanism, Auth0 provides [Password Reset](/connections/database/password-change) functionality. You can integrate this with your existing implementation and comes already incorporated with out-of-the-box Auth0 UI widgets included as part of [Universal Login](/universal-login). + +::: warning +Password change and password reset is only supported for Auth0 [Database Connection](/connections/database) types. +::: + +Auth0 Universal Login provides built-in UX support for password reset using Auth0 Authentication API functionality. Alternatively, you can use the [Auth0 Authentication API](/connections/database/password-change#use-the-authentication-api), through one of the Auth0 SDKs appropriate to your development environment. Email templates used during password reset workflow can also be fully customized, whether you use Auth0 out-of-box UI widgets or customized Universal Login. + +You can use the Auth0 Management API, on the other hand, to [directly change the password](/connections/database/password-change#directly-set-the-new-password) for a user identity defined using a Database Connection type. You can use the Auth0 Management API as part of any self-service profile management implementation, and also as part of any [Change Password page customization](/architecture-scenarios/implementation/${platform}/${platform}-branding#change-password-page-customization). diff --git a/articles/architecture-scenarios/_includes/_provisioning/_deprovisioning.md b/articles/architecture-scenarios/_includes/_provisioning/_deprovisioning.md new file mode 100644 index 0000000000..5571357acc --- /dev/null +++ b/articles/architecture-scenarios/_includes/_provisioning/_deprovisioning.md @@ -0,0 +1 @@ +Auth0 will *not* communicate with the upstream IdP if there is an active SSO session with Auth0, unless you force it with a `prompt=login`. If one of your customer organizations can not manage logout for those users, they may still have access after they’ve been decommissioned. Depending on the IdP, if Auth0 gets a token for their API, you can request information about the user from the IdP in a [rule](/rules) to poll whether that user should still have access or not. If you don’t have this ability, you will have to provide your customer organizations a way to trigger a block or decommission of users in your system either through an API call or a UI. diff --git a/articles/architecture-scenarios/_includes/_provisioning/_introduction.md b/articles/architecture-scenarios/_includes/_provisioning/_introduction.md new file mode 100644 index 0000000000..4a6ec7c089 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_provisioning/_introduction.md @@ -0,0 +1,33 @@ +Determining how users get signed up is important to address early, and the decisions you make here will influence many of the decisions you will need to make going forward. We’ve found there are a typical set of patterns for how users will get added to your system, and things to take note of when considering workflow design too. + +::: panel Best Practice +Whilst Auth0 supports numerous workflows, web based workflows using Auth0 [Universal Login](/universal-login) for sign up are considered both industry and Auth0 best practice as they provide for optimal functionality and the best security. +::: + +Auth0 supports user sign up via a number of different [identity providers](/identityproviders). During sign up, Auth0 provisions the [user profile](/users/concepts/overview-user-profile) so that it contains the user’s account information. There are a number of things to consider when looking at functionality and workflow: + +<% if (platform==="b2b") { %> +* Does a user get added to your company's domain or do they belong to or remain in their organization's domain? +* If the user stays in their own domain, do they belong to a single organization or can they belong to multiple organizations? +* How do you provision the organization itself in your system? +<% } %> +* Should you use Auth0 as an identity store? +* Can you use your own (legacy) identity store with Auth0? +* How do you migrate user identities from your identity store to Auth0? +<% if (platform==="b2c") { %> +* Can your users sign up using their existing social accounts such as Google and Facebook? +<% } %> +<% if (platform==="b2b") { %> +* Can your users sign up using their organization's identity provider? +* Can your users be invited or self register? + +One of the first determinations to make when providing your service(s) to other businesses is identifying to which domain users belong. Based on the answer to that question, there are a couple of different approaches you can take to provision those users. See [Provisioning organization users](#provisioning-organization-users) for more information. Once you know how you want organizations to be represented in your system, you will want too consider how you are going to provision the organization itself. See [Provisioning organizations](#provisioning-organizations) for more information. +<% } %> + +Auth0 provides out-of-the-box identity storage that can be leveraged to store user credentials safely and securely. See [Self Sign Up](#self-sign-up) for more information. If you already have a legacy identity store and you want to offload the management of it, then the [User Migration](#user-migration) capabilities provide you with a number of options to do so. + +Alternatively, if you have to maintain your legacy identity store - perhaps because you’ve got applications which you aren’t ready to migrate or which can’t be migrated - then you can use the [identity store proxy](#identity-store-proxy) capability. Allowing your customers to use “bring their own identity” is also an attractive proposition and though we find our customers don’t initially do so, you can use the [Social Sign Up](#social-sign-up) capability to provide it. + +::: panel Get Started with Auth0 Videos +Watch these two short videos [Provision: Users Stores](/videos/get-started/02-provision-user-stores) and [Provision: Import Users](/videos/get-started/03-provision-import-users) to learn how user profiles are provisioned within an Auth0 tenant and how Auth0 allows you to move your existing users to an Auth0 user store. +::: diff --git a/articles/architecture-scenarios/_includes/_provisioning/_organizations.md b/articles/architecture-scenarios/_includes/_provisioning/_organizations.md new file mode 100644 index 0000000000..7dd959ad2c --- /dev/null +++ b/articles/architecture-scenarios/_includes/_provisioning/_organizations.md @@ -0,0 +1,30 @@ +::: panel best practice +What you need to do when provisioning an organization will depend on how organizations are represented in your system. This can take some time to step back and consider how users of those organizations will be interacting with your applications. See [Multiple Organization Architecture](/media/articles/architecture-scenarios/planning/Multiple-Organization-Architecture-Multitenancy-Overview.pdf) to determine how to configure organizations for your IAM system. +::: + +When provisioning organizations you need to consider the following: + +* You will need to add the organization to your own application configuration and/or database +* You will need to make changes to your Auth0 configuration. This will include doing some or all of the following: + * Create a unique tenant + * Add a database connection (if you have isolated users per organization) + * Add an enterprise connection for this organization + * This will include working with the organization to either update their existing configuration or add configuration for your Auth0 tenant if they are not a legacy organization. + * Provision an administrator for the organization +* To avoid mistakes, you may want to create an [Organization Admin Portal](#organization-admin-portal) to make it easier to provision new organizations. + +### Organization Admin Portal +An organization admin portal is a portal that allows your administrators to create, modify, and remove organizations. There are multiple activities that need to be done both in your own system and your Auth0 tenant. This portal will likely need to exist in your own system so it has access to your datastores and configuration. However, Auth0 provides the [**Auth0 Management API**](/api/management/v2) so that you can incorporate changes to your Auth0 tenant at the same time that you create the changes in your own system. + +There are two main approaches that can be taken for creating a new organization. The one you choose depends highly on your tolerance for how long it would take to deploy a new organization. +* **Live Updates to your Auth0 Tenant**: If you want to be able to create new organizations in real-time, then you will likely want to make the changes directly to your Auth0 tenant using the Auth0 Management API. This allows the changes to take place in real-time and allow the addition of a new organization to take effect immediately. + +::: warning + Live Updates do come with some things to consider. There are certain operations that must be done in serial to avoid issues. Enabling clients on a connection, adding callback URL's to an Application are two examples. Any operation in the Management API where you must retrieve an entire list and re-submit the entire list with the new value added to it are operations that must be done in serial to avoid two parallel operations overwriting one of the values. +::: + +* **Change the Repository and Re-deploy**: If you are taking advantage of the Deploy CLI (or a custom CLI) as part of your [CI/CD pipeline]( /architecture-scenarios/implementation/${platform}/${platform}-deployment), you may prefer to push your changes directly to your repository and then kickoff a new deployment instead. This can take a little more time, but it has benefits associated with version history and the ability to backout a change by re-deploying the previous version. + +::: panel Best Practice +You may want to have a separate repository just for the items that the organizations need so that you don't have to re-deploy other common components and risk making an error. +::: diff --git a/articles/architecture-scenarios/_includes/_provisioning/_self-signup.md b/articles/architecture-scenarios/_includes/_provisioning/_self-signup.md new file mode 100644 index 0000000000..6799c34345 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_provisioning/_self-signup.md @@ -0,0 +1,5 @@ +Self sign up leverages Auth0 [Database Connections](/connections/database) to store the user ID, password, and (optional) username identity information collected from new users during the sign up process. Database connection policies governing things such as minimum [username length](connections/database/require-username#username-length) or [password strength and complexity](/connections/database/password-options) can be configured via the Auth0 Dashboard. + +::: panel Best Practice +Auth0 [Universal Login](/universal-login) as well Auth0 widgets such as [Lock](https://auth0.com/lock) integrate with Database Connections to provide comprehensive user interface functionality for sign up out-of-the-box. These UI artifacts are fully reactive, and with feature rich configuration and comprehensive customization, you can deploy functionality for user self sign up as well as login. +::: diff --git a/articles/architecture-scenarios/_includes/_provisioning/_social-signup.md b/articles/architecture-scenarios/_includes/_provisioning/_social-signup.md new file mode 100644 index 0000000000..c581a3e097 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_provisioning/_social-signup.md @@ -0,0 +1 @@ +Social signup is synonymous with sign in via [social authentication](/architecture-scenarios/implementation/${platform}/${platform}-authentication#social-authentication) - there’s no distinction here *per se*, as user [profile](/architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt) creation happens automatically upon first social login. diff --git a/articles/architecture-scenarios/_includes/_provisioning/_user-migration.md b/articles/architecture-scenarios/_includes/_provisioning/_user-migration.md new file mode 100644 index 0000000000..fea6aca40e --- /dev/null +++ b/articles/architecture-scenarios/_includes/_provisioning/_user-migration.md @@ -0,0 +1,17 @@ +In addition to hosting the [User Profile](/architecture-scenarios/implementation/${platform}/${platform}-profile-mgmt), Auth0 also has the capability to both [proxy](#identity-store-proxy) your own legacy identity store and provide a secure Auth0 hosted replacement. Both of these capabilities are supported via the use of Auth0 [Database Connections](/identityproviders#database-and-custom-connections). If you decide to use Auth0 as a replacement for your legacy identity store then you can migrate users either all at once with [Bulk Migration](users/concepts/overview-user-migration#bulk-user-imports-with-the-management-api), or progressively with [Automatic Migration](users/concepts/overview-user-migration#automatic-migrations). + +::: panel Best Practice +Customers often opt for a two-stage approach to user migration, using Automatic Migration first to migrate as many users as possible, then using Bulk Migration for the users that remain. See [User Migration Scenarios](users/references/user-migration-scenarios) for more information. +::: + +Automatic Migration is preferred as it allows users to be migrated individually and also allows them to retain their existing password in almost all situations. For Bulk Migration, we recommend using the [Management API](api/management/v2#!/Jobs/post_users_imports) over the [User Import/Export extension](/users/concepts/overview-user-migration#migrate-users-with-the-user-import-export-extension) in all but the most simple cases, as the Management API provides for greater flexibility and control. + +With Bulk Migration users typically need to **reset their password once migration is complete**, _unless_ passwords are stored hashed in your legacy identity store using bcrypt (or you can generate them in bcrypt form). In this case, you _may_ be able to use bulk migration and **preserve user passwords** as part of the process, depending on the bcrypt algorithm and the number of salt rounds used. See [Bulk Import Database Schema Examples](/users/references/bulk-import-database-schema-examples) for more information. + +::: panel Best Practice +<%= include('../../_includes/_rate-limit-policy.md') %> +::: + +### Identity store proxy + +Auth0 Database Connection types can also be configured to proxy an existing (legacy) identity store. If you need to keep user identities defined in your own legacy store - for example, if you have one or more business critical applications that you can’t migrate to Auth0, but which still need access to these identities - then you can easily integrate with Auth0. See [Authenticate Users Using Your Database](/connections/database/custom-db) for more information. diff --git a/articles/architecture-scenarios/_includes/_qa/_integration-testing.md b/articles/architecture-scenarios/_includes/_qa/_integration-testing.md new file mode 100644 index 0000000000..629c1f9d99 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_qa/_integration-testing.md @@ -0,0 +1,13 @@ +It is a recommended best practice that you set up different tenants for development, testing, and production as discussed in Architecture guidance for [SDLC support](architecture-scenarios/implementation/${platform}/${platform}-architecture#sdlc-support). Auth0 allows you to configure variables that are available from within custom [extensibility](/topics/extensibility); these can be thought of as environment variables for your Auth0 tenant. Rather than hard code references that change when moving code between development, test, and production environments, you can use a variable name that is configured in the tenant and referenced by the custom extensibility code. This makes it easier for the same custom code to function, without changes, in different tenants as the code can reference variables which will be populated with tenant-specific values at execution time: + +* For use of variables in Rules, see how to [configure values](/rules/guides/configuration#configure-values) +* For use of variables in Hooks, see how to configure [secrets](/hooks/secrets) in the editor +* For use of variables in Custom DB Scripts, see the [configuration parameters](/connections/database/custom-db/create-db-connection#step-3-add-configuration-parameters) + +::: panel Best Practice +It’s a recommended best practice to use variables to contain tenant-specific values as well as any sensitive secrets that should not be exposed in your custom code. If your custom code is deployed in GitHub, then using a tenant-specific variable avoids exposure of sensitive values via your GitHub repository. +::: + +### Test automation + +You can automate your overall build process by incorporating deployment automation as well as test automation. This can be used to deploy new versions of configuration and/or custom code to Auth0 and execute automated tests. If the tests uncover any failures, the deployment automation capabilities can be used to revert to the last working version. For further information, see the [deployment automation guidance](/architecture-scenarios/implementation/${platform}/${platform}-deployment) provided. diff --git a/articles/architecture-scenarios/_includes/_qa/_introduction.md b/articles/architecture-scenarios/_includes/_qa/_introduction.md new file mode 100644 index 0000000000..9f423218bc --- /dev/null +++ b/articles/architecture-scenarios/_includes/_qa/_introduction.md @@ -0,0 +1,11 @@ +Quality Assurance is important in identifying issues before they impact your customers and, depending on the nature of your project, there are several different types of quality assurance testing that you’re going to want to consider as part of your integration with Auth0: + +* Is your application easy to understand and use, even by those with a disability? +* Does your application need to work across various different browsers and devices? +* Does your application need to work in multinational and/or international environments? +* How will your application perform when subjected to unexpected production loads? +* How can you ensure your application is safe from security-related vulnerabilities? + +Auth0 [Universal Login](/universal-login) and associated UI widgets (such as [Lock](/libraries/lock)) have already been designed and built following usability and accessibility best practices, and provide tested out-of-box support for a whole host of [browsers and devices](/support/matrix#browsers). Support for [internationalization](/i18n) (I18N) is also provided out-of-box, with built-in extensibility designed for custom multi-language and localization (L10N) situations. + +To ensure functional requirements are met and unexpected events are handled correctly, guidance is provided for testing the [integration](#integration-testing) between your application(s) and Auth0, and for [unit testing](#unit-testing) individual extensibility modules (such as [Rules](/rules/guides/debug#try-this-rule), [Hooks](/hooks/update), and Custom Database scripts). Guidance is also provided regarding Auth0's [penetration testing policy](/policies/penetration-testing) to help when testing for security vulnerability, and also how [Mock](#mock-testing) testing can be leveraged in conjunction with our [load testing policy](/policies/load-testing) to help ensure your application(s) perform under unexpected load. diff --git a/articles/architecture-scenarios/_includes/_qa/_load-testing.md b/articles/architecture-scenarios/_includes/_qa/_load-testing.md new file mode 100644 index 0000000000..1761e56882 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_qa/_load-testing.md @@ -0,0 +1,15 @@ +Load tests require prior approval from Auth0, as explained in the Auth0 [load test policy](/policies/load-testing). Be sure to note the lead time for a request to be reviewed and allow enough time for review as well as conducting the tests. If your load test request has been approved, the following guidance can help avoid errors and faulty test results. + +* Run an HTTP trace on a test execution of your application to identify all the calls your application or intended test needs to make, and make sure your test includes them so it is representative of what will happen in production. +* Design your test to be mindful of Auth0 API rate limits. +* Use of any custom code in Auth0 (Rules, Custom DB scripts, Hooks, Custom OAuth connections) will invoke the Auth0 custom code sandbox and this may cost more in terms of performance. Turn off Rules unless they are essential to the test. If they are off you will have higher throughput than if they are on. +* Estimate the expected overall load for your production environment and percent of calls to each endpoint and structure your performance test accordingly so it gives you a realistic test result. Different endpoints have different performance costs. Failure to design a representative test will result in misleading results. +* Don’t make calls that depend on the results of earlier calls without checking that pre-requisite calls or responses have completed. Simply building in a delay may not be adequate. +* Be sure to implement adequate error handling. A frequent cause of issues during tests is errors in custom code (rules, hooks, Custom db scripts, Custom OAuth connection scripts) caused by unhandled exceptions in the custom code. +* Load tests should be written to start at a low level and increase the load gradually, capturing data at each level, to get the most useful results. Starting at a high level and immediately failing gives less information about what the system can sustain. +* It is normal to need to run a performance test multiple times, possibly adjusting the code under test or the test harness/configuration. Be sure to start your testing early to allow enough time for more than one iteration. +* Use your own mail provider account and make sure to arrange ahead of time for enough mail-sending quota or you may be rate-limited by the mail provider. Turn off mail sending if you do not use it. +* Be sure to use your own account credentials for all social connections rather than Auth0 dev keys. In the Auth0 dashboard, go to Connections -> Social -> {name of connection} - to see instructions for how to add your own social provider account credentials into the connection. +Note: some social providers do not allow load testing. Check your provider(s) for their policy +* In order to avoid rate limiting, and more accurately simulate real load, your tests will need to send requests for different users, not all requests for the same user. If you use only one or a few users, caching may reduce the effective load and not provide realistic results. +* Be sure to stay within the agreed-upon parameters for the test and the Auth0 [load test policy](/policies/load-testing). Auth0 reserves the right to terminate any performance/load testing which does not stay within the bounds of agreed-upon parameters or which extends beyond the scheduled test window. diff --git a/articles/architecture-scenarios/_includes/_qa/_mock-testing.md b/articles/architecture-scenarios/_includes/_qa/_mock-testing.md new file mode 100644 index 0000000000..786ee3b346 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_qa/_mock-testing.md @@ -0,0 +1 @@ +In a balance between Auth0’s [load testing policy](/policies/load-testing) and the desire to load test, it is common practice among Auth0’s customers to mock out Auth0’s endpoints. This is a valuable practice in order to ensure that your application works with your expected interfaces without having to restrict your testing, and tools such as [MockServer](http://www.mock-server.com/), [JSON Server](https://github.com/typicode/json-server) or even [Postman](https://learning.getpostman.com/docs/postman/mock_servers/setting_up_mock/) can be used to assist. diff --git a/articles/architecture-scenarios/_includes/_qa/_unit-testing.md b/articles/architecture-scenarios/_includes/_qa/_unit-testing.md new file mode 100644 index 0000000000..a8ebd23233 --- /dev/null +++ b/articles/architecture-scenarios/_includes/_qa/_unit-testing.md @@ -0,0 +1 @@ +The objective of unit testing is to test individual units of code. If you create custom code within Auth0 in the form of Rules, Hooks, and/or Custom DB scripts, you should consider use a testing framework (such as [Mocha](https://mochajs.org/)) to test your code. Companies who have been most successful with Auth0 have found it useful to execute these unit tests prior to [automatically deploying](/architecture-scenarios/implementation/${platform}/${platform}-deployment) Auth0 tenant configuration and collateral. diff --git a/articles/architecture-scenarios/_includes/_rate-limit-policy.md b/articles/architecture-scenarios/_includes/_rate-limit-policy.md new file mode 100644 index 0000000000..ce743cf61d --- /dev/null +++ b/articles/architecture-scenarios/_includes/_rate-limit-policy.md @@ -0,0 +1 @@ +Calls to the Management API are subject to [Auth0 Rate Limiting policy](/policies/rate-limits). You must take this into consideration, and to assist, Auth0 generally recommends use of the appropriate [Auth0 SDK](/libraries) for your development environment rather than calling our APIs directly. diff --git a/articles/architecture-scenarios/b2b-b2e.md b/articles/architecture-scenarios/b2b-b2e.md index f74ce7ba08..590a1cea72 100644 --- a/articles/architecture-scenarios/b2b-b2e.md +++ b/articles/architecture-scenarios/b2b-b2e.md @@ -1,6 +1,6 @@ --- order: 07 -title: Business to Business + Enterprise Identity Scenarios +title: Business to Business + Employees Identity Scenarios image: /media/articles/architecture-scenarios/b2b-b2e.png extract: This is essentially a hybrid between B2B and B2E where you have a larger SAAS application, like Zendesk for example, where users are grouped into companies. description: Explains the architecture scenario of a hybrid between B2B and B2E where you have a larger SAAS application. @@ -20,7 +20,7 @@ useCase: - build-an-app --- -# Business to Business + Enterprise Identity Scenarios +# Business to Business + Employees Identity Scenarios ::: note This architecture scenario is under construction and will be updated soon. @@ -36,7 +36,7 @@ The following is a list of articles on this website which will help you to imple * [Lock](https://auth0.com/lock) * [Protocols supported by Auth0](/protocols) -* [Connect Active Directory with Auth0](/connections/enterprise/active-directory) +* [Connect Active Directory with Auth0](/connections/enterprise/active-directory-ldap) * [SAML](/saml-configuration) * [Using Auth0 in SaaS, multi-tenant Apps](/saas-apps) * [Identity Providers supported by Auth0](/identityproviders) diff --git a/articles/architecture-scenarios/b2b.md b/articles/architecture-scenarios/b2b.md index ffc76d9cc0..ec33e404f6 100644 --- a/articles/architecture-scenarios/b2b.md +++ b/articles/architecture-scenarios/b2b.md @@ -1,41 +1,52 @@ --- -order: 05 -title: Business to Business Identity Scenarios -image: /media/articles/architecture-scenarios/b2b.png -extract: In this scenario you usually have a larger SAAS application, like Zendesk for example, where their customers are typically other companies which are registered as tenants. -description: Explains the architecture scenario of B2B with large SAAS application. -beta: true +url: /architecture-scenarios/b2b +classes: topic-page +title: Business to Business Identity and Access Management +description: Explains the architecture scenario B2B IAM with a SAAS application. topics: - b2b - - architecture - - lockjs - - active-directory -contentType: concept + - b2biam + - SDLC +contentType: index useCase: - - invoke-api - - secure-an-api - - build-an-app + - implementation --- + +

      +
      +

      Business to Business Identity and Access Management

      +

      + This guidance is relevant to all project stakeholders. We recommend reading it in its entirety at least once, even if you've already started your journey with Auth0. We provide a Project Planning Guide in PDF format, details about how to get started with each phase of the implementation process, and checklists to help you manage the tasks in each phase. +

      +
      -# Business to Business Identity Scenarios +<%= include('./_includes/_base-ways-to-integrate.md', { platform: 'b2b' }) %> -::: note -This architecture scenario is under construction and will be updated soon. -::: +## Project Planning Guide -![](/media/articles/architecture-scenarios/b2b.png) +<%= include('./_includes/_planning.md', { platform: 'b2b' }) %> -In this scenario you usually have a larger SAAS application, like Zendesk for example, where their customers are typically other companies which are registered as tenants. Each of these companies (also referred to as tenants) will have their own set of users who can access the information of that tenant on the SAAS application. +## Multiple Organization Architecture (Multitenancy) -When a tenant is smaller, these users can be stored and authenticated with a Database connection (username/password). Some of the tenants may also be large enterprise companies who wants federate their enterprise directory so they can manage their own users and the users can log in with their existing enterprise credentials. +<%= include('./_includes/_multitenancy.md', { platform: 'b2b' }) %> -## Read More +## Get started -The following is a list of articles on this website which will help you to implement this scenario: +<%= include('./_includes/_base-intro.md', { platform: 'b2b' }) %> -* [Lock](https://auth0.com/lock) -* [Protocols supported by Auth0](/protocols) -* [Using Auth0 in SaaS, multi-tenant Apps](/saas-apps) -* [Identity Providers supported by Auth0](/identityproviders) -* [Connect Active Directory with Auth0](/connections/enterprise/active-directory) -* [Social Login](https://auth0.com/learn/social-login/) +<%= include('../_includes/_topic-links', { links: [ + 'architecture-scenarios/implementation/b2b/b2b-architecture', + 'architecture-scenarios/implementation/b2b/b2b-provisioning', + 'architecture-scenarios/implementation/b2b/b2b-authentication', + 'architecture-scenarios/implementation/b2b/b2b-branding', + 'architecture-scenarios/implementation/b2b/b2b-deployment', + 'architecture-scenarios/implementation/b2b/b2b-qa', + 'architecture-scenarios/implementation/b2b/b2b-profile-mgmt', + 'architecture-scenarios/implementation/b2b/b2b-authorization', + 'architecture-scenarios/implementation/b2b/b2b-logout', + 'architecture-scenarios/implementation/b2b/b2b-operations' +] }) %> + +## Implementation planning checklists + +<%= include('./_includes/_implementation-checklists.md') %> diff --git a/articles/architecture-scenarios/b2c.md b/articles/architecture-scenarios/b2c.md index 716ac57a50..f9e43afa16 100644 --- a/articles/architecture-scenarios/b2c.md +++ b/articles/architecture-scenarios/b2c.md @@ -1,108 +1,49 @@ --- -order: 04 -title: Business to Consumer Identity Scenarios -image: /media/articles/architecture-scenarios/b2c.png -extract: Usually eCommerce or SAAS applications which have end users (consumers) as customers and the application typically used OpenID Connect as a protocol to communicate with Auth0. -description: Explains the architecture scenario B2C with an eCommerce or SAAS application. +url: /architecture-scenarios/b2c +classes: topic-page +title: Business to Consumer Identity and Access Management +description: Explains the architecture scenario B2C IAM with an eCommerce or SAAS application. topics: - b2c - - architecture - - db-connections - - passwordless - - saml + - CIAM + - SDLC contentType: concept useCase: - - invoke-api - - secure-an-api - - build-an-app + - implementation --- - -# Business to Consumer Identity Scenarios - -Customer identity management doesn't need to be overwhelming. This guide outlines some common requirements for business to consumer (B2C) applications and how Auth0 can help you meet them. - -Here you'll find tips on setting up user signup/login, enriching user profiles, obtaining consent for user data, and more. Let's get started! - -## User signup - -One of the first things you'll want to set up is a user signup and login page. The [Universal Login page](/hosted-pages/login) with Lock gives you secure user authentication out-of-the-box. It supports single sign-on, passwordless login, and is customizable from the Dashboard. By using Universal Login you can focus more on the core value of your application instead of user signup. - -## Progressive profiling - -First name, last name, email, confirm email, username, password, confirm password, phone number, company name, country, address line 1, address line 2, city, state, zip code, date of birth, favorite color, shoe size, highest scrabble score. - -A signup screen with 10-20 fields makes users hesitate before signing up. Many may not even sign up at all. To reduce barriers to entry, only require the minimum fields for signup and collect more information later. This is called [progressive profiling](/user-profile/progressive-profiling). There are two ways you can perform progressive profiling with Auth0: the Management API and Rules. - -With the Auth0 Management API you can update user profiles at any time after signup. You can collect data while a user uses your application, then make incremental updates their profile. - -You can have users provide more information by adding a profile collection form into the login process. To do this, create [a Rule that redirects users](/rules/current/redirect) to the form and then returns them to Auth0. Once returned, finish authentication and update the profile. - -Any information captured during signup or progressive profiling can be stored in the Auth0 user profile. You can pass this information to the application through authentication tokens or get it using the Auth0 APIs. - -## Social login - -Auth0 makes it easy to enable [login with social identity providers](/identityproviders#social). After a few simple configuration steps, users can log in with their Google, Facebook, LinkendIn, or other social accounts. - -Social login removes potential barriers for users. Instead of giving a username and password, login becomes a single click. Once a user logs into a social provider their browser keeps a single sign-on session for them. This lets them access other applications that use the same provider without typing in their credentials again and again. - -Social login also provides consent screens. So if users give consent, your application can access select user profile attributes about the user. - -## Single sign-on - -If you offer a suite of applications, you may need [single sign-on (SSO)](/sso/current) across them, so users only have to log in once. - -Auth0 supports integration with applications that externalize authentication using industry standard identity protocols: OIDC/OAuth, SAML2 or WS-Fed. Once integrated and configured, your connected applications can use other social identity providers, an Auth0 database, or a database that stores user identities. Auth0 serves as the broker between the applications and the different identity providers. - -Now when a user signs in to one of your applications, they can access other applications integrated with Auth0 without having to log in again. This will be true until their SSO session expires. You should configure the SSO session length within Auth0 to meet security policies. - -## Account linking - -Social logins are convenient for users, but social providers may only have a few user profile attributes. You'd like to build rich user profiles, store them in Auth0, but not lose the convenience of social logins. You can do this with [account linking](/link-accounts). - -Account linking lets users link one or more social logins to their Auth0 profile. This creates a merged user profile with attributes from the social provider and from the user profile from Auth0. When a user logs in through a social provider, your application sees the merged profile. - -## Extensibility with augmented user profiles - -You may want to enrich user profiles with data obtained from other sources. [Auth0 Rules](/rules) enable you to write small snippets of code that execute during the authentication transaction. This lets you call other services for user information, then add it to the Auth0 user profile. - -## Passwordless login - -Sometimes users forget their passwords. [Passwordless login](/connections/passwordless) lets users authenticate with a one-time code sent via SMS or email. This is useful for applications that aren't used very often or primarily used on small mobile devices where it is cumbersome to enter a password. - -Auth0 supports several forms of passwordless login. So based on the needs of your users and application, you can choose the ones that fit. Note that using passwordless login may require you to get additional services. For example, a service to send SMS messages. - -## Multi-factor authentication - -Is your application handling sensitive content? You may want to offer [multi-factor authentication](/mfa) to your users. With malware threats and data breaches, multi-factor authentication is more popular among users. - -Auth0 provides a variety of ways to implement multi-factor authentication. For more flexibility, you can use Rules to turn it on only for users who opt-in for it. - -## Branding - -Branding is an important part of any application. Your logo, colors and styles should be consistent in all parts of the application. You can [customize](/libraries/custom-signup) the login, signup, and error pages displayed by Auth0 so it matches your application. Add your own logo, text, and colors. There's also I18N/L10N support for global rollouts. [Emails for verification or password resets](/email/templates) are customizable too. - -[Login screens](/libraries/lock/v11/ui-customization) should appear to come from your application’s branded domain name. To maintain consistency, you can define a [custom domain name](/custom-domains) for the login screen displayed by Auth0. - -## Privacy consent page - -If your application is used by consumer users, your application is very likely subject to many privacy regulations. These may include the obligation to [provide privacy notices and obtain user consent](/compliance/gdpr/features-aiding-compliance/user-consent), track consent and provide users with access to their data, among others. - -To help with privacy-related requirements, Auth0 provides support for showing consent pages, obtaining and tracking consent, and providing access to user profile information held about a user. - -## GDPR support - -If your application is likely to store data about users in the European Union, then your application is subject to the requirements of the [General Data Protection Regulation (GDPR)](/compliance/gdpr), which took effect on May 25th 2018. The GDPR adds some new requirements and significant new fines, so make sure your application complies with the regulations. - -Auth0 has [features to help you meet GDPR obligations](/compliance/gdpr/features-aiding-compliance). You can display a consent page and track the user’s consent via the Lock widget. The consent status can then be stored in the Auth0 user profile for each consenting user. With the Management API you can get users to satisfy data access requests, as well as give data to users in JSON format to satisfy data portability requirements. - -## Anomaly Detection - -An unfortunate part of modern life on the internet is hackers. Hackers are constantly trying to find a way into applications. For example, they may try to log in using common passwords. Or they may use credentials stolen from elsewhere, hoping that users re-used the same passwords at other sites. - -Auth0's [Anomaly Detection](/anomaly-detection) detects these situations for Auth0 Database Connections and provides options for how to respond. Turn on Anomaly Detection and configure the response options so you can respond appropriately if such an event occurs. - -## Github Deployment - -Do you manage a lot of your application code in Github? You can deploy code for rules, hooks, or custom database access from there with Auth0's [Github Deployment extension](/extensions/github-deploy). - -If you have a full continuous integration/continuous deployment pipeline, use the [Auth0 Deploy CLI tool](https://github.com/auth0/auth0-deploy-cli) for greater flexibility. + +
      +
      +

      Business to Consumer Identity and Access Management

      +

      + This guidance is relevant to all project stakeholders. We recommend reading it in its entirety at least once, even if you've already started your journey with Auth0. We provide a Project Planning Guide in PDF format, details about how to get started with each phase of the implementation process, and checklists to help you manage the tasks in each phase. +

      +
      + +<%= include('./_includes/_base-ways-to-integrate.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('./_includes/_planning.md', { platform: 'b2c' }) %> + +## Get started + +<%= include('./_includes/_base-intro.md', { platform: 'b2c' }) %> + +<%= include('../_includes/_topic-links', { links: [ + 'architecture-scenarios/implementation/b2c/b2c-architecture', + 'architecture-scenarios/implementation/b2c/b2c-provisioning', + 'architecture-scenarios/implementation/b2c/b2c-authentication', + 'architecture-scenarios/implementation/b2c/b2c-branding', + 'architecture-scenarios/implementation/b2c/b2c-deployment', + 'architecture-scenarios/implementation/b2c/b2c-qa', + 'architecture-scenarios/implementation/b2c/b2c-profile-mgmt', + 'architecture-scenarios/implementation/b2c/b2c-authorization', + 'architecture-scenarios/implementation/b2c/b2c-logout', + 'architecture-scenarios/implementation/b2c/b2c-operations', + 'architecture-scenarios/implementation/b2c/b2c-launch' +] }) %> + +## Implementation planning checklists + +<%= include('./_includes/_implementation-checklists.md') %> diff --git a/articles/architecture-scenarios/b2e.md b/articles/architecture-scenarios/b2e.md index 64af00841d..a35f10a932 100644 --- a/articles/architecture-scenarios/b2e.md +++ b/articles/architecture-scenarios/b2e.md @@ -1,6 +1,6 @@ --- order: 06 -title: Business to Enterprise Identity Scenarios +title: Business to Employees Identity Scenarios image: /media/articles/architecture-scenarios/b2e.png extract: Large organization who wants to federate their existing enterprise directory service to allow employees to log in to applications using their existing enterprise credentials. description: Explains the architecture scenario of B2E with a large organization that wants to extend their existing enterprise directory service. @@ -18,17 +18,17 @@ useCase: - build-an-app --- -# Business to Enterprise Identity Scenarios +# Business to Employees Identity Scenarios -The B2E (Business to Enterprise) scenario involves applications that are used by employee users. These are applications that are targeted toward users who are typically acting on behalf of an organization such as an employer, a university, or a group in which they are a member, as opposed to acting on their own behalf. +The B2E (Business to Employees) scenario involves applications that are used by employee users. These are applications that are targeted toward users who are typically acting on behalf of an organization such as an employer, a university, or a group in which they are a member, as opposed to acting on their own behalf. -Such applications that are custom written by the organization may use the OIDC/OAuth protocol to externalize authentication whereas those that have been purchased will often use the SAML protocol. In either case, the enterprise will typically want to use some form of Enterprise connection, such as a SAML Identity Provider, ADFS, Google Apps, Azure AD or a directory service such as AD or OpenLDAP, and less frequently, a custom DB, for authentication of enterprise users. +Such applications that are custom written by the organization may use the OIDC/OAuth protocol to externalize authentication whereas those that have been purchased will often use the SAML protocol. In either case, the enterprise will typically want to use some form of Enterprise connection, such as a SAML Identity Provider, ADFS, G Suite, Azure AD or a directory service such as AD or OpenLDAP, and less frequently, a custom DB, for authentication of enterprise users. For a business that is creating or integrating applications with Auth0 for a B2E environment, there are several requirements that are common for this scenario. This guide will summarize the most common requirements for B2E applications and explain the Auth0 features which help meet each need. ## Enterprise providers -Most businesses already have a corporate identity repository which has information on all the employee users and user profile information. It may also contain information on partners and contractors. A common requirement for the B2E scenario therefore, is to allow such users to log in via [Auth0 Enterprise connections](/identityproviders#enterprise) such as SAML2 providers, ADFS, Google Apps, Azure AD or an on-premise corporate directory service. This is attractive to users because it allows them to avoid creating yet another username and password for each application and instead leverage the same login credential across all their enterprise applications. +Most businesses already have a corporate identity repository which has information on all the employee users and user profile information. It may also contain information on partners and contractors. A common requirement for the B2E scenario therefore, is to allow such users to log in via [Auth0 Enterprise connections](/connections/identity-providers-enterprise) such as SAML2 providers, ADFS, G Suite, Azure AD or an on-premise corporate directory service. This is attractive to users because it allows them to avoid creating yet another username and password for each application and instead leverage the same login credential across all their enterprise applications. This is especially attractive to security interests within the company because user credentials are only exposed to the identity stack instead of to each application. Furthermore, this architecture allows the business to retain control over access to applications because the enterprise identity provider provides a single shutoff point. If a user leaves the organization, administrators can simply disable the user’s account in the corporate identity provider and the user can no longer log in to any of the applications using that identity provider. @@ -36,23 +36,25 @@ Auth0 makes it easy to enable login via a wide variety of enterprise providers w ## Groups and roles -With a lot of users, you may set up groups and roles to manage access and privileges. Often, these are stored and administered in a directory service. +With a lot of users, you may set up groups and roles to manage access and privileges. Often, these are stored and administered in a directory service. Auth0 can get user attributes, like groups and roles, from a directory service or enterprise identity provider during authentication. You can then make the attributes available through tokens returned to the application or with the Auth0 Management API. ## Profile translation -Sometimes a directory or identity provider returns attributes in one format, but your application uses another format. Using Auth0's [Rules](/rules), you can map and translate user profile attributes. You can even translate between OIDC/OAuth, SAML, WS-Fed, and LDAP. +Sometimes a directory or identity provider returns attributes in one format, but your application uses another format. Using Auth0's [Rules](/rules/current/metadata-in-rules), you can [map and translate user profile attributes](https://auth0.com/rules/saml-attribute-mapping). You can even translate between OIDC/OAuth, SAML, WS-Fed, and LDAP. -For example, you retrieve attributes in SAML assertion format from a SAML Identity Provider. You can then [translate the attributes to custom claims](/metadata) in an ID Token for an OIDC/OAuth application. +For example, you retrieve attributes in SAML assertion format from a SAML Identity Provider. With a rule you can then translate the attributes to custom claims in an ID Token for an OIDC/OAuth application. + +You can also map SAML attributes to the Auth0 user profile from the dashboard. To do this, go to [Connections > Enterprise > SAMLP Identity Provider](${manage_url}/#/connections/enterprise), select your SAML connection, and set your attribute mappings in the **Mappings** tab. ## Extensibility with augmented user profiles -You may want to enrich user profiles with data obtained from other sources, such as a corporate policy server or preference server. [Auth0 Rules](/rules) enable you to write small snippets of code that execute during the authentication transaction. This lets you call other services for user information, then add it to the [Auth0 user profile](/metadata). +You may want to enrich user profiles with attributes or data retrieved from other services. For example, you might receive an address or phone number and wish to translate that into a geographic region. [Auth0 Rules](/rules) enable you to write small snippets of code that execute during the authentication transaction. This lets you execute logic or call other services for user information, then add [user metadata](/users/concepts/overview-user-metadata) to the Auth0 user profile and optionally the resulting tokens sent to your applications. -## Single sign-on +## Single Sign-on -If you have several internal applications, you can set up [single sign-on (SSO)](/sso/current) across them so users only have to log in once. +If you have several internal applications, you can set up [Single Sign-on (SSO)](/sso) across them so users only have to log in once. Auth0 supports integration with applications that externalize authentication using industry standard identity protocols: @@ -64,11 +66,11 @@ After some configuration, all your applications can leverage your enterprise ide Now when a user signs in to one application, they can access other applications integrated with Auth0 without having to log in again. This will be true until their SSO session expires. You should configure the SSO session length within Auth0 to meet security policies. -## Single sign-on integrations +## Single Sign-on integrations -You can also integrate purchased applications with Auth0 for single sign-on (SSO). Auth0 provides [pre-built integrations](/integrations/sso) for applications such as: +You can also integrate purchased applications with Auth0 for Single Sign-on (SSO). Auth0 provides [pre-built integrations](/integrations/sso) for applications such as: -* SalesForce +* Salesforce * Zendesk * Slack * New Relic @@ -95,7 +97,7 @@ Log events each have an event type. You can use event types as filters when quer ## Monitoring -Monitoring the infrastructure and services that your applications depend on is critical. [Auth0 provides monitoring endpoints](/monitoring/how-to-monitor-auth0) as well as a status page you can subscribe to. +Monitoring the infrastructure and services that your applications depend on is critical. Auth0 provides an [Auth0 Status](https://status.auth0.com) page you can subscribe to. Auth0 makes every effort to minimize outages, but if there is any disruption to service, it will appear on the status page. To support requirements for root cause analysis documentation after a disruption, Auth0 conducts internal analysis and publishes the results on the disruption notice when the analysis is completed. @@ -103,7 +105,7 @@ Auth0 makes every effort to minimize outages, but if there is any disruption to An unfortunate part of modern life on the internet is hackers. Hackers are constantly trying to find a way into applications. For example, they may try to log in using common passwords. Or they may use credentials stolen from elsewhere, hoping that users re-used the same passwords at other sites. -Auth0's [Anomaly Detection](/anomaly-detection) detects these situations for Auth0 Database connections and provides options for how to respond. Turn on Anomaly Detection and configure the response options so you can respond appropriately if such an event occurs. +Auth0's [Attack Protection](/attack-protection) detects these situations for Auth0 Database connections and provides options for how to respond. Turn on Attack Protection and configure the response options so you can respond appropriately if such an event occurs. ## Github Deployment diff --git a/articles/architecture-scenarios/checklists.md b/articles/architecture-scenarios/checklists.md new file mode 100644 index 0000000000..16712907ca --- /dev/null +++ b/articles/architecture-scenarios/checklists.md @@ -0,0 +1,72 @@ +--- +title: Implementation Planning Checklists +description: Links to checklists for your implementation. +topics: + - SDLC + - checklists + - best practices + - implementation checklist +contentType: reference +useCase: + - implementation +--- +# Implementation Planning Checklists + +Click the links below to download a checklist that corresponds to a phase in the SDLC (Software Development Lifecycle). You can open the checklist in any spreadsheet application and customize them to suit your needs. + +## ![](/media/articles/architecture-scenarios/checklists/file_type_icons-02.png) Analyze Checklist + +Analyze Checklist Download + +In the Analyze phase, analyze end-user business requirements and determine project goals as part of the high-level plan for the project. Convert the requirements and goals into system functions that the organization intends to develop. Activities include: + +* Gathering business requirements +* Creating process diagrams +* Performing detailed analysis +* Alignment to project plan + +## ![](/media/articles/architecture-scenarios/checklists/file_type_icons-02.png) Design Checklist + +Design Checklist Download + +In the Design phase, describe the desired features and operations of the system, including business rules, pseudo-code, screen layouts, and other necessary documentation. Activities include: + +* Infrastructure design +* System model design + +## ![](/media/articles/architecture-scenarios/checklists/file_type_icons-02.png) Build Checklist + +Build Checklist Download + +In the Build phase, develop the actual system through implementation of infrastructure and code. Activities include: + +* Infrastructure implementation +* Code implementation + +## ![](/media/articles/architecture-scenarios/checklists/file_type_icons-02.png) Test Checklist + +Test Checklist Download + +In the Test phase, integrate and deploy all implemented code in the testing environment infrastructure. Testing then follows Software Testing Life Cycle activities to check the system for errors, bugs, and defects to verify that system features work as expected (or not). Activities include: + +* Write test cases +* Execute test cases + +## ![](/media/articles/architecture-scenarios/checklists/file_type_icons-02.png) Deploy Checklist + +Deploy Checklist Download + +In the Deploy phase, deploy the system to either a staging or production environment, where actual users begin to operate and interact with it. + +Eventually, you deploy all components of the system to the production environment when you make a live release. + +## ![](/media/articles/architecture-scenarios/checklists/file_type_icons-02.png) Monitor Checklist + +Monitor Checklist Download + +In the Monitor phase, make enhancements, corrections, and changes to ensure the system continues to work and stays updated to meet the business objectives and support the needs of the users. Activities include: + +* Monitoring +* Maintenance +* Changes and adjustments +* Upgrade and adapt to future needs diff --git a/articles/architecture-scenarios/implementation-resources.md b/articles/architecture-scenarios/implementation-resources.md new file mode 100644 index 0000000000..b4c4f6a955 --- /dev/null +++ b/articles/architecture-scenarios/implementation-resources.md @@ -0,0 +1,115 @@ +--- +title: Implementation Resources +description: Learn about all the resources Auth0 provides to help you with your Auth0 implementation. +toc: true +topics: + - architecture + - api-auth + - sample-code + - sdks + - documentation + - guides + - quickstarts +contentType: concept +useCase: + - get-started + - implementation + - learning + - testing + - run-sample-code + - get-help + - enter-support-ticket +--- +# Implementation Resources + +Auth0 provides a wealth of resources to help you effectively engage with our product and community. This list provides links to the resources available, by category. + +## Get started + +Resources designed to help you learn the basics of Auth0 include: + +* [**Getting Started documentation**](/getting-started): Explore the Auth0 Dashboard and common terms used for components of the Auth0 service. Gain a broad understanding of Auth0 and learn the terminology you might hear when working with Auth0 staff or reading our docs. + +* [**Get Started with Auth0 Video Series**](/videos/get-started): In these short videos, we cover how easy it is to complete the basic steps to use Auth0 with your applications. Watch the series before you start your project so you can get the benefit of our knowledge and experience with other customers. We cover tenant configuration, provisioning user stores and importing users, authentication, authorization, and branding and customization of everything shown to your users. + +* [**Architecture scenarios**](/architecture-scenarios): Review common architecture scenarios and learn how to implement them with Auth0. Scenarios include tutorials for common architecture patterns, such as a Single-Page Application (SPA) calling an API. High-level descriptions are useful for architects, while tutorials will help development teams. + +* [**Implementation guides**](/topics/guides): Learn how to implement commonly-used features, such as user management and multi-factor authentication (MFA). This information is useful for both architects and developers. + +## Learn + +Auth0 provides numerous tutorials, guides, white papers, and blog posts that focus on both learning and providing quick reference checks. + +* [**Docs site**](https://auth0.com/docs/): Browse through our docs to explore a wealth of available topics, or use our search to quickly find content related to a topic or term. + +* [**Feature descriptions and white papers**](https://auth0.com/learn/): Investigate short descriptions of features, industry case studies, and reference white papers. The Auth0 Learn site provides a quick overview of Auth0 features and their business value; it is helpful for project owners as well as architects and developers. + +* [**Blog posts**](https://auth0.com/blog/): Read blog posts written by experts on a variety of topics--from time-honored advice to breaking news in the identity space. Many blog posts are oriented toward architects and developers. + +## Run sample code + +Once your development team is ready to build, Auth0 provides sample programs, SDKs, and libraries to speed your project along. + +* [**Quickstarts**](/quickstarts): Investigate a rich array of small sample programs that demonstrate how to implement the key features you’ll want to include in your program, such as authentication, session management, profile updates, and logout. Quickstarts will give developers a head start on understanding how to integrate applications with Auth0. + +* [**Libraries and SDKs**](/libraries): Simplify your custom application development by using our extensive set of libraries and SDKs, which abstract many of the details of identity protocols for you. Auth0 SDKs support numerous languages and frameworks to simplify your integration with Auth0. We also provide a library for Lock, a login widget, that you can use across several platforms, including iOS and Android. + +* [**Management API**](/api/management/v2): Explore and manipulate objects, configurations, and settings within Auth0. The Management API Explorer allows you to quickly manipulate individual objects and settings on an *ad-hoc* basis and test API calls before coding them into your applications. + +* [**Authentication API**](/api/authentication): Authenticate and authorize users via the OIDC, OAuth, and SAML protocols. The Authentication API Explorer allows you to experiment with authentication and authorization flows, and test API calls before coding them into your applications. + +## Try out features and API calls + +While building, Auth0 allows you to experiment with and test out various product features. + +* **TRY buttons/links**: Quickly try out Auth0 product features. **TRY** buttons are located throughout Auth0 and allow you to experiment with connections, rules, hooks, and email templates. + +* [**Authentication API Explorer**](/api/authentication#introduction): Experiment with authentication and authorization flows, and test API calls before coding them into your applications. + +* [**Management API Explorer**](/api/management/v2): Quickly manipulate individual objects and settings on an *ad-hoc* basis and test API calls before coding them into your applications. + +* [**Postman Collections**](/api/postman): Easily dissect our APIs' calls using Postman by importing our Postman Collections. + +## Get help + +Auth0 resources that help you troubleshoot your implementation include: + +* [**Auth0 Community forum**](https://community.auth0.com/): Connect with the world of Auth0 via Auth0 posts, FAQs, and community Q&As. Architects and developers find this a valuable source of information for learning and connecting with others as well as getting help on issues. + +* [**Support Center**](https://support.auth0.com/): View and manage your subscription and tenants, file and view support requests, run automated production checks on a tenant, and view compliance information. Paid subscribers will find the support center a valuable resource if an issue or question cannot be solved by documentation or by searching the forum. + + * [**Create support cases**](/support/tickets): Create and file a support case if you need help. + + * [**Support Plans and Service Level Agreements**](/support#defect-responses): Learn about multiple levels of support available for purchase. + + * [**Troubleshooting tips**](/onboarding/enterprise-support#what-to-check-before-logging-an-issue) and [**Information to include in your support case**](/onboarding/enterprise-support#information-to-provide-when-logging-an-issue): Get advice to help your development and support teams analyze issues. + +* [**Supported versions**](/support/matrix): Understand which versions of SDKs, browsers, and languages are supported. Architects and developers should review this to ensure your project employs languages, libraries, and SDKs that will allow your implementation to work with Auth0. + +* [**Feedback Portal**](https://auth0.com/feedback): Make product suggestions. (You can also do this via the Support Center if you want better visibility into what you’ve filed over time.) Architects and developers can use this site to provide feedback on the Auth0 product for consideration as enhancements in the future. + +* [**Professional Services**](/services): Engage our world-wide professional services team to help speed your project to success. Project owners will find this useful for learning how Auth0 identity experts can help accelerate your project or fill in any temporary skill gaps. + +## Setup and monitor operations + +When you're ready to plan your launch, Auth0 provides the following resources: + +* [**Pre-launch advice**](/pre-deployment) and [**Production check**](/pre-deployment/how-to-run-test): Get tips and tools to help you plan your launch. Project managers and development and operations teams should explore these tips to leverage advice for a smooth launch. + +* [**Operational policies**](/policies): Familiarize yourself with Auth0's policies, so you know lead times for operational requests. Policies are useful for an entire team, but project owners and operations teams in particular should be aware of Auth0's operational policies. + +* [**Status Dashboard**](https://status.auth0.com): Quickly determine the availability of Auth0 services and subscribe to status updates. Although service interruptions are rare, when one occurs Auth0 conducts a root cause analysis and publishes the results on this site. Operations and support teams should be familiar with how to check Auth0 status. + +* [**Monitor endpoints**](/monitoring): Learn how to integrate our monitoring endpoints into your monitoring infrastructure. This information is of particular use to operations teams and project owners. + +* [**Log data**](/logs): Learn about the types of logs Auth0 provides, log data retention, and tools you can use to export log data to external analytical tools for analysis and long-term data storage. This information is useful for developers and operations teams, as well as compliance teams interested in data retention. + +* [**Dashboard notices**](/architecture-scenarios/implementation/b2c/b2c-operations#notifications): Stay informed about important announcements from Auth0. From time to time, Auth0 notifies you of important information via your Auth0 Dashboard and (depending on the severity of the information) via email to your registered Auth0 Dashboard Admins. You should regularly log in to the Dashboard and check the bell icon at the top for any important notices. + +## Satisfy privacy, security, and compliance needs + +View info on Auth0’s privacy policy, security policy, compliance certifications, and how Auth0 can help you with your compliance needs. This information is useful for project owners as well as security, privacy teams, and procurement teams. + +* [Privacy and Cookie Policy](https://auth0.com/privacy) +* [Security, Privacy and Compliance](https://auth0.com/security/) +* [Compliance Frameworks and Certifications](/compliance) diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-architecture.md b/articles/architecture-scenarios/implementation/b2b/b2b-architecture.md new file mode 100644 index 0000000000..b38753d752 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-architecture.md @@ -0,0 +1,56 @@ +--- +title: Architecture +description: How you configure your Auth0 tenant architecture affects your B2B IAM implementation. +toc: true +topics: + - b2b + - b2biam + - architecture +contentType: concept +useCase: + - tenant-architecture +--- +# Architecture + +<%= include('../../_includes/_architecture/_introduction.md', { platform: 'b2b' }) %> + +## Tenant provision + +<%= include('../../_includes/_architecture/_tenant-provision.md', { platform: 'b2b' }) %> + +### Tenant provision for complex organizations + +In most cases, provisioning separate Auth0 tenants for your customer's organizations is not necessary. However, in certain circumstances this can be something that is valuable for reducing the complexity of your setup. For instance, we recommend provisioning a separate Auth0 tenant for your customers' organization as a best practice if: + +* Your customers' organizations have isolated users that aren't shared with other organizations. +* You have some customer organizations that support more than one IdP. For example, your customer has their own IdP but also has some users that aren't in their IdP and whose credentials you will need to store. Or, your customer wants to provide for one or more social connections in addition to their enterprise IdP. + +If both of these situations are the case, then we recommend that you create separate Auth0 tenants for each customer that needs it. This allows you to have a separate custom domain for them and to easily customize their login experience, including [Home Realm Discovery](/architecture-scenarios/implementation/b2b/b2b-authentication#home-real-discovery) on their login page. + +::: warning +Maintaining multiple Auth0 tenants can add complexity to your system and should not be done unless absolutely necessary. +::: + +## Tenant association + +<%= include('../../_includes/_architecture/_tenant-association.md', { platform: 'b2b' }) %> + +## Custom domains + +<%= include('../../_includes/_architecture/_custom-domains.md', { platform: 'b2b' }) %> + +## SDLC support + +<%= include('../../_includes/_architecture/_sdlc-support.md', { platform: 'b2b' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'architecture' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-authentication.md b/articles/architecture-scenarios/implementation/b2b/b2b-authentication.md new file mode 100644 index 0000000000..4414be9c8f --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-authentication.md @@ -0,0 +1,127 @@ +--- +title: Authentication +description: How authentication works in your B2B IAM implementation. +toc: true +topics: + - b2b + - b2biam + - authentication + - universal-login +contentType: concept +useCase: + - authentication +--- +# Authentication + +<%= include('../../_includes/_authentication/_introduction.md', { platform: 'b2b' }) %> + +## Universal Login + +<%= include('../../_includes/_authentication/_universal-login.md', { platform: 'b2b' }) %> + +## Home realm discovery + +Home realm discovery (HRD) is the process of identifying which identity provider (or which connection in Auth0) the user belongs to *before* authenticating them. There are two ways HRD can occur: + +* Provide a way for the decision to be made at the application +* Have Home Realm Discovery happen on the Universal Login page + +Your system may need to do either or both methods so it is important to understand all approaches to HRD so that you can apply the one(s) that make the most sense to your applications. + +::: panel Best practice +If you don’t need to know ahead of time (for example, all of your users are in a shared user pool), then you don’t need to do HRD. You can allow users to authenticate first and then determine which organization they belong to using app metadata. HRD is really only needed if you have multiple connections within your Auth0 tenant. +::: + +### Application driven HRD + +A common and effective way for determining which realm a user belongs to is when an application is branded for each organization. The organization has its own instance of the application. This copy or instance can be physically isolated (running on a separate set of servers) or virtually isolated (running on shared servers, but presented as if it could be isolated), and is generally denoted through either a custom hostname (`companyA.application1.yourcompany.com`) or path (`application1.yourcompany.com/companyA`). + +::: warning +This method will only work if you are not sharing users between organizations. If you are sharing users within organizations, then you must support [Home Realm Discovery on the Universal Login Page](#hrd-through-universal-login) +::: + +::: panel Best practice +If your application already knows what connection (IdP) the user needs, then pass that along when you redirect the user to `/authorize` using the connection query parameter. +::: + +If this is the case for your application(s) then home realm discovery is a simple matter of storing the Auth0 connection name with the organization specific application configuration and sending that connection name as a parameter when redirecting the user for Universal Login. Sending the connection parameter can be achieved by adding it as a query parameter when you redirect them to the authorize endpoint. For more information see the [Authentication API docs](/api/authentication#authorization-code-flow); however, you will generally accomplish this using the SDK for whichever language your application is written in. + +::: panel Best practice +If an organization needs more than one IdP, then you will have to do a second round of Home Realm Discovery once identifying their organization. This can be achieved with Auth0 through creating a dedicated Auth0 tenant for that organization and creating an enterprise connection to that tenant. +::: + +### HRD through Universal Login + +There are three main approaches to Home Realm Discovery through Universal Login: + +* Discover the realm through the user’s email subdomain. +* Discover the realm by looking up a user identifier in some sort of map of identifier to realm map. +* Allow the user to choose or enter their realm (or organization). + +In both of the first two approaches, you may consider doing “Identifier First Login”. This means that you present only the ability to enter an identifier first. After which you collect the user’s identifier, and then based on the identifier you either automatically redirect the user or present a way for the user to enter their password if redirection is unnecessary. + +::: warning +Though it is possible to implement Identifier First Login or allow a user to select their organization at the application instead of on the Universal Login Page, this can add complexity with respect to single sign on as well as complexity associated with replicating that behavior in all of your applications. Instead Auth0 recommends implementing some form of HRD through Universal Login. +::: + +#### HRD through Universal Login using the email subdomain + +The simplest way to implement home realm discovery on the universal login page is to utilize the email subdomain of the user’s identifier to map that to their Identity Provider. This, of course, only works in situations where the email subdomain will be a 1:1 mapping to an organization or at least to an Identity Provider. Auth0’s Lock widget can do this for you if you are using the domain map in an enterprise connection, however if you want to build this yourself, you can, but it requires you to build a mapping of email subdomain to connection. + +#### HRD through Universal Login using the Identifier to Realm Map + +A second, more complex alternative is to store a map of identifier’s to IdP and provide a public endpoint to access that information. Then on the Universal Login page you can find the connection and redirect back to /authorize with the connection. The main drawbacks to this approach are latency, and more importantly security when it comes to identifier discovery: if you’re using email addresses, this makes it much easier for someone to discover whether a particular email address is a user of yours. + +::: panel Best practice +Any public endpoint should have rate limiting applied to it to prevent hackers from using it to discover information and to prevent denial of service attacks. +::: + +#### HRD through Universal Login using user choice + +The other simple option is to allow your users to choose from a list, if you don’t mind making public the list of organizations who use your product, or by allowing the user to enter their organization name explicitly. Once the user tells you which organization they belong to, you can redirect back to Auth0 with the connection for that organization specified, or simply prompt them for their username and password if the connection is a database connection. + +## Username and password authentication + +<%= include('../../_includes/_authentication/_username-and-password-authentication.md', { platform: 'b2b' }) %> + +## Application integration + +<%= include('../../_includes/_authentication/_application-integration.md', { platform: 'b2b' }) %> + +## Anomaly detection + +<%= include('../../_includes/_authentication/_attack-protection.md', { platform: 'b2b' }) %> + +## SSO with legacy systems + +<%= include('../../_includes/_authentication/_sso-legacy.md', { platform: 'b2b' }) %> + +## Enterprise Login + +The “bring your own identity” scenario has become a must-have for almost all B2B applications. Most enterprise companies expect to be able to integrate their IdP into your application so their employees don't need to store another set of credentials. This is a valuable way of simplifying the user authentication experience without compromising security, and using [Universal Login](#universal-login) makes it easy to start adding support for [Enterprise Connections](/connections/identity-providers-enterprise) with minimal disruption. + +::: panel Best Practice +Once you start supporting enterprise connections for users, you must do some form of [Home Realm Discovery](#home-realm-discovery) so that you can determine which connection to send the user to for authentication. +::: + +With enterprise connection support, user identities and credentials are managed by the identity provider of your customers' organization, as well as certain identity claims - which Auth0 will use to populate the user [profile](/architecture-scenarios/implementation/b2b/b2b-profile-mgmt). + +::: panel Best Practice +"Bring your own identity" is a great feature to provide, but if you don't support this from day one, and sometimes even if you do, you may have an organization that wants to switch to their own IdP after already having used the application for a while. You will need a way to [link user accounts](/users/concepts/overview-user-account-linking) to provide an effective way of associating the new identity with the old database identity. +::: + +## Multi-factor authentication (MFA) + +<%= include('../../_includes/_authentication/_mfa.md', { platform: 'b2b' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'authentication' }) %> diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-authorization.md b/articles/architecture-scenarios/implementation/b2b/b2b-authorization.md new file mode 100644 index 0000000000..5d0ca8d405 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-authorization.md @@ -0,0 +1,61 @@ +--- +title: Authorization +description: User authorization and related planning considerations for your B2B IAM implementation. +toc: true +topics: + - b2b + - b2biam + - user-authorization +contentType: concept +useCase: + - user-authorization +--- +# Authorization + +<%= include('../../_includes/_authorization/_introduction.md', { platform: 'b2b' }) %> + +## Application integration + +<%= include('../../_includes/_authorization/_application-integration.md', { platform: 'b2b' }) %> + +## API integration + +<%= include('../../_includes/_authorization/_api-integration.md', { platform: 'b2b' }) %> + +## Role Based Access Control (RBAC) + +<%= include('../../_includes/_authorization/_rbac.md', { platform: 'b2b' }) %> + +The core RBAC feature can be used in many multi-organization scenarios. See [Organization Data in an Access Tokens](#organization-data-in-an-access-token) for more information on how to ensure your setup can support your RBAC needs. + +## Machine-to-Machine (M2M) authorization + +<%= include('../../_includes/_authorization/_m2m.md', { platform: 'b2b' }) %> + +## Organization Data in an Access Token + +If you have a separate API from your application in your system that supports your multi-organization application, it is important to restrict operations to only the organization that the token was generated for. This requires that there is some sort of information in the access token to tell the API which organization the access token was issued for. This can be done in a couple of different ways depending on the answers to a couple of simple questions: + +1. Will the End Users in this organization potentially have more than one organization, or is each End User isolated to a specific organization? +2. Will you be allowing any Machine-to-Machine (M2M) access to your API? +3. If you are allowing Machine-to-Machine (M2M) access to your API, Will you have any developers who need a single client ID and secret to access multiple organizations (but not *all* organizations)? +4. Will you be allowing the creating of third-party apps that require consent? + +If End Users are isolated to a single organization **and** you will either not be allowing M2M access to your API or you will have a separate client ID/secret for each organization that needs access **and** you will *not* be allowing third-party apps that require consent, then the simplest approach is to just create a custom claim in the access token [using rules for the user based tokens](#access-token-claims) and [using the client credentials hook for M2M calls](#machine-to-machine-m2m-authorization). You can store organization name in client metadata and extract it from rules or hooks to include in access_token as a custom claim. RBAC will work out of the box for this approach as well as long as each End User can only belong to one organization. + +If End Users have more than one organization they can belong to or you might give a single developer a client ID and secret for M2M calls to more than one organization, then you will be best served by creating a separate audience (a separate API instance in your Auth0 tenant) for each organization. This gives you a few nice abilities: +1. First, it allows you to pass the audience as a first-class parameter to Auth0 without having to create a custom parameter. The benefit of this is that Auth0 will help enforce the existence of the audience, and it will pass it to your rules. It will also ensure that an issued refresh token will only work for the specific audience it was originally issued to. +2. It allows you to restrict client grants to only specific organizations out of the box. The alternative is to create a more complicated client credentials hook to attempt to retrieve the restrictions from somewhere else and also require a much more complex and potentially troublesome way to tell the client credentials call which organization to issue the access token for. +3. This also allows you to use the core RBAC feature with Auth0 and ensure that the End Users who have access to more than one organization can have a potentially different role for each organization. + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'authorization' }) %> diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-branding.md b/articles/architecture-scenarios/implementation/b2b/b2b-branding.md new file mode 100644 index 0000000000..b2da74226e --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-branding.md @@ -0,0 +1,65 @@ +--- +title: Branding +description: How to configure Auth0 items to reflect your brand and desired user experience. +toc: true +topics: + - b2b + - b2biam + - branding + - universal-login + - login-pages + - password-reset-pages + - custom-domains + - error-pages +contentType: concept +useCase: + - user-logout +--- +# Branding + +<%= include('../../_includes/_branding/_introduction.md', { platform: 'b2b' }) %> + +## Universal login and login pages + +<%= include('../../_includes/_branding/_universal-login.md', { platform: 'b2b' }) %> + +## Branding login by organization + +Whether or not you need to do special customization on the Universal Login page is determined by how you plan to manage your customers’ organization. Before reading through this section, make sure you have read through the [Universal Login section](#universal-login-and-login-pages) and know how you are approaching organizations by reviewing [Multiple Organization Architecture](https://drive.google.com/a/auth0.com/file/d/1y2G8RNHTBujcCrnMRhp6_phQiRAkZzfF/view?usp=sharing). + +If your organization users will all be isolated from each other, than it’s important to make it clear on the Universal Login page which organization the login page is for. This can be done in a couple of ways: + +* Create JavaScript on the Universal Login Page that can pull resources from a CDN based on the organization presented to it. +* Create a separate tenant for the organization and use the Universal Login page to customize as desired for that organization. + +## Custom domain naming + +<%= include('../../_includes/_branding/_custom-domain-naming.md', { platform: 'b2b' }) %> + +## Email template customization + +<%= include('../../_includes/_branding/_email-templates.md', { platform: 'b2b' }) %> + +## Password reset page customization + +<%= include('../../_includes/_branding/_password-reset.md', { platform: 'b2b' }) %> + +## Error page customization + +<%= include('../../_includes/_branding/_error-page.md', { platform: 'b2b' }) %> + +## Guardian multi-factor page customization + +<%= include('../../_includes/_branding/_guardian.md', { platform: 'b2b' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'branding' }) %> diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-deployment.md b/articles/architecture-scenarios/implementation/b2b/b2b-deployment.md new file mode 100644 index 0000000000..8f0c437182 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-deployment.md @@ -0,0 +1,28 @@ +--- +title: Deployment Automation +description: How Auth0 tooling helps to automate tenant deployment. +topics: + - b2b + - b2biam + - tenants + - deployment +contentType: concept +useCase: + - tenant-deployment +--- + +# Deployment Automation + +<%= include('../../_includes/_deployment/_introduction.md', { platform: 'b2b' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'deployment' }) %> diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-launch.md b/articles/architecture-scenarios/implementation/b2b/b2b-launch.md new file mode 100644 index 0000000000..358e53464e --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-launch.md @@ -0,0 +1,30 @@ +--- +classes: topic-page +title: Launch Preparation +description: Launch preparation considerations for your B2B IAM implementation. +topics: + - b2b + - ciam + - launch +contentType: concept +useCase: + - launch +--- +# Launch Preparation + +<%= include('../../_includes/_launch/_introduction.md', { platform: 'b2b' }) %> +<%= include('../../../_includes/_topic-links', { links: [ + 'architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-tenantcheck', + 'architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-testing', + 'architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-operations', + 'architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-compliance', + 'architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-support', + 'architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-launch' + ] }) %> + +## Project Planning Guide +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'launch' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-compliance.md b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-compliance.md new file mode 100644 index 0000000000..01a2a4ce91 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-compliance.md @@ -0,0 +1,24 @@ +--- +title: Compliance Readiness +description: Compliance checks to perform before launch of your B2B IAM implementation. +topics: + - b2b + - ciam + - launch + - compliance +contentType: concept +useCase: + - launch +--- + +# Compliance + +<%= include('../../../_includes/_launch/_compliance.md', { platform: 'b2b' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2b', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-launch.md b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-launch.md new file mode 100644 index 0000000000..835be1391e --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-launch.md @@ -0,0 +1,23 @@ +--- +title: Launch Day Preparation +description: Launch preparation considerations for your B2B IAM implementation. +topics: + - b2b + - ciam + - launch +contentType: concept +useCase: + - launch +--- + +# Launch Day Readiness + +<%= include('../../../_includes/_launch/_launch.md', { platform: 'b2b' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2b', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-operations.md b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-operations.md new file mode 100644 index 0000000000..e4742e5f13 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-operations.md @@ -0,0 +1,24 @@ +--- +title: Operations Readiness +description: Operations checks to perform before launch of your B2B IAM implementation. +topics: + - b2b + - ciam + - launch + - operations +contentType: concept +useCase: + - launch +--- + +# Operational Readiness + +<%= include('../../../_includes/_launch/_operations.md', { platform: 'b2b' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2b', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-support.md b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-support.md new file mode 100644 index 0000000000..818c04db04 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-support.md @@ -0,0 +1,23 @@ +--- +title: Support Readiness +description: Support readiness for the launch of your B2B IAM implementation. +topics: + - b2b + - ciam + - launch + - support +contentType: concept +useCase: + - launch +--- + +# Support Readiness + +<%= include('../../../_includes/_launch/_support.md', { platform: 'b2b' }) %> + +# Project Planning Guide +<%= include('../../../_includes/_planning.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2b', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-tenantcheck.md b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-tenantcheck.md new file mode 100644 index 0000000000..bbe597465c --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-tenantcheck.md @@ -0,0 +1,24 @@ +--- +title: Tenant Check +description: Tenant Checks to perform before launch of your B2B IAM implementation. +topics: + - b2b + - ciam + - launch + - configuration +contentType: concept +useCase: + - launch +--- + +# Tenant configuration check + +<%= include('../../../_includes/_launch/_tenant-check.md', { platform: 'b2b' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2b', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-testing.md b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-testing.md new file mode 100644 index 0000000000..e3c2314ffe --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-launch/b2b-launch-testing.md @@ -0,0 +1,24 @@ +--- +title: Testing Complete +description: Testing preparation for the launch of your B2B IAM implementation. +topics: + - b2b + - ciam + - launch + - testing +contentType: concept +useCase: + - launch +--- + +# Testing + +<%= include('../../../_includes/_launch/_testing.md', { platform: 'b2b' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2b' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2b', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-logout.md b/articles/architecture-scenarios/implementation/b2b/b2b-logout.md new file mode 100644 index 0000000000..f818eb1ceb --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-logout.md @@ -0,0 +1,58 @@ +--- +title: Logout +description: User logout planning considerations for your B2B IAM implementation. +topics: + - b2b + - b2biam + - logout + - sessions +contentType: concept +useCase: + - user-logout +--- +# Logout + +<%= include('../../_includes/_logout/_introduction.md', { platform: 'b2b' }) %> + +## Single Logout + +If you are doing [Federated Logout](#federated-logout) you will likely also want to do Single Logout (SLO), and there are two main approaches you can take. + +::: warning +SLO can add complexity to your system, so you need to ensure that you really need it before adding the extra development and maintenance time to your system. +::: + +### Short-lived tokens + +::: panel Best Practice +You want to avoid making too many calls to your Auth0 tenant to avoid rate limiting and poor performance. A best practice is to only request new tokens if tokens have expired and a user takes an action. This will avoid applications that are simply open, but not in use, from continually polling for new tokens. +::: + +This is by far the simplest approach to Single Logout. Each application enforces a short time within which a user can use the system, say, 5-10 minutes. On each action a user performs, if the time has expired then either a redirect to Auth0 (for regular web apps), or [Silent Authentication](https://auth0.com/docs/api-auth/tutorials/silent-authentication) for client side Single Page Applications will be used to obtain new tokens. Ordinarily new tokens will be issued silently due to the Single Sign On (SSO) session. However, after logout, all applications will fail to get new tokens silently because the SSO session will have been removed, and the user will need to re-enter their credentials. + +::: warning +If you are automatically forwarding the user directly to their own IdP as part of an enterprise connection using the connection parameter, this can break this technique unless you are also doing [Federated Logout](#federated-logout) +::: + +### Build a logout service + +Another technique you can use is to build a logout service that can track and destroy application sessions. Each application would notify the logout service when it creates and removes a session. The (logout) service would either have direct access to all application's server side sessions and destroy them directly, or it will have the ability to make a back-channel call to each application to tell the application that it must remove its session. + +This technique can be quite effective as there is low-latency between when a user calls logout, and when they are then logged out of all applications. However it can add complexity and also additional development time for implementation. It will also require some way to ensure that new applications added to the system are added to this service. + +## Federated Logout + +[Federated User Logout](/logout/guides/logout-idps) may be something that you need to consider for your application. If you or your customers will be using a third-party IdP (i.e., something other than a [Database Identity Provider](/connections/database)) then the question of whether you need to log the user out of the IdP when they log out of your application is something you will need to answer. The answer depends on what your users would expect. If the application and/or IdP you use is tied closely to a customer organization and a central part of day-to-day operations, then it may be frustrating for users to get logged out of their IdP when they log out of your application. If not, then being logged out of the IdP may be expected, or in some cases even desired. In most B2B scenarios, our customers find that it is preferable *not* to perform federated logout for a user. + + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'logout' }) %> diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-operations.md b/articles/architecture-scenarios/implementation/b2b/b2b-operations.md new file mode 100644 index 0000000000..7efd77e295 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-operations.md @@ -0,0 +1,62 @@ +--- +title: Operations +description: How to operationalize your Auth0 tenant environments. +toc: true +topics: + - b2b + - b2biam + - tenants + - operations +contentType: concept +useCase: + - tenant-operations +--- + +# Operations + +<%= include('../../_includes/_operations/_introduction.md', { platform: 'b2b' }) %> + +## Service status + +<%= include('../../_includes/_operations/_service-status.md', { platform: 'b2b' }) %> + +## Email provider setup + +<%= include('../../_includes/_operations/_email-provider.md', { platform: 'b2b' }) %> + +## Infrastructure + +<%= include('../../_includes/_operations/_infrastructure.md', { platform: 'b2b' }) %> + +## Logging + +<%= include('../../_includes/_operations/_logging.md', { platform: 'b2b' }) %> + +## Monitoring + +<%= include('../../_includes/_operations/_monitoring.md', { platform: 'b2b' }) %> + +## Notifications + +<%= include('../../_includes/_operations/_notifications.md', { platform: 'b2b' }) %> + +## Provisioning organizations + +<%= include('../../_includes/_provisioning/_organizations.md', { platform: 'b2b' }) %> + +## Self-Service IdP provisioning + +While Auth0 [connections](/identityproviders) make it easy to configure IdPs, it can be a time-consuming process to onboard customer organization IdPs especially if you are selling to new customer organizations on a regular basis or existing organizations have changing IdP requirements. As a result, many of our customers have found it worthwhile to build a self-service portal for their customers' organization admins so that they can configure their own IdPs. This cuts down on your IT department's workload. The [Auth0 Management API](/api/management/v2) provides all necessary [connection](/api/management/v2#!/Connections/get_connections) management functionality to achieve this. + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'operations' }) %> + diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-profile-mgmt.md b/articles/architecture-scenarios/implementation/b2b/b2b-profile-mgmt.md new file mode 100644 index 0000000000..bdc3ed3749 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-profile-mgmt.md @@ -0,0 +1,57 @@ +--- +title: Profile Management +description: User profile management planning considerations for your B2B IAM implementation. +toc: true +topics: + - b2b + - b2biam + - user-profiles +contentType: concept +useCase: + - profile-management + - manage-user-profiles +--- +# Profile Management + +<%= include('../../_includes/_profile-mgmt/_introduction.md', { platform: 'b2b' }) %> + +## Metadata + +<%= include('../../_includes/_profile-mgmt/_metadata.md', { platform: 'b2b' }) %> + +## Password reset + +<%= include('../../_includes/_profile-mgmt/_password-reset.md', { platform: 'b2b' }) %> + +## Account verification + +<%= include('../../_includes/_profile-mgmt/_account-verification.md', { platform: 'b2b' }) %> + +## Blocking users + +<%= include('../../_includes/_profile-mgmt/_blocking-users.md', { platform: 'b2b' }) %> + +## Admin portal + +An admin portal is an application where you can create new users, edit a user’s profile, see activity about a user, etc. This application should be accessible by administrators only. Though Auth0 provides its management dashboard, it is not advised to give access to the management dashboard to many people as there are a lot of ways someone can unintentionally break your Auth0 tenant. Instead, Auth0 provides two other options: + +* [**Auth0 Management API**](/api/management/v2): With the Management API you can easily construct an application that provides administrators the ability to manage users. You can either incorporate this into an existing application that already exists for your administrators, or create a new one with a UI that matches your current applications. + +* [**Auth0 Delegated Administration Extension**](/extensions/delegated-admin/v3): This powerful and flexible extension allows you to customize a user administration experience. You can tailor this extension so that you can allow your customer admins to log in and allow them to only see and manage users within their organization. + +::: panel Best practice +If you are providing your own way for an administrator to manage users, you should only allow administrators to send users a change password link through email rather than allowing administrators to set passwords directly. If you must go against this recommendation and allow your administrators to set someone’s password, you should force the user to change their password at their next login so that only they know the password (and not an administrator as well). +::: + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'profile-mgmt' }) %> + diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-provisioning.md b/articles/architecture-scenarios/implementation/b2b/b2b-provisioning.md new file mode 100644 index 0000000000..8f2fe1e387 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-provisioning.md @@ -0,0 +1,117 @@ +--- +title: Provisioning +description: User provisioning functionality and considerations for your B2B IAM implementation. +toc: true +topics: + - b2b + - b2biam + - user-migration + - custom-db + - universal-login + - user-profiles +contentType: concept +useCase: + - user-provisioning + - store-user-data +--- +# Provisioning + +<%= include('../../_includes/_provisioning/_introduction.md', { platform: 'b2b' }) %> + +## Provisioning organizations + +<%= include('../../_includes/_provisioning/_organizations.md', { platform: 'b2b' }) %> + +## User migration + +<%= include('../../_includes/_provisioning/_user-migration.md', { platform: 'b2b' }) %> + +## Provisioning organization users + +An organization should map directly to one of your business customers/partners. Each business/partner that you are working with has users who will be logging in. We call those end users *organization users*. +There are two different approaches to how to store your organization users: + +* **Isolated to the organization**: Every user *belongs* to exactly one organization. It would not make sense for that user to be a part of more than one organization, and even if they were, it would make sense for them to have a separate “identity” for that other organization. For example, a retail employee that works part time at two different stores has two different logins for each of those stores even if the stores both use the SaaS application. To learn more, see [Provisioning users isolated to the organization](#provisioning-users-isolated-to-the-organization). +* **Shared between organizations**: In a case like this, users either create credentials in your company, or they can access other organizations instances of your application using credentials from their own organization. A simple way to look at this is that one user may be authorized to access more than one organization’s instance of the application. A user would understand that they can use the same credentials to access both instances of an application. For example, some doctors contract with multiple clinics and may need to be able to sign into each separate clinic with their same credentials. To learn more, see [Provisioning users shared between organizations](#provisioning-users-shared-between-organizations). + +### Provisioning users isolated to the organization + +Isolating users to the organization can provide a nice clean barrier between organizations. If no users ever need to access more than one organization (or you would rather force them to create multiple accounts), then this is an attractive approach. + +You need to provision those users at the IdP level. Each of the organizations will have its own IdP for accomplishing this. This IdP will come in one of three flavors: + +* **Your Auth0 Tenant is the IdP**: A Database Connection in your main tenant dedicated to this organization. +* **Organizations bring their own IdP**: You set up an Enterprise Connection for them. +* **Organizations with more than one IdP**: This situation is a little more tricky becasue you have multiple options for approaching this situation. In descending order of complexity, these include: + * You convince them to create (or find that they already have) one main IdP that can route to their individual IdPs. + * You create separate organizations (e.g. customerorg-department1 and customerorg-department2) in your applications. + * You set up a new Auth0 tenant just for them and add as many IdPs as they need (which may include a database in Auth0) to that tenant, along with their own custom domain and branding. + * You make your existing tenant and login page more complex to handle [Home Realm Discovery](/architecture-scenarios/implementation/b2b/b2b-authentication#home-real-discovery) just for organizations that have more than one IdP. + +We recommend using Auth0 as an IdP as a starting point because it’s simple to implement a user invite workflow: an administrator creates a user; a randomly-generated password is created for that user, but never stored or shown to anyone; and then the user receives a welcome email with a link to set their password. Compared to other invite flows, the only thing special about this is that the person who is creating the user will have to either select the organization ahead of time, or the system will force the organization to match that of the user doing the inviting (in situations where there is an organization administrator who belongs to that organization only). To learn more, see [User invite](#user-invite). + +::: panel Best Practice +If you can keep a main Auth0 tenant with a one-to-one mapping between organization and connection, it will greatly simplify your login system, making it more maintainable and extendable for the future. See [Multiple Organization Architecture documents: isolated users by organization](https://drive.google.com/a/auth0.com/file/d/1fzWWu7CUWaPpmaSO01gEhVYmkSXvV28l/view?usp=sharing) for a more in-depth view. +::: + +### Provisioning users shared between organizations + +When sharing users between organizations, you will need a way to authorize access. Because you won’t know where a user might belong when authenticating, we typically recommend storing your users in a single domain and then figuring out which organizations they can access by using user app metadata. Because of this, provisioning will often be done by starting with a User Invite workflow for the single database connection, and then app metadata will be used to authorize access. User app metadata allows information to be stored in a user’s profile that can impact a user's capabilities but which a user cannot change. Let’s say I’m a doctor and I belong to Clinic A and Clinic B. I might have an organizations object in my app metadata that looks like: `{ “organizations”: [“clinicA”,”clinicB”] }`, and then when attempting to log into the app for Clinic B, a rule can check that Clinic B is in the `organizations` array. + +::: panel Best Practice +Because users are shared, you won’t be able to determine who has access by isolating them to their own connection, therefore you will need to use their app metadata to make the determination. When provisioning, you will need a way to set the organizations they have access to or add a new organization to an already existing user. +::: + +### Deprovisioning limitations + +<%= include('../../_includes/_provisioning/_deprovisioning.md', { platform: 'b2b' }) %> + +## User invite + +In most B2B scenarios, only particular individuals are allowed access to the application. As a result, it is often simpler to have an administrator provision user accounts rather than having users sign up and then have an administrator approve them. Provisioning can often be done in an automated fashion when users are added to a centralized system as well. + +There are three different personas who might be [inviting users](/design/creating-invite-only-applications): + +* An administrator at your company may create the users for each organization. +* An administrator from each organization may be assigned to creating users. +* Another system responsible for creating users mahy exist, and that system may then create a user in Auth0. +Regardless of the audience, the technique can be similar, with the exception of the third option which would require the use of the management API and could not be done using the Delegated Administration Extension. The rest is a matter of using the right authorization model for the application. + +User invite can be accomplished in a few ways: + +* Using the [Delegated Administration Extension](/extensions/delegated-admin/v3) +* Updating a pre-existing user administration system that you’ve already created to use the [Management API](/api/management/v2) +* Creating a new application to do this using the Management API. + +::: panel Best Practice +Whether you are using the Management API or the Delegated Administration Extension, it is important to create each user with a random temporary password and *not* store that password anywhere! Then, use the Management API to send an email to the user with a link to set their password. This ensures that the only person who knows the password is the user themselves. +::: + +::: warning +One of the main principles of OIDC is that no one except the user themselves ever knows their password. If you are doing an invite flow, have your backend system randomly generate a password and then discard it and have your user reset their password before ever logging in. Do not create a temporary password and give it to them to log in the first time. +::: + +## Enterprise sign up + +Enterprise sign up is synonymous with sign in via [enterprise login](/architecture-scenarios/implementation/b2b/b2b-authentication#enterprise-login)—there’s no distinction here *per se*, as user [profile](/architecture-scenarios/implementation/b2b/b2b-profile-mgmt) creation happens automatically upon first enterprise login. + +::: panel best practice +A nice advantage of allowing your customers to use their own IdP is that they can administer their users and assign roles and access in their own IdP setup instead of forcing you to build administration for them. Working out the mapping for those customers will make this much easier. +::: + +::: warning + If mapping isn't enough and you must put some metadata in your system, keep in mind that Auth0 will not create the user until they log in to the system the first time. Therefore, you will need to use rule extensibility to pull the initial information from somewhere else, or force users to log in the first time before you can add the metadata. +::: + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'provisioning' }) %> + diff --git a/articles/architecture-scenarios/implementation/b2b/b2b-qa.md b/articles/architecture-scenarios/implementation/b2b/b2b-qa.md new file mode 100644 index 0000000000..2aa5556410 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2b/b2b-qa.md @@ -0,0 +1,41 @@ +--- +title: Quality Assurance +description: Quality Assurance considerations for your B2B IAM implementation. +toc: true +topics: + - qa + - b2b + - b2biam + - quality +contentType: concept +useCase: + - quality-assurance +--- +# Quality Assurance + +<%= include('../../_includes/_qa/_introduction.md', { platform: 'b2b' }) %> + +## Unit testing + +<%= include('../../_includes/_qa/_unit-testing.md', { platform: 'b2b' }) %> + +## Integration testing + +<%= include('../../_includes/_qa/_integration-testing.md', { platform: 'b2b' }) %> + +## Mock testing + +<%= include('../../_includes/_qa/_mock-testing.md', { platform: 'b2b' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2b' }) %> + +## Multiple Organization Architecture (Multitenancy) + +<%= include('../../_includes/_multitenancy.md', { platform: 'b2b' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2b', self: 'qa' }) %> + diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-architecture.md b/articles/architecture-scenarios/implementation/b2c/b2c-architecture.md new file mode 100644 index 0000000000..9d01f715a0 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-architecture.md @@ -0,0 +1,40 @@ +--- +title: Architecture +description: How you configure your Auth0 tenant architecture affects your B2C IAM implementation. +toc: true +topics: + - b2c + - ciam + - tenants +contentType: concept +useCase: + - tenant-architecture +--- + +# Architecture + +<%= include('../../_includes/_architecture/_introduction.md', { platform: 'b2c' }) %> + +## Tenant provision + +<%= include('../../_includes/_architecture/_tenant-provision.md', { platform: 'b2c' }) %> + +## Tenant association + +<%= include('../../_includes/_architecture/_tenant-association.md', { platform: 'b2c' }) %> + +## Custom domains + +<%= include('../../_includes/_architecture/_custom-domains.md', { platform: 'b2c' }) %> + +## SDLC support + +<%= include('../../_includes/_architecture/_sdlc-support.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'architecture' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-authentication.md b/articles/architecture-scenarios/implementation/b2c/b2c-authentication.md new file mode 100644 index 0000000000..daffa7e833 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-authentication.md @@ -0,0 +1,52 @@ +--- +title: Authentication +description: How authentication works in your B2C IAM implementation. +toc: true +topics: + - b2c + - ciam + - authentication + - universal-login +contentType: concept +useCase: + - authentication +--- +# Authentication + +<%= include('../../_includes/_authentication/_introduction.md', { platform: 'b2c' }) %> + +## Universal Login + +<%= include('../../_includes/_authentication/_universal-login.md', { platform: 'b2c' }) %> + +## Username and password authentication + +<%= include('../../_includes/_authentication/_username-and-password-authentication.md', { platform: 'b2c' }) %> + +## Application integration + +<%= include('../../_includes/_authentication/_application-integration.md', { platform: 'b2c' }) %> + +## Anomaly detection + +<%= include('../../_includes/_authentication/_attack-protection.md', { platform: 'b2c' }) %> + +## SSO with legacy systems + +<%= include('../../_includes/_authentication/_sso-legacy.md', { platform: 'b2c' }) %> + +## Social authentication + +<%= include('../../_includes/_authentication/_social-authentication.md', { platform: 'b2c' }) %> + +## Multi-factor authentication (MFA) + +<%= include('../../_includes/_authentication/_mfa.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'authentication' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-authorization.md b/articles/architecture-scenarios/implementation/b2c/b2c-authorization.md new file mode 100644 index 0000000000..4394f0b496 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-authorization.md @@ -0,0 +1,39 @@ +--- +title: Authorization +description: User authorization and related planning considerations for your B2C IAM implementation. +toc: true +topics: + - b2c + - ciam + - user-authorization +contentType: concept +useCase: + - user-authorization +--- +# Authorization + +<%= include('../../_includes/_authorization/_introduction.md', { platform: 'b2c' }) %> + +## Application integration + +<%= include('../../_includes/_authorization/_application-integration.md', { platform: 'b2c' }) %> + +## API integration + +<%= include('../../_includes/_authorization/_api-integration.md', { platform: 'b2c' }) %> + +## Role Based Access Control (RBAC) + +<%= include('../../_includes/_authorization/_rbac.md', { platform: 'b2c' }) %> + +## Machine-to-Machine (M2M) Authorization + +<%= include('../../_includes/_authorization/_m2m.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'authorization' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-branding.md b/articles/architecture-scenarios/implementation/b2c/b2c-branding.md new file mode 100644 index 0000000000..cba76c1648 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-branding.md @@ -0,0 +1,52 @@ +--- +title: Branding +description: How to configure Auth0 items to reflect your brand and desired user experience. +toc: true +topics: + - b2c + - ciam + - branding + - universal-login + - login-pages + - password-reset-pages + - custom-domains + - error-pages +contentType: concept +useCase: + - user-logout +--- +# Branding + +<%= include('../../_includes/_branding/_introduction.md', { platform: 'b2c' }) %> + +## Universal login and login pages + +<%= include('../../_includes/_branding/_universal-login.md', { platform: 'b2c' }) %> + +## Custom domain naming + +<%= include('../../_includes/_branding/_custom-domain-naming.md', { platform: 'b2c' }) %> + +## Email template customization + +<%= include('../../_includes/_branding/_email-templates.md', { platform: 'b2c' }) %> + +## Password reset page customization + +<%= include('../../_includes/_branding/_password-reset.md', { platform: 'b2c' }) %> + +## Error page customization + +<%= include('../../_includes/_branding/_error-page.md', { platform: 'b2c' }) %> + +## Guardian multi-factor page customization + +<%= include('../../_includes/_branding/_guardian.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'branding' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-deployment.md b/articles/architecture-scenarios/implementation/b2c/b2c-deployment.md new file mode 100644 index 0000000000..896280664b --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-deployment.md @@ -0,0 +1,24 @@ +--- +title: Deployment Automation +description: How Auth0 tooling helps to automate tenant deployment. +topics: + - b2c + - ciam + - tenants + - deployment +contentType: concept +useCase: + - tenant-deployment +--- + +# Deployment Automation + +<%= include('../../_includes/_deployment/_introduction.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'deployment' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-launch.md b/articles/architecture-scenarios/implementation/b2c/b2c-launch.md new file mode 100644 index 0000000000..8eed687f5e --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-launch.md @@ -0,0 +1,30 @@ +--- +classes: topic-page +title: Launch Preparation +description: Launch preparation considerations for your B2C IAM implementation. +topics: + - b2c + - ciam + - launch +contentType: concept +useCase: + - launch +--- +# Launch Preparation + +<%= include('../../_includes/_launch/_introduction.md', { platform: 'b2c' }) %> +<%= include('../../../_includes/_topic-links', { links: [ + 'architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-tenantcheck', + 'architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-testing', + 'architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-operations', + 'architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-compliance', + 'architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-support', + 'architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-launch' + ] }) %> + +## Project Planning Guide +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'launch' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-compliance.md b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-compliance.md new file mode 100644 index 0000000000..1712d77cc6 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-compliance.md @@ -0,0 +1,24 @@ +--- +title: Compliance Readiness +description: Compliance checks to perform before launch of your B2C IAM implementation. +topics: + - b2c + - ciam + - launch + - compliance +contentType: concept +useCase: + - launch +--- + +# Compliance + +<%= include('../../../_includes/_launch/_compliance.md', { platform: 'b2c' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2c' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2c', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-launch.md b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-launch.md new file mode 100644 index 0000000000..3459fb54f8 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-launch.md @@ -0,0 +1,23 @@ +--- +title: Launch Day Preparation +description: Launch preparation considerations for your B2C IAM implementation. +topics: + - b2c + - ciam + - launch +contentType: concept +useCase: + - launch +--- + +# Launch Day Readiness + +<%= include('../../../_includes/_launch/_launch.md', { platform: 'b2c' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2c' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2c', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-operations.md b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-operations.md new file mode 100644 index 0000000000..eb2a8942e8 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-operations.md @@ -0,0 +1,24 @@ +--- +title: Operations Readiness +description: Operations checks to perform before launch of your B2C IAM implementation. +topics: + - b2c + - ciam + - launch + - operations +contentType: concept +useCase: + - launch +--- + +# Operational Readiness + +<%= include('../../../_includes/_launch/_operations.md', { platform: 'b2c' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2c' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2c', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-support.md b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-support.md new file mode 100644 index 0000000000..188827213e --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-support.md @@ -0,0 +1,23 @@ +--- +title: Support Readiness +description: Support readiness for the launch of your B2C IAM implementation. +topics: + - b2c + - ciam + - launch + - support +contentType: concept +useCase: + - launch +--- + +# Support Readiness + +<%= include('../../../_includes/_launch/_support.md', { platform: 'b2c' }) %> + +# Project Planning Guide +<%= include('../../../_includes/_planning.md', { platform: 'b2c' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2c', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-tenantcheck.md b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-tenantcheck.md new file mode 100644 index 0000000000..dc54e51cb3 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-tenantcheck.md @@ -0,0 +1,24 @@ +--- +title: Tenant Check +description: Tenant Checks to perform before launch of your B2C IAM implementation. +topics: + - b2c + - ciam + - launch + - configuration +contentType: concept +useCase: + - launch +--- + +# Tenant configuration check + +<%= include('../../../_includes/_launch/_tenant-check.md', { platform: 'b2c' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2c' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2c', self: '*ignore*' }) %> \ No newline at end of file diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-testing.md b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-testing.md new file mode 100644 index 0000000000..6e313784cb --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-launch/b2c-launch-testing.md @@ -0,0 +1,24 @@ +--- +title: Testing Complete +description: Testing preparation for the launch of your B2C IAM implementation. +topics: + - b2c + - ciam + - launch + - testing +contentType: concept +useCase: + - launch +--- + +# Testing + +<%= include('../../../_includes/_launch/_testing.md', { platform: 'b2c' }) %> + +# Project Planning Guide + +<%= include('../../../_includes/_planning.md', { platform: 'b2c' }) %> + +# Keep reading + +<%= include('../../../_includes/_keep-reading.md', { platform: 'b2c', self: '*ignore*' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-logout.md b/articles/architecture-scenarios/implementation/b2c/b2c-logout.md new file mode 100644 index 0000000000..79659c64c7 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-logout.md @@ -0,0 +1,23 @@ +--- +title: Logout +description: User logout planning considerations for your B2C IAM implementation. +topics: + - b2c + - ciam + - logout + - sessions +contentType: concept +useCase: + - user-logout +--- +# Logout + +<%= include('../../_includes/_logout/_introduction.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'logout' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-operations.md b/articles/architecture-scenarios/implementation/b2c/b2c-operations.md new file mode 100644 index 0000000000..b10ab32dcc --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-operations.md @@ -0,0 +1,49 @@ +--- +title: Operations +description: How to operationalize your Auth0 tenant environments. +toc: true +topics: + - b2c + - ciam + - tenants + - operations +contentType: concept +useCase: + - tenant-operations +--- + +# Operations + +<%= include('../../_includes/_operations/_introduction.md', { platform: 'b2c' }) %> + +## Service status + +<%= include('../../_includes/_operations/_service-status.md', { platform: 'b2c' }) %> + +## Email provider setup + +<%= include('../../_includes/_operations/_email-provider.md', { platform: 'b2c' }) %> + +## Infrastructure + +<%= include('../../_includes/_operations/_infrastructure.md', { platform: 'b2c' }) %> + +## Logging + +<%= include('../../_includes/_operations/_logging.md', { platform: 'b2c' }) %> + +## Monitoring + +<%= include('../../_includes/_operations/_monitoring.md', { platform: 'b2c' }) %> + +## Notifications + +<%= include('../../_includes/_operations/_notifications.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'operations' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-profile-mgmt.md b/articles/architecture-scenarios/implementation/b2c/b2c-profile-mgmt.md new file mode 100644 index 0000000000..5065318caf --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-profile-mgmt.md @@ -0,0 +1,48 @@ +--- +title: Profile Management +description: User profile management planning considerations for your B2C IAM implementation. +toc: true +topics: + - b2c + - ciam + - user-profiles +contentType: concept +useCase: + - profile-management + - manage-user-profiles +--- +# Profile Management + +<%= include('../../_includes/_profile-mgmt/_introduction.md', { platform: 'b2c' }) %> + +## Metadata + +<%= include('../../_includes/_profile-mgmt/_metadata.md', { platform: 'b2c' }) %> + +## Password reset + +<%= include('../../_includes/_profile-mgmt/_password-reset.md', { platform: 'b2c' }) %> + +## Account verification + +<%= include('../../_includes/_profile-mgmt/_account-verification.md', { platform: 'b2c' }) %> + +## Blocking users + +<%= include('../../_includes/_profile-mgmt/_blocking-users.md', { platform: 'b2c' }) %> + +## Linking user accounts + +<%= include('../../_includes/_profile-mgmt/_linking-accounts.md', { platform: 'b2c' }) %> + +## De-provisioning + +<%= include('../../_includes/_profile-mgmt/_de-provisioning.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'profile-mgmt' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-provisioning.md b/articles/architecture-scenarios/implementation/b2c/b2c-provisioning.md new file mode 100644 index 0000000000..df2c065de1 --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-provisioning.md @@ -0,0 +1,39 @@ +--- +title: Provisioning +description: User provisioning functionality and considerations for your B2C IAM implementation. +toc: true +topics: + - b2c + - ciam + - user-migration + - custom-db + - universal-login + - user-profiles +contentType: concept +useCase: + - user-provisioning + - store-user-data +--- +# Provisioning + +<%= include('../../_includes/_provisioning/_introduction.md', { platform: 'b2c' }) %> + +## User migration + +<%= include('../../_includes/_provisioning/_user-migration.md', { platform: 'b2c' }) %> + +## Self sign up + +<%= include('../../_includes/_provisioning/_self-signup.md', { platform: 'b2c' }) %> + +## Social sign up + +<%= include('../../_includes/_provisioning/_social-signup.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'provisioning' }) %> diff --git a/articles/architecture-scenarios/implementation/b2c/b2c-qa.md b/articles/architecture-scenarios/implementation/b2c/b2c-qa.md new file mode 100644 index 0000000000..e27135e1cf --- /dev/null +++ b/articles/architecture-scenarios/implementation/b2c/b2c-qa.md @@ -0,0 +1,36 @@ +--- +title: Quality Assurance +description: Quality Assurance considerations for your B2C IAM implementation. +toc: true +topics: + - qa + - b2c + - ciam + - quality +contentType: concept +useCase: + - quality-assurance +--- +# Quality Assurance + +<%= include('../../_includes/_qa/_introduction.md', { platform: 'b2c' }) %> + +## Unit testing + +<%= include('../../_includes/_qa/_unit-testing.md', { platform: 'b2c' }) %> + +## Integration testing + +<%= include('../../_includes/_qa/_integration-testing.md', { platform: 'b2c' }) %> + +## Mock testing + +<%= include('../../_includes/_qa/_mock-testing.md', { platform: 'b2c' }) %> + +## Project Planning Guide + +<%= include('../../_includes/_planning.md', { platform: 'b2c' }) %> + +## Keep reading + +<%= include('../../_includes/_keep-reading.md', { platform: 'b2c', self: 'qa' }) %> diff --git a/articles/architecture-scenarios/index.md b/articles/architecture-scenarios/index.md index 10a51fa691..5f1cf6d905 100644 --- a/articles/architecture-scenarios/index.md +++ b/articles/architecture-scenarios/index.md @@ -1,38 +1,53 @@ --- -title: Architecture Scenarios +url: /architecture-scenarios classes: topic-page +title: Architecture Scenarios description: Learn about the common architecture scenarios that you will use to solve the authorization and authentication needs of your application. topics: - architecture - api-auth - authorization-code -contentType: - - index - - concept + - b2c + - b2b + - ciam +contentType: index useCase: - invoke-api - secure-an-api - build-an-app + - implementation --- -# Architecture Scenarios - -This page describes the typical architecture scenarios we have identified when working with customers on implementing Auth0. - -## Application Configurations + +
      +
      +

      Architecture Scenarios

      +

      + This page describes the typical architecture scenarios we have identified when working with customers on implementing Auth0. +

      +
      -These scenarios describe the different type of technology architectures your application may use, and how Auth0 can help for each of those. Each scenario comes with: +## Application configurations -* A sample business case -* The goals and requirements that the implementation must meet -* Detailed explanations of the architectural solutions -* A sample implementation +These scenarios describe the different type of technology architectures your application may use, and how Auth0 can help for each of those. The goal of these scenarios is to walk you through the implementation process from beginning to end. -## Under Construction +## Implementation checklists -These scenarios are under construction and will soon be updated. Some describe the different type of technology architectures your application may use, while others describe the architecture depending on the type of businesses (B2C, B2B, B2E), and how Auth0 can help in each of these scenarios. +<%= include('./_includes/_implementation-checklists.md') %> - +## Implementation resources + +Auth0 provides many [resources](/architecture-scenarios/implementation-resources) to help you learn about Auth0, get started quickly, test sample code, and try out APIs. + +The Auth0 [Community](https://community.auth0.com) forum and [Blog](https://auth0.com/blog) connect you with the world of Auth0, while our [Support Center](https://support.auth0.com) helps you report issues and manage your subscription. Additionally, you can submit suggested product enhancements through our feedback portal. + +We've also made it easy to use our [Status Dashboard](https://status.auth0.com), monitor endpoints, and log data. Notifications keep you up-to-date with Auth0 announcements, and we provide a variety of methods to stay informed about privacy, security, and compliance. + +In addition, our [Professional Services](/services) team is available to help you with any architecture needs, including pre-launch advice, production checklists, and operational policies. diff --git a/articles/architecture-scenarios/mobile-api/api-implementation-nodejs.md b/articles/architecture-scenarios/mobile-api/api-implementation-nodejs.md index 39385e1dc8..7f02afc324 100644 --- a/articles/architecture-scenarios/mobile-api/api-implementation-nodejs.md +++ b/articles/architecture-scenarios/mobile-api/api-implementation-nodejs.md @@ -64,7 +64,7 @@ Next, we need to set our dependencies. We will use the following modules: - **express**: This module adds the [Express web application framework](https://expressjs.com/). -- **cors**: This module adds support for enabling [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) which is required since the API will be called from a Single Page Application running on a different domain inside a web browser. +- **cors**: This module adds support for enabling [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) which is required since the API will be called from a Single-Page Application running on a different domain inside a web browser. - **jwks-rsa**: This library retrieves RSA signing keys from a **JWKS** (JSON Web Key Set) endpoint. Using `expressJwtSecret` we can generate a secret provider that will provide the right signing key to `express-jwt` based on the `kid` in the JWT header. For more information refer to the [node-jwks-rsa GitHub repository](https://github.com/auth0/node-jwks-rsa). @@ -142,7 +142,7 @@ You can also write some code to actually save the timesheet to a database. This // Create middleware for checking the JWT const checkJwt = jwt({ - // Dynamically provide a signing key based on the kid in the header and the singing keys provided by the JWKS endpoint + // Dynamically provide a signing key based on the kid in the header and the signing keys provided by the JWKS endpoint secret: jwksRsa.expressJwtSecret({ cache: true, rateLimit: true, @@ -189,7 +189,7 @@ npm install express-jwt-authz --save Now it is as simple as adding a call to `jwtAuthz(...)` to your middleware to ensure that the JWT contain a particular scope in order to execute a particular endpoint. -We will add an additional dependency. The **express-jwt-authz** library, which is used in conjunction with express-jwt, validates the [JWT](/jwt) and ensures it bears the correct permissions to call the desired endoint. For more information refer to the [express-jwt-authz GitHub repository](https://github.com/auth0/express-jwt-authz). +We will add an additional dependency. The **express-jwt-authz** library, which is used in conjunction with express-jwt, validates the [JWT](/tokens/concepts/jwts) and ensures it bears the correct permissions to call the desired endpoint. For more information refer to the [express-jwt-authz GitHub repository](https://github.com/auth0/express-jwt-authz). This is our sample implementation (some code is omitted for brevity): @@ -236,11 +236,7 @@ function (user, context, callback) { } ``` -The `namespace` is used to ensure the claim has a unique name and does not clash with the names of any of the standard OIDC claims. You can typically use the URL of your application or API as the namespace. - -::: note -For more information on namespaced claims, refer to [User profile claims and scope](/api-auth/tutorials/adoption/scope-custom-claims). -::: +The `namespace` is used to ensure the claim has a unique name and does not clash with the names of any of the standard OIDC claims. For more info on namespaced claims, see [Namespacing Claims](/tokens/guides/create-namespaced-custom-claims). Next, inside your API, you can retrieve the value of the claim from `req.user`, and use that as the unique user identity which you can associate with timesheet entries. diff --git a/articles/architecture-scenarios/mobile-api/index.md b/articles/architecture-scenarios/mobile-api/index.md index f41e9182e8..c96949af52 100644 --- a/articles/architecture-scenarios/mobile-api/index.md +++ b/articles/architecture-scenarios/mobile-api/index.md @@ -2,7 +2,7 @@ order: 04 title: Mobile + API image: /media/articles/architecture-scenarios/mobile-api.png -extract: Mobile application which talks to an API. The application will use OpenID Connect with the Authorization Code Grant using Proof Key for Code Exchange (PKCE) to authenticate users. +extract: Mobile application which talks to an API. The application will use OpenID Connect (OIDC) with the Authorization Code Grant using Proof Key for Code Exchange (PKCE) to authenticate users. description: Explains the architecture scenario with a mobile application communicating with an API. toc: true topics: @@ -30,10 +30,10 @@ We will also be building a mobile application which will be used to view and log ::: panel TL;DR * Auth0 provides API Authentication and Authorization as a means to secure access to API endpoints (see [API Authentication and Authorization](/architecture-scenarios/mobile-api/part-1#api-authentication-and-authorization)) -* For authorizing a mobile app user and granting access to the API, Auth0 supports the Authorization Code Grant Flow with PKCE (see [Proof Key for Code Exchange](/architecture-scenarios/mobile-api/part-1#proof-key-for-code-exchange-pkce-)) +* For authorizing a mobile app user and granting access to the API, Auth0 supports the [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce) (see [Proof Key for Code Exchange](/architecture-scenarios/mobile-api/part-1#proof-key-for-code-exchange-pkce-)) * Both the mobile app and the API must be configured in the Auth0 Dashboard (see [Auth0 Configuration](/architecture-scenarios/mobile-api/part-2)) * User Permissions can be enforced using the Authorization Extension (see [Configure the Authorization Extension](/architecture-scenarios/mobile-api/part-2#configure-the-authorization-extension)) -* The API is secured by ensuring that a valid [Access Token](/tokens/access-token) is passed in the HTTP Authorization header when calls are made to the API (see [Implement the API](/architecture-scenarios/mobile-api/part-3#secure-the-endpoints)) +* The API is secured by ensuring that a valid [Access Token](/tokens/concepts/access-tokens) is passed in the HTTP Authorization header when calls are made to the API (see [Implement the API](/architecture-scenarios/mobile-api/part-3#secure-the-endpoints)) * The Auth0.Android SDK can be used to authorize the user of the mobile app and obtain a valid Access Token which can be used to call the API (see [Authorize the User](/architecture-scenarios/mobile-api/part-3#authorize-the-user)) * The mobile app can retrieve the user's profile information by decoding the ID Token (see [Get the User Profile](/architecture-scenarios/mobile-api/part-3#get-the-user-profile)) * UI Elements can be displayed conditionally based on the scope that was granted to the user (see [Display UI Elements Conditionally Based on Scope](/architecture-scenarios/mobile-api/part-3#display-ui-elements-conditionally-based-on-scope)) diff --git a/articles/architecture-scenarios/mobile-api/mobile-implementation-android.md b/articles/architecture-scenarios/mobile-api/mobile-implementation-android.md index bf2d3217d4..13dabfaf1c 100644 --- a/articles/architecture-scenarios/mobile-api/mobile-implementation-android.md +++ b/articles/architecture-scenarios/mobile-api/mobile-implementation-android.md @@ -119,7 +119,7 @@ Open the app's `AndroidManifest.xml` and add the `LoginActivity`: @@ -164,7 +164,7 @@ The `LoginActivity` will handle user authorization and be the initial screen use - __scheme__: `demo` - __audience__: `https://api.exampleco.com/timesheets` (the Node.JS API) - __response_type__: `code` -- __scope__: `create:timesheets read:timesheets openid profile email offline_access`. These scopes will enable us to `POST` and `GET` to the Node.JS API, as well as retrieve the user profile and a Refresh Token. +- __scope__: `create:timesheets read:timesheets openid profile email offline_access`. These scopes will enable us to `POST` and `GET` to the Node.JS API, as well as retrieve the user profile and a Refresh Token. ```java private void login() { diff --git a/articles/architecture-scenarios/mobile-api/part-1.md b/articles/architecture-scenarios/mobile-api/part-1.md index 2de377d3d4..dd7dcf520d 100644 --- a/articles/architecture-scenarios/mobile-api/part-1.md +++ b/articles/architecture-scenarios/mobile-api/part-1.md @@ -23,9 +23,9 @@ useCase: ## Proof Key for Code Exchange (PKCE) -OAuth 2 provides several grant types for different use cases. In this particular use case, we want to access the API from a mobile application, which will use the OAuth 2.0 [Proof Key for Code Exchange](/api-auth/grant/authorization-code-pkce) to do so. +OAuth 2 provides several grant types for different use cases. In this particular use case, we want to access the API from a mobile application, which will use the [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce) to do so. -The [Authorization Code Grant](/api-auth/grant/authorization-code) has some security issues, when implemented on native applications. For instance, a malicious attacker can intercept the `authorization_code` returned by Auth0 and exchange it for an [Access Token](/tokens/access-token) (and possibly a [Refresh Token](/tokens/refresh-token)). +The [Authorization Code Flow](/flows/concepts/auth-code) has some security issues when implemented on native applications. For instance, a malicious attacker can intercept the `authorization_code` returned by Auth0 and exchange it for an [Access Token](/tokens/concepts/access-tokens) (and possibly a [Refresh Token](/tokens/concepts/refresh-tokens)). The Proof Key for Code Exchange (PKCE) (defined in [RFC 7636](https://tools.ietf.org/html/rfc7636)) is a technique used to mitigate this authorization code interception attack. @@ -34,14 +34,16 @@ With PKCE, the Application creates, for every authorization request, a cryptogra ![PKCE](/media/articles/architecture-scenarios/mobile-api/authorization-code-grant-pkce.png) 1. The native app initiates the flow and redirects the user to Auth0 (specifically to the [/authorize endpoint](/api/authentication#authorization-code-grant-pkce-)), sending the `code_challenge` and `code_challenge_method` parameters. -2. Auth0 redirects the user to the native app with an `authorization_code` in the querystring. +2. Auth0 redirects the user to the native app with an `authorization_code` in the query string. 3. The native app sends the `authorization_code` and `code_verifier` together with the `redirect_uri` and the `client_id` to Auth0. This is done using the [/oauth/token endpoint](/api/authentication?http#authorization-code-pkce-). 4. Auth0 validates this information and returns an Access Token (and optionally a Refresh Token). 5. The native app can use the Access Token to call the API on behalf of the user. +<%= include('../../_includes/_refresh_token_rotation_panel.md') %> + ## Authorization Extension -The [Auth0 Authorization Extension](/extensions/authorization-extension) allows you to provide authorization support in your application, by assigning Roles, Groups and Permissions to Users. +The [Auth0 Authorization Extension](/extensions/authorization-extension) allows you to provide authorization support in your application, by assigning Roles, Groups and Permissions to Users. The Authorization Extension creates a [Rule](/rules) which will augment the [User profile](/rules/current#rule-syntax) during the authentication flow with the Roles, Groups and Permissions assigned to the user. You can then use this information to ensure that the Access Token issued to a user only contains scopes which are allowed according to the permissions defined in the Authorization Extension. diff --git a/articles/architecture-scenarios/mobile-api/part-2.md b/articles/architecture-scenarios/mobile-api/part-2.md index 5390398cb6..c9b8266765 100644 --- a/articles/architecture-scenarios/mobile-api/part-2.md +++ b/articles/architecture-scenarios/mobile-api/part-2.md @@ -28,7 +28,7 @@ You will be required to supply the following details for your API: - __Name__: a friendly name for the API. Does not affect any functionality. - __Identifier__: a unique identifier for the API. We recommend using a URL but note that this doesn't have to be a publicly available URL, Auth0 will not call your API at all. This value cannot be modified afterwards. -- __Signing Algorithm__: the algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting RS256 the token will be signed with the tenant's private key. For more details on the signing algorithms see the Signing Algorithms paragraph below. +- __Signing Algorithm__: the algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting RS256 the token will be signed with the tenant's private key. To learn more about signing algorithms, see [Signing Algorithms](/tokens/concepts/signing-algorithms). ![Create API](/media/articles/architecture-scenarios/mobile-api/create-api.png) @@ -40,15 +40,15 @@ Fill in the required information and click the __Create__ button. ## Create the Application -There are four application types in Auth0: __Native__ (used by mobile or desktop apps), __Single Page Web Applications__, __Regular Web Applications__ and __Machine to Machine Application__ (used by CLIs, Daemons, or services running on your backend). For this scenario we want to create a new Application for our mobile application, hence we will use Native as the application type. +There are four application types in Auth0: __Native App__ (used by mobile or desktop apps), __Single-Page Web App__, __Regular Web App__, and __Machine to Machine App__ (used by CLIs, Daemons, or services running on your backend). For this scenario we want to create a new Application for our mobile application, hence we will use Native as the application type. To create a new Application, navigate to the [dashboard](${manage_url}) and click on the [Applications](${manage_url}/#/applications}) menu option on the left. Click the __+ Create Application__ button. -Set a name for your Application (we will use `Timesheets Mobile`) and select `Native` as the type. +Set a name for your Application (we will use `Timesheets Mobile`) and select `Native App` as the type. Click __Create__. -![Create Application](/media/articles/architecture-scenarios/mobile-api/create-application.png) +![Create Application](/media/articles/architecture-scenarios/mobile-api/create-client.png) ## Configure the Authorization Extension @@ -66,7 +66,7 @@ Proceed to create the permissions for all the remaining scopes: ### Define Roles -Head over to the _Roles_ tab and create 2 Roles. Click the **Create Role** button and select the **Timesheets SPA** application. Give the Role a name and description of Employee, and select the `delete:timesheets`, `create:timesheets` and `read:timesheets` permissons. Click on **Save**. +Head over to the _Roles_ tab and create two Roles. Click the **Create Role** button and select the **Timesheets SPA** application. Give the Role a name and description of Employee, and select the `delete:timesheets`, `create:timesheets` and `read:timesheets` permissions. Click on **Save**. ![Create Employee Role](/media/articles/architecture-scenarios/mobile-api/create-employee-role.png) @@ -76,7 +76,7 @@ Next, follow the same process to create a **Manager** role, and ensure that you ### Assign Users to Roles -You will need to assign all users to either the Manager or the User role. You can do this by going to the _Users_ tab in the Authorization Extension and selecting a user. On the user information screen, go to the _Roles_ tab. You can add a role to the user by clicking the **Add Role to User** button, and selecting the approproate role for the user. +You will need to assign all users to either the Manager or the User role. You can do this by going to the _Users_ tab in the Authorization Extension and selecting a user. On the user information screen, go to the _Roles_ tab. You can add a role to the user by clicking the **Add Role to User** button, and selecting the appropriate role for the user. ![Add User to Role](/media/articles/architecture-scenarios/mobile-api/add-user-role.png) @@ -118,7 +118,7 @@ function (user, context, callback) { } ``` -The code above will ensure that all Access Tokens will only contain the scopes which are valid according to a user's permissions. Once you are done you can click on the **Save** button. +The code above will ensure that all Access Tokens will only contain the properly-formatted scopes (e.g., `action:area` or `delete:timesheets`) which are valid according to a user's permissions. Once you are done you can click on the **Save** button. Rules execute in the order they are displayed on the Rules page, so ensure that the new rule you created is positioned below the rule for the Authorization Extension, so it executes after the Authorization Extension rule: diff --git a/articles/architecture-scenarios/mobile-api/part-3.md b/articles/architecture-scenarios/mobile-api/part-3.md index 5af93c2158..153b761ec2 100644 --- a/articles/architecture-scenarios/mobile-api/part-3.md +++ b/articles/architecture-scenarios/mobile-api/part-3.md @@ -29,7 +29,7 @@ In this section we will see how we can implement a mobile application for our sc ### Authorize the User -To authorize the user we will implement an [Authorization Code Grant Flow with PKCE](/api-auth/tutorials/authorization-code-grant-pkce). The mobile application should first send the user to the [authorization URL](/api/authentication#authorization-code-grant-pkce-) along with the `code_challenge` and the method used to generate it: +To authorize the user we will implement the [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/guides/auth-code-pkce/call-api-auth-code-pkce). The mobile application should first send the user to the [authorization URL](/api/authentication#authorization-code-grant-pkce-) along with the `code_challenge` and the method used to generate it: ```text https://${account.namespace}/authorize? @@ -48,9 +48,9 @@ Parameter | Description ----------|------------ __client_id__ | The value of your Auth0 Client Id. You can retrieve it from the Settings of your Application at the [Auth0 Dashboard](${manage_url}/#/applications). __audience__ | The value of your API Identifier. You can retrieve it from the Settings of your API at the [Auth0 Dashboard](${manage_url}/#/apis). -__scope__ | The [scopes](/scopes) which determine the claims to be returned in the ID Token and Access Token. For example, a scope of `openid` will return an ID Token in the response. In our example mobile app, we use the following scopes: `create:timesheets read:timesheets openid profile email offline_access`. These scopes allow the mobile app to call the API, obtain a Refresh Token, and return the user's `name`, `picture`, and `email` claims in the ID Token. +__scope__ | The [scopes](/scopes) which determine the claims to be returned in the ID Token and Access Token. For example, a scope of `openid` will return an ID Token in the response. In our example mobile app, we use the following scopes: `create:timesheets read:timesheets openid profile email offline_access`. These scopes allow the mobile app to call the API, obtain a Refresh Token, and return the user's `name`, `picture`, and `email` claims in the ID Token. __response_type__ | Indicates the Authentication Flow to use. For a mobile application using PKCE, this should be set to `code`. -__code_challenge__ | The generated code challenge from the code verifier. You can find instructions on generating a code challenge [here](/api-auth/tutorials/authorization-code-grant-pkce#1-create-a-code-verifier). +__code_challenge__ | The generated code challenge from the code verifier. You can find instructions on generating a code challenge [here](/flows/guides/auth-code-pkce/call-api-auth-code-pkce#authorize-the-user#create-a-code-verifier). __code_challenge_method__ | Method used to generate the challenge. Auth0 supports only `S256`. __redirect_uri__ | The URL which Auth0 will redirect the browser to after authorization has been granted by the user. The Authorization Code will be available in the code URL parameter. This URL must be specified as a valid callback URL under your [Application's Settings](${manage_url}/#/applications). @@ -74,11 +74,32 @@ Next you can exchange the `authorization_code` from the response for an Access T "method": "POST", "url": "https://${account.namespace}/oauth/token", "headers": [ - { "name": "Content-Type", "value": "application/json" } + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } ], "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"authorization_code\",\"client_id\": \"${account.clientId}\",\"code_verifier\": \"YOUR_GENERATED_CODE_VERIFIER\",\"code\": \"YOUR_AUTHORIZATION_CODE\",\"redirect_uri\": \"com.myclientapp://myclientapp.com/callback\", }" + "mimeType": "application/x-www-form-urlencoded", + "params": [ + { + "name": "grant_type", + "value": "authorization_code" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "code_verified", + "value": "YOUR_GENERATED_CODE_VERIFIER" + }, + { + "name": "code", + "value": "YOUR_AUTHORIZATION_CODE" + }, + { + "name": "redirect_uri", + "value": "https://${account.callback}" + } + ] } } ``` @@ -104,7 +125,7 @@ The response from the Token URL will contain: ``` - __access_token__: An Access Token for the API, specified by the `audience`. -- __refresh_token__: A [Refresh Token](/tokens/refresh-token/current) will only be present if you included the `offline_access` scope AND enabled __Allow Offline Access__ for your API in the Dashboard. +- __refresh_token__: A [Refresh Token](/tokens/concepts/refresh-tokens) will only be present if you included the `offline_access` scope AND enabled __Allow Offline Access__ for your API in the Dashboard. - __id_token__: An ID Token JWT containing user profile information. - __token_type__: A string containing the type of token, this will always be a Bearer token. - __expires_in__: The amount of seconds until the Access Token expires. @@ -112,12 +133,12 @@ The response from the Token URL will contain: You will need to store the above credentials in local storage for use in calling your API and retrieving the user profile. ::: note -[See the implementation in Android.](/architecture-scenarios/application/mobile-api/mobile-implementation-android#store-credentials) +[See the implementation in Android](/architecture-scenarios/application/mobile-api/mobile-implementation-android#store-credentials). ::: ### Get the User Profile -To retrieve the [User Profile](/api/authentication?http#user-profile), your mobile application can decode the [ID Token](/tokens/id-token) using one of the [JWT libraries](https://jwt.io/#libraries-io). This is done by [verifying the signature](/tokens/id-token#verify-the-signature) and [validating the claims](/tokens/id-token#validate-the-claims) of the token. After validating the ID Token, you can access its payload containing the user information: +To retrieve the [User Profile](/api/authentication?http#user-profile), your mobile application can decode the [ID Token](/tokens/concepts/id-tokens) using one of the [JWT libraries](https://jwt.io/#libraries-io). This is done by [verifying the signature](/tokens/guides/validate-id-token#verify-the-signature) and [verifying the claims](/tokens/guides/validate-id-token#verify-the-claims) of the token. After validating the ID Token, you can access its payload containing the user information: ```json { @@ -140,7 +161,7 @@ To retrieve the [User Profile](/api/authentication?http#user-profile), your mobi ### Display UI Elements Conditionally Based on Scope -Based on the `scope` of the user, you may want to show or hide certain UI elements. To determine the scope issued to a user, you will need to inspect the the `scope` which was granted when the user was authenticated. This will be a string containing all the scopes, so you therefore need to inspect this string to see whether it contains the required `scope` and based on that make a decision whether to display a particular UI element. +Based on the `scope` of the user, you may want to show or hide certain UI elements. To determine the scope issued to a user, you will need to inspect the `scope` which was granted when the user was authenticated. This will be a string containing all the scopes, so you therefore need to inspect this string to see whether it contains the required `scope` and based on that make a decision whether to display a particular UI element. ::: note [See the implementation in Android](/architecture-scenarios/application/mobile-api/mobile-implementation-android#4-display-ui-elements-conditionally-based-on-scope) @@ -162,27 +183,34 @@ Refresh Tokens must be stored securely by an application since they do not expir To refresh your Access Token, perform a `POST` request to the `/oauth/token` endpoint using the Refresh Token from your authorization result. -A [Refresh Token](/tokens/refresh-token/current) will only be present if you included the `offline_access` scope in the previous authorization request and enabled __Allow Offline Access__ for your API in the Dashboard. +A [Refresh Token](/tokens/concepts/refresh-tokens) will only be present if you included the `offline_access` scope in the previous authorization request and enabled __Allow Offline Access__ for your API in the Dashboard. Your request should include: ```har { - "method": "POST", - "url": "https://${account.namespace}/oauth/token", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [ - { "name": "Content-Type", "value": "application/json" } - ], - "queryString" : [], - "postData" : { - "mimeType": "application/json", - "text" : "{ \"grant_type\": \"refresh_token\", \"client_id\": \"${account.clientId}\", \"refresh_token\": \"YOUR_REFRESH_TOKEN\" }" - }, - "headersSize" : 150, - "bodySize" : 0, - "comment" : "" + "method": "POST", + "url": "https://${account.namespace}/oauth/token", + "httpVersion": "HTTP/1.1", + "headers": [ + { "name": "Content-Type", "value": "application/x-www-form-urlencoded" } + ], + "postData" : { + "params": [ + { + "name": "grant_type", + "value": "refresh_token" + }, + { + "name": "client_id", + "value": "${account.clientId}" + }, + { + "name": "refresh_token", + "value": "YOUR_REFRESH_TOKEN" + } + ] + } } ``` diff --git a/articles/architecture-scenarios/server-api/api-implementation-nodejs.md b/articles/architecture-scenarios/server-api/api-implementation-nodejs.md index 0a040c46e1..d52ffd389a 100644 --- a/articles/architecture-scenarios/server-api/api-implementation-nodejs.md +++ b/articles/architecture-scenarios/server-api/api-implementation-nodejs.md @@ -62,7 +62,7 @@ Next, we need to set our dependencies. We will use the following modules: - **express**: This module adds the [Express web application framework](https://expressjs.com/). -- **jwks-rsa**: This library retrieves RSA signing keys from a [**JWKS** (JSON Web Key Set)](/jwks) endpoint. Using `expressJwtSecret` we can generate a secret provider that will provide the right signing key to `express-jwt` based on the `kid` in the JWT header. For more information refer to the [node-jwks-rsa GitHub repository](https://github.com/auth0/node-jwks-rsa). +- **jwks-rsa**: This library retrieves RSA signing keys from a [**JWKS** (JSON Web Key Set)](/tokens/concepts/jwks) endpoint. Using `expressJwtSecret` we can generate a secret provider that will provide the right signing key to `express-jwt` based on the `kid` in the JWT header. For more information refer to the [node-jwks-rsa GitHub repository](https://github.com/auth0/node-jwks-rsa). - **express-jwt**: This module lets you authenticate HTTP requests using JWT tokens in your Node.js applications. It provides several functions that make working with JWTs easier. For more information refer to the [express-jwt GitHub repository](https://github.com/auth0/express-jwt). @@ -134,7 +134,7 @@ This is also a good time for you to implement the logic to save the timesheet en // Create middleware for checking the JWT const checkJwt = jwt({ - // Dynamically provide a signing key based on the kid in the header and the singing keys provided by the JWKS endpoint. + // Dynamically provide a signing key based on the kid in the header and the signing keys provided by the JWKS endpoint. secret: jwksRsa.expressJwtSecret({ cache: true, rateLimit: true, diff --git a/articles/architecture-scenarios/server-api/cron-implementation-python.md b/articles/architecture-scenarios/server-api/cron-implementation-python.md index 523dac64ed..4b63fa532b 100644 --- a/articles/architecture-scenarios/server-api/cron-implementation-python.md +++ b/articles/architecture-scenarios/server-api/cron-implementation-python.md @@ -48,7 +48,7 @@ def main(): 'client_secret': client_secret, 'audience': api_identifier, 'grant_type': grant_type}) - req = urllib2.Request(base_url + "/oauth/token", data, headers={"Accept": "application/json"}) + req = urllib2.Request(base_url + "/oauth/token", data, headers={"Accept": "application/x-www-form-urlencoded"}) response = urllib2.urlopen(req) resp_body = response.read() oauth = json.loads(resp_body) diff --git a/articles/architecture-scenarios/server-api/part-2.md b/articles/architecture-scenarios/server-api/part-2.md index 2b43a81f4c..431f5d2c86 100644 --- a/articles/architecture-scenarios/server-api/part-2.md +++ b/articles/architecture-scenarios/server-api/part-2.md @@ -16,7 +16,7 @@ useCase: # Server + API: Auth0 Configuration -In this section we will review all the configurations we need to apply using the [Auth0 Dashboard](${manage_url}). +In this section, we will review all the configurations we need to apply using the [Auth0 Dashboard](${manage_url}). ## Configure the API @@ -24,23 +24,23 @@ Click on the [APIs menu option](${manage_url}/#/apis) on the left, and click the You will be required to supply the following details for your API: -- **Name**: a friendly name for the API. Does not affect any functionality. -- **Identifier**: a unique identifier for the API. We recommend using a URL but note that this doesn't have to be a publicly available URL, Auth0 will not call your API at all. This value cannot be modified afterwards. -- **Signing Algorithm**: the algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting RS256 the token will be signed with the tenant's private key. For more details on the signing algorithms see the [Signing Algorithms paragraph](#signing-algorithms) below. +- **Name**: Friendly name for the API. Does not affect any functionality. +- **Identifier**: Unique identifier for the API. We recommend using a URL, but this doesn't have to be a publicly available URL; Auth0 will not call your API at all. This value cannot be modified afterwards. +- **Signing Algorithm**: Algorithm to sign the tokens with. Available values are `HS256` and `RS256`. When selecting RS256, the token will be signed with the tenant's private key. To learn more about signing algorithms, see [Signing Algorithms](/tokens/concepts/signing-algorithms). ![Create API](/media/articles/architecture-scenarios/server-api/create-api.png) -Fill in the required information and click the **Create** button. +Fill in the required information, and click the **Create** button. ### Signing Algorithms -When you create an API you have to select the algorithm your tokens will be signed with. The signature is used to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed along the way. +When you create an API, you must select the algorithm with which your tokens will be signed. The signature is used to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed along the way. ::: note - The signature is part of a JWT. If you are not familiar with the JWT structure please refer to: [JSON Web Tokens (JWTs) in Auth0](/jwt#what-is-the-json-web-token-structure-). +The signature is part of a JWT. If you are unfamiliar with JWT structure, please see [JSON Web Token Structure](/tokens/references/jwt-structure). ::: -To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. That algorithm, which is part of the JWT header, is the one you select for your API: `HS256` or `RS256`. +To create the signature, you must take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. That algorithm, which is part of the JWT header, is the one you select for your API: `HS256` or `RS256`. - **RS256** is an [asymmetric algorithm](https://en.wikipedia.org/wiki/Public-key_cryptography) which means that there are two keys: one public and one private (secret). Auth0 has the secret key, which is used to generate the signature, and the consumer of the JWT has the public key, which is used to validate the signature. @@ -48,53 +48,51 @@ To create the signature part you have to take the encoded header, the encoded pa The most secure practice, and our recommendation, is to use **RS256**. Some of the reasons are: -- With RS256 you are sure that only the holder of the private key (Auth0) can sign tokens, while anyone can check if the token is valid using the public key. -- Under HS256, If the private key is compromised you would have to re-deploy the API with the new secret. With RS256 you can request a token that is valid for multiple audiences. -- With RS256 you can implement key rotation without having to re-deploy the API with the new secret. - -For a more detailed overview of the JWT signing algorithms refer to: [JSON Web Token (JWT) Signing Algorithms Overview](https://auth0.com/blog/json-web-token-signing-algorithms-overview/). +- With RS256, you are sure that only the holder of the private key (Auth0) can sign tokens, while anyone can check if the token is valid using the public key. +- Under HS256, if the private key is compromised you would have to re-deploy the API with the new secret. With RS256, you can request a token that is valid for multiple audiences. +- With RS256, you can implement key rotation without having to re-deploy the API with the new secret. ## Configure the Scopes -Once the application has been created you will need to configure the Scopes which applications can request during authorization. +Once the application has been created, you will need to configure the Scopes that applications can request during authorization. -In the settings for your API, go to the *Scopes* tab. In this section you can add all four of the scopes which was discussed before, namely `batch:upload`, `read:timesheets`, `create:timesheets`, `delete:timesheets`, `approve:timesheets`. +In the settings for your API, go to the *Scopes* tab. In this section, you can add all four of the scopes discussed before: `batch:upload`, `read:timesheets`, `create:timesheets`, `delete:timesheets`, and `approve:timesheets`. Also add an additional scope: `batch:upload`. ::: note - For the purposes of this document we will only be ever concerned with the `batch:upload` scope, as that is all that is required by the Cron job. For completeness sake we are however adding the necessary scopes which will be required by future applications as well. + For the purpose of this document, we will only be concerned with the `batch:upload` scope because that is all that is required by the cron job. However, for the sake of completeness, we are adding the necessary scopes which will be required by future applications. ::: ![Add Scopes](/media/articles/architecture-scenarios/server-api/add-scopes.png) ## Create the Application -When creating an API in the Auth0 Dashboard, a test application for the API will automatically be generated. In the Auth0 Dashboard, navigate to the [Application Section](${manage_url}/#/applications) and you will see the test application for the Timesheets API. +When creating an API in the Auth0 Dashboard, a test application for the API will automatically be generated. In the Auth0 Dashboard, navigate to the [Application Section](${manage_url}/#/applications), and you will see the test application for the Timesheets API. ![Machine to Machine Application](/media/articles/architecture-scenarios/server-api/non-interactive-client.png) Go to the settings for the application by clicking on the gear icon, and rename the application to `Timesheets import Job`. -For the cron job you will need a Machine to Machine Application. This test application which was generated when the API was created was automatically configured as a Machine to Machine Application as can be seen in the screenshot below. +For the cron job, you will need a Machine-to-Machine Application. The test application that was generated when the API was created was automatically configured as a Machine-to-Machine Application: ![Machine to Machine Application Settings](/media/articles/architecture-scenarios/server-api/non-interactive-client-settings.png) ## Configure Application's access to the API -The final part of the Auth0 configuration is to allow the application access to the Timesheets API. Go back to the configuration of the API, and select the *Machine to Machine Application* tab. +Finally, you must allow the application access to the Timesheets API. Go back to the configuration of the API, and select the *Machine to Machine Application* tab. You will see the **Timesheets Import Job** application listed, and it should have access to API as can be seen from the switch to the right of the application name which indicates a value of `Authorized`. If it does not indicate that the application is authorized, simply toggle the value of the switch from `Unauthorized` to `Authorized`. ![Authorize Application](/media/articles/architecture-scenarios/server-api/authorize-client.png) -You will also need to specify which scopes will be included in Access Tokens which are issued to the application when the application authorizes with Auth0. +You will also need to specify which scopes will be included in Access Tokens that are issued to the application when the application authorizes with Auth0. Expand the settings for the application by clicking on the down arrow to the far right, and you will see the list of available scopes. The cron job will only require the `batch:upload` scope as it will simply create new timesheets based on the timesheet entries in the external system. -Once you have selected the `batch:upload` scope you can save the settings by clicking the **Update** button. +Once you have selected the `batch:upload` scope, save the settings by clicking the **Update** button. ![Assign Scopes](/media/articles/architecture-scenarios/server-api/assign-scopes.png) -Now that we have designed our solution and discussed the configurations needed on Auth0 side, we can proceed with the implementation part. That's what the next paragraph is all about, so keep reading! +Now that we have designed our solution and discussed the configurations needed on Auth0's side, we can proceed with the implementation. That's what the next paragraph is all about, so keep reading! <%= include('./_stepnav', { diff --git a/articles/architecture-scenarios/server-api/part-3.md b/articles/architecture-scenarios/server-api/part-3.md index 82a79385aa..86e00db211 100644 --- a/articles/architecture-scenarios/server-api/part-3.md +++ b/articles/architecture-scenarios/server-api/part-3.md @@ -19,20 +19,20 @@ useCase: In this section of the tutorial, we will take an in-depth look into our API and its associated Machine to Machine Application. ::: note - For simplicity reasons we will keep our implementation solely focused on the authentication and authorization part. As you will see in the samples the input timesheet entry will be hard-coded and the API will not persist the timesheet entry, simply echo back some of the info. +For simplicity, we will keep our implementation solely focused on authentication and authorization. As you will see in the samples, the input timesheet entry will be hard-coded, and the API will not persist the timesheet entry. Instead, it will simply echo back some of the info. ::: ## Define the API endpoints -First we need to define the endpoints of our API. +First, we need to define the endpoints of our API. ::: panel What is an API endpoint? -An **API endpoint** is a unique URL that represents an object. In order to interact with this object you need to point your application towards that URL. For example, if you had an API that could return either order or customers, you might configure two endpoints: `/orders` and `/customers`. Your application would interact with these endpoints using different HTTP methods, for example `POST /orders` to create a new order, or `GET /orders` to retrieve the dataset of one or more orders. +An **API endpoint** is a unique URL that represents an object. To interact with this object, you need to point your application to its URL. For example, if you had an API that could return either orders or customers, you might configure two endpoints: `/orders` and `/customers`. Your application would interact with these endpoints using different HTTP methods; for example, `POST /orders` could create a new order or `GET /orders` could retrieve the dataset of one or more orders. ::: -We will configure one single endpoint that will be used for creating timesheet entries. The endpoint will be `/timesheets/upload` and the HTTP method `POST`. +We will configure one single endpoint that will be used to create timesheet entries. The endpoint will be `/timesheets/upload` and the HTTP method will be `POST`. -The API will expect a JSON object as input, containing the timesheet information. We will use the following JSON: +As input, the API will expect a JSON object containing the timesheet information. We will use the following JSON: ```json { @@ -46,19 +46,19 @@ The API will expect a JSON object as input, containing the timesheet information The API will print the JSON, so we can verify the contents and echo back a message like the following: `Created timesheet 14 for employee 007`. ::: note - See the implementation in [Node.js](/architecture-scenarios/application/server-api/api-implementation-nodejs#1-define-the-api-endpoint) +See the implementation in [Node.js](/architecture-scenarios/application/server-api/api-implementation-nodejs#1-define-the-api-endpoint). ::: ### Secure the API endpoints ::: panel-warning Configure the API -In order to secure your endpoints you need to have your API configured in the Auth0 Dashboard. For information on how to do that refer to the [Configure the API](#configure-the-api) paragraph of this document. +To secure your endpoints, you need to have your API configured in the Auth0 Dashboard. To learn how, see the [Configure the API](#configure-the-api) paragraph of this document. ::: -The first step towards securing our API endpoint is to get an Access Token as part of the Header and validate it. If it's not valid then we should return an HTTP Status 401 (Unauthorized) to the calling process. +The first step towards securing our API endpoint is to get an Access Token as part of the Header and validate it. If it's not valid, then we should return an HTTP Status 401 (Unauthorized) to the calling process. ::: note - See the implementation in [Node.js](/architecture-scenarios/application/server-api/api-implementation-nodejs#2-secure-the-api-endpoint) +See the implementation in [Node.js](/architecture-scenarios/application/server-api/api-implementation-nodejs#2-secure-the-api-endpoint). ::: #### Get an Access Token @@ -75,42 +75,42 @@ To get an Access Token without using our application sample implementation, perf ``` ::: note - For more information on this refer to: [API Authorization: Asking for Access Tokens for a Client Credentials Grant](/api-auth/config/asking-for-access-tokens). +To learn more, see [API Authorization: Asking for Access Tokens for a Client Credentials Grant](/api-auth/config/asking-for-access-tokens). ::: ## Check the application permissions -Now we have secured our API's endpoint with an Access Token but we still haven't ensured that the process calling the API has indeed the rights to post a new timesheet entry. +Now we have secured our API's endpoint with an Access Token, but we still haven't ensured that the process calling the API has the rights to post a new timesheet entry. -As discussed earlier in this doc, each Access Token may include a list of the permissions that have been granted to the client. These permissions are defined using the scope request parameter. For more information on how to configure this refer to the [Configure the Scopes](#configure-the-scopes) paragraph. +As discussed earlier in this doc, each Access Token may include a list of the permissions that have been granted to the client. These permissions are defined using the `scope` request parameter. To learn how to configure this, see the [Configure the Scopes](#configure-the-scopes) paragraph. -For our endpoint we will require the scope `batch:upload`. +For our endpoint, we will require the scope `batch:upload`. ::: note - See the implementation in [Node.js](/architecture-scenarios/application/server-api/api-implementation-nodejs#3-check-the-client-permissions) +See the implementation in [Node.js](/architecture-scenarios/application/server-api/api-implementation-nodejs#3-check-the-client-permissions). ::: ### Implement the Machine to Machine Application -In this section we will see how we can implement a Machine to Machine Application for our scenario. +In this section, we will see how we can implement a Machine-to-Machine Application for our scenario. ::: note - For simplicity reasons we will keep our implementations solely focused on the authentication and authorization part and configure our application to send a single hard-coded timesheet entry to the API. Also, we will print in the console, something we wouldn't do with a server running process. +For simplicity, we will keep our implementation solely focused on authentication and authorization, and configure our application to send a single hard-coded timesheet entry to the API. Also, we will print in the console, which is something we wouldn't do with a server-running process. ::: ### Get an Access Token -We will start by invoking the Auth0 `/oauth/token` API endpoint in order to get an Access Token. +We will start by invoking the Auth0 `/oauth/token` API endpoint to get an Access Token. -In order to do so we will need the following configuration values: +To do so, we will need the following configuration values: -- **Domain**: The value of your Auth0 Domain. You can retrieve it from the *Settings* of your application at the [Auth0 Dashboard](${manage_url}/#/applications). This value will be a part of the API URL: `https://${account.namespace}/oauth/token`. +- **Domain**: Auth0 Domain, which you can retrieve from the *Settings* of your application in the [Auth0 Dashboard](${manage_url}/#/applications). This value will be a part of the API URL: `https://${account.namespace}/oauth/token`. -- **Audience**: The value of your API Identifier. You can retrieve it from the *Settings* of your API at the [Auth0 Dashboard](${manage_url}/#/apis). +- **Audience**: API Identifier, which you can retrieve from the *Settings* of your API in the [Auth0 Dashboard](${manage_url}/#/apis). -- **Client ID**: The value of your Auth0 application's Id. You can retrieve it from the *Settings* of your application at the [Auth0 Dashboard](${manage_url}/#/applications). +- **Client ID**: Auth0 Application's Client ID, which you can retrieve from the *Settings* of your application in the [Auth0 Dashboard](${manage_url}/#/applications). -- **Client Secret**: The value of your Auth0 application's Secret. You can retrieve it from the *Settings* of your application at the [Auth0 Dashboard](${manage_url}/#/applications). +- **Client Secret**: Auth0 application's Client Secret, which you can retrieve from the *Settings* of your application in the [Auth0 Dashboard](${manage_url}/#/applications). Our implementation should perform a `POST` operation to the `https://${account.namespace}/oauth/token` endpoint with a payload in the following format: @@ -123,24 +123,24 @@ Our implementation should perform a `POST` operation to the `https://${account.n } ``` -For more information on this refer to: [API Authorization: Asking for Access Tokens for a Client Credentials Grant](/api-auth/config/asking-for-access-tokens). +To learn more, see [API Authorization: Asking for Access Tokens for a Client Credentials Grant](/api-auth/config/asking-for-access-tokens). ::: note - See the implementation in [Python](/architecture-scenarios/application/server-api/cron-implementation-python#get-an-access-token). +See the implementation in [Python](/architecture-scenarios/application/server-api/cron-implementation-python#get-an-access-token). ::: ## Invoke the API -Now that we have an Access Token, which includes the valid scopes, we can invoke our API. +Now that we have an Access Token that includes the valid scopes, we can invoke our API. -In order to do so we will: +To do so, we will: - Build a hard-coded timesheet entry in JSON format. - Add the Access Token as an `Authorization` header to our request. - Make the HTTP POST request. -- Parse the response and print it in the terminal (optional). +- Parse the response, and print it in the terminal (optional). ::: note - See the implementation in [Python](/architecture-scenarios/application/server-api/cron-implementation-python#invoke-the-api). +See the implementation in [Python](/architecture-scenarios/application/server-api/cron-implementation-python#invoke-the-api). ::: <%= include('./_stepnav', { diff --git a/articles/architecture-scenarios/spa-api/api-implementation-nodejs.md b/articles/architecture-scenarios/spa-api/api-implementation-nodejs.md index 47e12db84e..6b62c2fa41 100644 --- a/articles/architecture-scenarios/spa-api/api-implementation-nodejs.md +++ b/articles/architecture-scenarios/spa-api/api-implementation-nodejs.md @@ -63,7 +63,7 @@ Next, we need to set our dependencies. We will use the following modules: - **express**: This module adds the [Express web application framework](https://expressjs.com/). -- **cors**: This module adds support for enabling [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) which is required since the API will be called from a Single Page Application running on a different domain inside a web browser. +- **cors**: This module adds support for enabling [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) which is required since the API will be called from a Single-Page Application running on a different domain inside a web browser. - **jwks-rsa**: This library retrieves RSA signing keys from a **JWKS** (JSON Web Key Set) endpoint. Using `expressJwtSecret` we can generate a secret provider that will provide the right signing key to `express-jwt` based on the `kid` in the JWT header. For more information refer to the [node-jwks-rsa GitHub repository](https://github.com/auth0/node-jwks-rsa). @@ -141,7 +141,7 @@ You can also write some code to actually save the timesheet to a database. This // Create middleware for checking the JWT const checkJwt = jwt({ - // Dynamically provide a signing key based on the kid in the header and the singing keys provided by the JWKS endpoint + // Dynamically provide a signing key based on the kid in the header and the signing keys provided by the JWKS endpoint secret: jwksRsa.expressJwtSecret({ cache: true, rateLimit: true, @@ -188,7 +188,7 @@ npm install express-jwt-authz --save Now it is as simple as adding a call to `jwtAuthz(...)` to your middleware to ensure that the JWT contain a particular scope in order to execute a particular endpoint. -The **express-jwt-authz** library, which is used in conjunction with express-jwt, validates the [JWT](/jwt) and ensures it bears the correct permissions to call the desired endoint. For more information refer to the [express-jwt-authz GitHub repository](https://github.com/auth0/express-jwt-authz). +The **express-jwt-authz** library, which is used in conjunction with express-jwt, validates the [JWT](/tokens/concepts/jwts) and ensures it bears the correct permissions to call the desired endpoint. For more information refer to the [express-jwt-authz GitHub repository](https://github.com/auth0/express-jwt-authz). This is our sample implementation (some code is omitted for brevity): @@ -235,11 +235,7 @@ function (user, context, callback) { } ``` -The `namespace` is used to ensure the claim has a unique name and does not clash with the names of any of the standard OIDC claims. You can typically use the URL of your application or API as the namespace. - -::: note -For more information on namespaced claims, refer to [User profile claims and scope](/api-auth/tutorials/adoption/scope-custom-claims). -::: +The `namespace` is used to ensure the claim has a unique name and does not clash with the names of any of the standard OIDC claims. For more info on namespaced claims, refer to [Namespacing Claims](/tokens/guides/create-namespaced-custom-claims). Now, inside your API, you can retrieve the value of the claim from `req.user`, and use that as the unique user identity which you can associate with timesheet entries. diff --git a/articles/architecture-scenarios/spa-api/index.md b/articles/architecture-scenarios/spa-api/index.md index dc6c0c6b90..a91e1b8f87 100644 --- a/articles/architecture-scenarios/spa-api/index.md +++ b/articles/architecture-scenarios/spa-api/index.md @@ -2,8 +2,8 @@ order: 03 title: SPA + API image: /media/articles/architecture-scenarios/spa-api.png -extract: Single Page Web Application which talks to an API. The application will use OpenID Connect with the Implicit Grant Flow to authenticate users with Auth0. -description: Explains the architecture scenario where a Single Page Web Application (SPA) talks to an API using OpenID Connect, and the OAuth 2.0 Implicit Grant Flow, to authenticate users with Auth0. +extract: Single-Page Web Application which talks to an API. The application will use OpenID Connect (OIDC) with the Implicit Grant Flow to authenticate users with Auth0. +description: Explains the architecture scenario where a Single-Page Web Application (SPA) talks to an API using OpenID Connect (OIDC), and the OAuth 2.0 Implicit Grant Flow, to authenticate users with Auth0. toc: true topics: - architecture @@ -24,7 +24,7 @@ useCase: In this scenario, we will build a Timesheet API for a fictitious company named ExampleCo. The API will allow adding timesheet entries for an employee or a contractor. -We will also be building a Single Page Application (SPA) which will be used to log timesheet entries and send them to the centralized timesheet database using the API. +We will also be building a Single-Page Application (SPA) which will be used to log timesheet entries and send them to the centralized timesheet database using the API. ::: panel TL;DR * Auth0 provides API Authentication and Authorization as a means to secure access to API endpoints (see [API Authentication and Authorization](/architecture-scenarios/spa-api/part-1#api-authentication-and-authorization)) diff --git a/articles/architecture-scenarios/spa-api/part-1.md b/articles/architecture-scenarios/spa-api/part-1.md index 946b416215..610b49008e 100644 --- a/articles/architecture-scenarios/spa-api/part-1.md +++ b/articles/architecture-scenarios/spa-api/part-1.md @@ -20,29 +20,22 @@ useCase: <%= include('../_includes/_api-authentication-and-authorization.md') %> -## Implicit Grant +## Authorization Code Flow with Proof Key for Code Exchange (PKCE) -OAuth 2.0 provides several __grant types__ for different use cases. In this particular use case, we want to access the API from a [client-side app](/quickstart/spa). +Because SPAs are public clients and cannot securely store a Client Secret since the source code is available to the browser, you will want to use the [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/authorization-code-flow-with-proof-key-for-code-exchange-pkce) with your SPA. -The SPA will use the OAuth 2.0 [Implicit Grant](/api-auth/grant/implicit) to do so. +With this flow, the calling application requests an Access Token over HTTPS with a transformative value—a Code Verifier (or another type of client secret)—that can be verified by the authorization server. -The Implicit Grant (defined in [RFC 6749, section 4.1](https://tools.ietf.org/html/rfc6749#section-4.2)) is similar to the [Authorization Code Grant](/api-auth/grant/authorization-code), but the main difference is that the application receives an Access Token directly, without the need for an `authorization_code`. This happens because the application, which is typically a JavaScript app running within a browser, is less trusted than a web app running on the server, hence cannot be trusted with the `client_secret` (which is required in the Authorization Code Grant). -Once the user authenticates, the application receives the ID Token and Access Token in the hash fragment of the URI. The application can now use the ID Token to obtain information about the user, and Access Token to call the API on behalf of the user. +## Implicit Flow -![Implicit Grant](/media/articles/api-auth/implicit-grant.png) +The original specifications for OAuth2 introduced the Implicit Flow, a way for SPAs without a backend to obtain Access Tokens and call APIs directly from the browser. However, mitigation strategies are necessary to use the Implicit Flow because tokens are returned in the URL directly from the authorization endpoint as opposed to the token endpoint. -1. The app initiates the flow and redirects the browser to Auth0 (specifically to the [/authorize endpoint](/api/authentication#implicit-grant)), so the user can authenticate. - -1. Auth0 authenticates the user. The first time the user goes through this flow, and if the application is a third party application, a consent page will be shown where the permissions, that will be given to the Client, are listed (for example, post messages, list contacts, and so forth). - -1. Auth0 redirects the user to the app with an Access Token (and optionally an ID Token) in the hash fragment of the URI. The app can now extract the tokens from the hash fragment. - -1. The app can use the Access Token to call the API on behalf of the user. +We recommend using the [Authorization Code Flow with PKCE](https://auth0.com/docs/flows/authorization-code-flow) rather than Implicit Flow; however, if you are unable to update to the recommended flow, you should implement necessary mitigations to combat the risks. ## Authorization Extension -The [Auth0 Authorization Extension](/extensions/authorization-extension) allows you to configure Roles, Groups, and Permissions, and assign them to Users. +The [Auth0 Authorization Extension](/extensions/authorization-extension) allows you to configure Roles, Groups, and Permissions, and assign them to Users. - The Permissions are actions that someone can do. For ExampleCo's business needs, we will configure four Permissions: read, create, delete and approve timesheets. - The Roles are collections of Permissions. ExampleCo's timesheets app will be used by two kinds of users (employees and managers), with different permissions each, so we will configure two Roles: employee and manager. diff --git a/articles/architecture-scenarios/spa-api/part-2.md b/articles/architecture-scenarios/spa-api/part-2.md index be95d0cd26..6b7d8d1299 100644 --- a/articles/architecture-scenarios/spa-api/part-2.md +++ b/articles/architecture-scenarios/spa-api/part-2.md @@ -26,36 +26,12 @@ You will be asked to supply the following details for your API: - __Name__: a friendly name for the API. Does not affect any functionality. - __Identifier__: a unique identifier for the API. We recommend using a URL but note that this doesn't have to be a publicly available URL, Auth0 will not call your API at all. This value cannot be modified afterwards. -- __Signing Algorithm__: the algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting RS256 the token will be signed with the tenant's private key. For more details on the signing algorithms see the [Signing Algorithms paragraph](#signing-algorithms) below. +- __Signing Algorithm__: the algorithm to sign the tokens with. The available values are `HS256` and `RS256`. When selecting RS256 the token will be signed with the tenant's private key. To learn more about signing algorithms, see [Signing Algorithms](#signing-algorithms). ![Create API](/media/articles/architecture-scenarios/spa-api/create-api.png) Fill in the required information and click the **Create** button. -## Signing Algorithms - -When you create an API you have to select the algorithm your tokens will be signed with. The signature is used to verify that the sender of the JWT is who it says it is and to ensure that the message wasn't changed along the way. - -::: note -The signature is part of a JWT. If you are not familiar with the JWT structure please refer to [JSON Web Tokens (JWTs) in Auth0](/jwt#what-is-the-json-web-token-structure-). -::: - -To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. That algorithm, which is part of the JWT header, is the one you select for your API: `HS256` or `RS256`. - -- __RS256__ is an [asymmetric algorithm](https://en.wikipedia.org/wiki/Public-key_cryptography) which means that there are two keys: one public and one private (secret). Auth0 has the secret key, which is used to generate the signature, and the consumer of the JWT has the public key, which is used to validate the signature. - -- __HS256__ is a [symmetric algorithm](https://en.wikipedia.org/wiki/Symmetric-key_algorithm) which means that there is only one secret key, shared between the two parties. The same key is used both to generate the signature and to validate it. Special care should be taken in order for the key to remain confidential. - -The most secure practice, and our recommendation, is to use __RS256__. Some of the reasons are: - -- With RS256 you are sure that only the holder of the private key (Auth0) can sign tokens, while anyone can check if the token is valid using the public key. -- Under HS256, If the private key is compromised you would have to re-deploy the API with the new secret. With RS256 you can request a token that is valid for multiple audiences. -- With RS256 you can implement key rotation without having to re-deploy the API with the new secret. - -::: note -For a more detailed overview of the JWT signing algorithms refer to [JSON Web Token (JWT) Signing Algorithms Overview](https://auth0.com/blog/json-web-token-signing-algorithms-overview/). -::: - ## Configure the Scopes Once the application has been created you will need to configure the Scopes which applications can request during authorization. @@ -67,16 +43,16 @@ In the settings for your API, go to the **Scopes** tab. In this section you can ## Create the Application There are four application types in Auth0: -- __Native__ (used by mobile or desktop apps), -- __Single Page Web Applications__, -- __Regular Web Applications__ and -- __Machine to Machine Applications__ (used by CLIs, Daemons, or services running on your backend). +- __Native App__ (used by mobile or desktop apps), +- __Single-Page Web App__, +- __Regular Web App__ and +- __Machine to Machine App__ (used by CLIs, Daemons, or services running on your backend). -For this scenario we want to create a new Application for our SPA, hence we will use Single Page Application as the application type. +For this scenario we want to create a new Application for our SPA, hence we will use Single-Page Application as the application type. To create a new Application, navigate to the [dashboard](${manage_url}) and click on the [Applications](${manage_url}/#/applications}) menu option on the left. Click the __+ Create Application__ button. -Set a name for your Application (we will use `Timesheets SPA`) and select `Single Page Web Applications` as the type. +Set a name for your Application (we will use `Timesheets SPA`) and select `Single-Page Web App` as the type. Click __Create__. @@ -106,11 +82,11 @@ Proceed to create the permissions for all the remaining scopes: ### Define Roles -Next let's configure the two Roles: employee and manager. +Next let's configure the two Roles: employee and manager. Head over to the **Roles** tab, click the **Create Role** button, and select the **Timesheets SPA** application. -Set the **Name** and **Description** to `Employee`, and select the `delete:timesheets`, `create:timesheets` and `read:timesheets` permissons. Click on **Save**. +Set the **Name** and **Description** to `Employee`, and select the `delete:timesheets`, `create:timesheets` and `read:timesheets` permissions. Click on **Save**. ![Create Employee Role](/media/articles/architecture-scenarios/spa-api/create-employee-role.png) @@ -138,11 +114,11 @@ To do so, click on your user avatar in the top right of the Authorization Extens Make sure that **Permissions** are enabled and then click **Publish Rule**. -![Pulish Rule](/media/articles/architecture-scenarios/spa-api/publish-rule.png) +![Publish Rule](/media/articles/architecture-scenarios/spa-api/publish-rule.png) ### Create a Rule to validate token scopes -The final step in this process is to create a Rule which will validate that the scopes contained in an Access Token is valid based on the permissions assigned to the user. Any scopes which are not valid for a user should be removed from the Access Token. +The final step in this process is to create a Rule to check if the scopes contained in an Access Token are valid based on the permissions assigned to the user. Any scopes which are not valid for a user should be removed from the Access Token. In your Auth0 Dashboard, go to the **Rules** tab. You should see the Rule created by the Authorization Extension: @@ -152,23 +128,20 @@ Click on the **Create Rule** button and select the **Empty Rule** template. You ```js function (user, context, callback) { - if (context.clientName !== 'Timesheets SPA') { - return callback(null, user, context); - } - var permissions = user.permissions || []; var requestedScopes = context.request.body.scope || context.request.query.scope; var filteredScopes = requestedScopes.split(' ').filter( function(x) { return x.indexOf(':') < 0; }); - Array.prototype.push.apply(filteredScopes, permissions); - context.accessToken.scope = filteredScopes.join(' '); + + var allScopes = filteredScopes.concat(permissions); + context.accessToken.scope = allScopes.join(' '); callback(null, user, context); } ``` -The code above will ensure that all Access Tokens will only contain the scopes which are valid according to a user's permissions. Once you are done you can click on the **Save** button. +The code above will ensure that all Access Tokens will only contain the properly-formatted scopes (e.g., `action:area` or `delete:timesheets`) which are valid according to a user's permissions. Once you are done you can click on the **Save** button. Rules execute in the order they are displayed on the Rules page, so ensure that the new rule you created is positioned below the rule for the Authorization Extension, so it executes after the Authorization Extension rule: diff --git a/articles/architecture-scenarios/spa-api/part-3.md b/articles/architecture-scenarios/spa-api/part-3.md index 6e2876a0f1..11ecdf8568 100644 --- a/articles/architecture-scenarios/spa-api/part-3.md +++ b/articles/architecture-scenarios/spa-api/part-3.md @@ -54,7 +54,7 @@ The validations that the API should perform are: Part of the validation process is to also check the Application permissions (scopes), but we will address this separately in the next paragraph of this document. -For more information on validating Access Tokens, refer to [Verify Access Tokens](/api-auth/tutorials/verify-access-token). +For more information on validating Access Tokens, see [Validate Access Tokens](/tokens/guides/validate-access-tokens). ::: note See the implementation in [Node.js](/architecture-scenarios/application/spa-api/api-implementation-nodejs#2-secure-the-api-endpoints) @@ -126,20 +126,12 @@ The contents of the authResult object returned by parseHash depend upon which au - __accessToken__: An Access Token for the API, specified by the __audience__. - __expiresIn__: A string containing the expiration time (in seconds) of the Access Token. -You also need to store the tokens returned by the authentication result in local storage to keep track of the fact that the user is logged in. You can also subsequently retrieve the Access Token from local storage when calling your API. +Determine where best to [store the tokens](/tokens/concepts/token-storage). If your single-page app has a backend server at all, then tokens should be handled server-side using the [Authorization Code Flow](/flows/concepts/auth-code) or [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](/flows/concepts/auth-code-pkce). + +If you have a single-page app (SPA) with no corresponding backend server, your SPA should request new tokens on login and store them in memory without any persistence. To make API calls, your SPA would then use the in-memory copy of the token. + +For an example of how to handle sessions in SPAs, check out the [Handle Authentication Tokens](/quickstart/spa/vanillajs#handle-authentication-tokens) section of the [JavaScript Single-Page App Quickstart](/quickstart/spa/vanillajs). -```js -this.auth0.parseHash((err, authResult) => { - if (authResult && authResult.accessToken && authResult.idToken) { - window.location.hash = ''; - // Store the authResult in local storage and redirect the user elsewhere - localStorage.setItem('access_token', authResult.accessToken); - localStorage.setItem('id_token', authResult.idToken); - } else if (err) { - // Handle authentication error, for example by displaying a notification to the user - } -}); -``` ::: note See the implementation in [Angular 2](/architecture-scenarios/application/spa-api/spa-implementation-angular2#2-authorize-the-user) @@ -171,7 +163,7 @@ The `client.userInfo` method can be called passing the returned `authResult.acce You can access any of these properties in the callback function passed when calling the `userInfo` function: ```js -const accessToken = localStorage.getItem('access_token'); +const accessToken = authResult.accessToken; auth0.client.userInfo(accessToken, (err, profile) => { if (profile) { @@ -183,7 +175,7 @@ auth0.client.userInfo(accessToken, (err, profile) => { ``` ::: note -See the implementation in [Angular 2](/architecture-scenarios/application/spa-api/spa-implementation-angular2#3-get-the-user-profile) +See the implementation in [Angular 2](/architecture-scenarios/application/spa-api/spa-implementation-angular2#3-get-the-user-profile). ::: ### Display UI Elements Conditionally Based on Scope @@ -212,7 +204,7 @@ Once expired, an Access Token can no longer be used to access an API. In order t Obtaining a new Access Token can be done by repeating the authentication flow, used to obtain the initial Access Token. In a SPA this is not ideal, as you may not want to redirect the user away from their current task to complete the authentication flow again. -In cases like this you can make use of [Silent Authentication](/api-auth/tutorials/silent-authentication). Silent authentication lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. This does however require that the user was already logged in via [SSO (Single Sign-On)](/sso). +In cases like this you can make use of [Silent Authentication](/api-auth/tutorials/silent-authentication). Silent authentication lets you perform an authentication flow where Auth0 will only reply with redirects, and never with a login page. This does however require that the user was already logged in via [Single Sign-on (SSO)](/sso). ::: note See the implementation in [Angular 2](/architecture-scenarios/application/spa-api/spa-implementation-angular2#6-renew-the-access-token) diff --git a/articles/architecture-scenarios/spa-api/part-4.md b/articles/architecture-scenarios/spa-api/part-4.md index 21ca56606e..22be4254af 100644 --- a/articles/architecture-scenarios/spa-api/part-4.md +++ b/articles/architecture-scenarios/spa-api/part-4.md @@ -16,7 +16,7 @@ useCase: # SPA + API: Conclusion -In this document we covered a simple scenario involving an API used by a Single Page Application (SPA) to allow employees to capture their timesheets. +In this document we covered a simple scenario involving an API used by a Single-Page Application (SPA) to allow employees to capture their timesheets. We learned about the Implicit Grant, what an Access Token is, how to configure an API in Auth0, how to configure a SPA application to communicate securely with this API, how to define and secure our API endpoints, how to use the provided libraries to validate the Access Token and how to retrieve a new one from Auth0. diff --git a/articles/architecture-scenarios/spa-api/spa-implementation-angular2.md b/articles/architecture-scenarios/spa-api/spa-implementation-angular2.md index 19e0f142ee..6d695de9a7 100644 --- a/articles/architecture-scenarios/spa-api/spa-implementation-angular2.md +++ b/articles/architecture-scenarios/spa-api/spa-implementation-angular2.md @@ -134,7 +134,7 @@ export class AuthService { The service includes several methods for handling authentication. -- __login__: calls `authorize` from auth0.js which initiates [Universal Login](/hosted-pages/login) +- __login__: calls `authorize` from auth0.js which initiates [Universal Login](/universal-login) - __handleAuthentication__: looks for an authentication result in the URL hash and processes it with the `parseHash` method from auth0.js - __setSession__: sets the user's Access Token, ID Token, and a time at which the Access Token will expire - __logout__: removes the user's tokens from browser storage @@ -142,7 +142,7 @@ The service includes several methods for handling authentication. ### Process the Authentication Result -When a user authenticates via Universal Login and is then redirected back to your application, their authentication information will be contained in a URL hash fragment. The `handleAuthentication` method in the `AuthService` is responsibile for processing the hash. +When a user authenticates via Universal Login and is then redirected back to your application, their authentication information will be contained in a URL hash fragment. The `handleAuthentication` method in the `AuthService` is responsible for processing the hash. Call `handleAuthentication` in your app's root component so that the authentication hash fragment can be processed when the app first loads after the user is redirected back to it. @@ -275,7 +275,7 @@ During the authorization process we already stored the actual scopes which a use If the `scope` returned in `authResult` is issued is empty, it means the user was granted all the scopes that were requested, and we can therefore use the requested scopes to determine the scopes granted to the user. -Here is the code we wroter earlier for the `setSession` function that does that check: +Here is the code we wrote earlier for the `setSession` function that does that check: ```js private setSession(authResult): void { @@ -310,7 +310,7 @@ export class AuthService { } ``` -You can call this method to determine whether we should display a specific UI element, or not. As an example we only want to display the **Approve Timesheets** link if the user has the `approve:timesheets` scope. Note in the code below that we added a call to the `userHasScopes` function to deteremine whether that link should be displayed or not. +You can call this method to determine whether we should display a specific UI element, or not. As an example we only want to display the **Approve Timesheets** link if the user has the `approve:timesheets` scope. Note in the code below that we added a call to the `userHasScopes` function to determine whether that link should be displayed or not. ```html
    diff --git a/articles/integrations/integrating-auth0-amazon-cognito-mobile-apps.md b/articles/integrations/integrating-auth0-amazon-cognito-mobile-apps.md index 0fc80041b1..77803499d1 100644 --- a/articles/integrations/integrating-auth0-amazon-cognito-mobile-apps.md +++ b/articles/integrations/integrating-auth0-amazon-cognito-mobile-apps.md @@ -1,5 +1,5 @@ --- -description: How to integrate Auth0 with Amazon Cognito using an OpenID Connect Provider. +description: How to integrate Auth0 with Amazon Cognito using an OpenID Connect (OIDC) Provider. topics: - integrations - amazon @@ -12,13 +12,13 @@ useCase: integrate-saas-sso **Amazon Cognito** is a backend as a service that lets you focus on writing a fantastic user experience for your application (native or web). -This document will explain how you can integrate your app with two solutions: Auth0 to get authentication with either [Social Providers](/identityproviders#social) (Facebook, Twitter, and so on), [Enterprise providers](/identityproviders#enterprise) or regular Username and Password, and [Amazon Cognito](http://aws.amazon.com/cognito/), to get a backend for your app without writing a line of code. +This document will explain how you can integrate your app with two solutions: Auth0 to get authentication with either [Social Providers](/connections/identity-providers-social) (Facebook, Twitter, and so on), [Enterprise providers](/connections/identity-providers-enterprise) or regular Username and Password, and [Amazon Cognito](http://aws.amazon.com/cognito/), to get a backend for your app without writing a line of code. ## Configure Amazon Web Services ### Create a new OpenID Connect Provider -The first step is to create an OpenID Connect Provider pointing to your Auth0 account. Please take a note of your Auth0 **domain** (`${account.namespace}`) and your **applicationId** these values can be found in the [Settings of your chosen Application](${manage_url}/#/clients/). These values will be used to create the Identity Pool in the [IAM Console](https://console.aws.amazon.com/iam/home). +The first step is to create an OpenID Connect (OIDC) Provider pointing to your Auth0 account. Please take a note of your Auth0 **domain** (`${account.namespace}`) and your **applicationId** these values can be found in the [Settings of your chosen Application](${manage_url}/#/clients/). These values will be used to create the Identity Pool in the [IAM Console](https://console.aws.amazon.com/iam/home). 1. In the [IAM Console](https://console.aws.amazon.com/iam/home) click on the **Identity Providers** link in the left sidebar. Click the **Create Provider** button. @@ -64,7 +64,7 @@ Now, you need to create an Identity Pool in the [Cognito Console](https://consol ![Confirmation page](/media/articles/scenarios/amazon-cognito/allow-role.png) -1. Click **Edit Identity Pool** to view the the Identity Pool ID. +1. Click **Edit Identity Pool** to view the Identity Pool ID. ![View the Identity Pool ID](/media/articles/scenarios/amazon-cognito/pool-id.png) @@ -74,7 +74,7 @@ Now, you need to create an Identity Pool in the [Cognito Console](https://consol ## Auth0 Configuration -Amazon will use the public signing key from the [OpenID Provider Metadata](https://subscription.auth0.com/.well-known/jwks.json) to validate the signature of the JSON Web Token. +Amazon will use the public signing key from the [OpenID Provider Metadata](https://subscription.auth0.com/.well-known/jwks.json) to validate the signature of the JSON Web Token (JWT). By default Auth0 will use the HS256 signature algorithm which is not supported in this scenario (this will result in "Invalid login token" errors). Go to your application in the [dashboard](${manage_url}/#/applications), click the **Show Advanced Settings** link and then **OAuth** and change the algorithm to **RS256**. @@ -82,7 +82,7 @@ By default Auth0 will use the HS256 signature algorithm which is not supported i ## Implementation -You can use [Auth0 Lock](https://github.com/auth0/lock) to log the user in. You can read detailed instructions on how to implement Lock in [the libraries documentation](/libraries#lock-login-signup-widgets). +You can use Auth0 Lock to log the user in. You can read detailed instructions on how to implement Lock in [the libraries documentation](/libraries#lock-login-signup-widgets). Once the user is successfully logged in with Auth0, the next step is to send their credentials to Amazon Cognito [see the Cognito docs](http://docs.aws.amazon.com/cognito/latest/developerguide/open-id.html) to see how to implement this with depending on the platform. @@ -109,6 +109,6 @@ dataset.synchronize() ## Keep reading ::: next-steps -* [Amazon Cognito: Open ID Connect Providers](http://docs.aws.amazon.com/cognito/latest/developerguide/open-id.html) +* [Amazon Cognito: OpenID Connect Providers](http://docs.aws.amazon.com/cognito/latest/developerguide/open-id.html) * [Amazon IAM: Creating OpenID Connect (OIDC) Identity Providers](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html) ::: diff --git a/articles/integrations/marketing/adobe-campaign/index.md b/articles/integrations/marketing/adobe-campaign/index.md index bd02d52a99..9e1dcd8e58 100644 --- a/articles/integrations/marketing/adobe-campaign/index.md +++ b/articles/integrations/marketing/adobe-campaign/index.md @@ -1,25 +1,20 @@ --- -title: Adobe Campaign Integration -description: Learn how to import your Auth0 user data into Adobe Campaign. +title: Export User Data To Adobe Campaign +description: Learn how to export your Auth0 user data and import it into Adobe Campaign. toc: true topics: - marketing - adobe - adobe-campaign contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Adobe Campaign Integration +# Export User Data To Adobe Campaign -## Import Users to Adobe Campaign +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into Adobe Campaign with the [Adobe Campaign Import Wizard](https://docs.campaign.adobe.com/doc/AC/en/PTF_Importing_and_exporting_data_Importing_data.html). -To import your Auth0 users into Adobe Campaign: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file into Adobe Campaign with the [Adobe Campaign Import Wizard](https://docs.campaign.adobe.com/doc/AC/en/PTF_Importing-Exporting_data_About_generic_import_and_export.html). - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -40,10 +35,10 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note -[Adobe Campaign Documentation: Importing Data](https://docs.campaign.adobe.com/doc/AC/en/PTF_Importing-Exporting_data_Importing_data.html) +[Adobe Campaign Documentation: Importing Data](https://docs.adobe.com/content/help/en/campaign-classic/using/getting-started/importing-and-exporting-data/importing-data.html) ::: Log in to your Adobe Campaign client dashboard and navigate to **Profiles and Targets > Jobs**. Create a new import job by clicking the **Create** button and selecting **New Import**. @@ -58,20 +53,14 @@ Description | A brief description of the job. Import type | Set to `Simple import` for single file imports and `Multiple import` for multiple file imports. Folder | Select the folder to save the import file to. -![Adobe Campaign Import Wizard Template Selection](/media/articles/integrations/marketing/adobe-campaign/template-selection.png) - Once you've configured your import parameters, click the **Next** button to continue. On the **File to Import** step upload the user data CSV file you exported from Auth0 in the previous section. Click the **Next** button to proceed to **Field Mapping**. Next, map the export file schema to your Adobe Campaign database schema. Check that the field names and field types are correct, then click the **Next** button. -![Adobe Campaign Import Wizard Field Mapping](/media/articles/integrations/marketing/adobe-campaign/field-mapping.png) - Complete the remaining configuration steps by defining your data reconciliation mode and selecting a folder, list, or service for the users being imported. Finally, begin the import by clicking the **Start** button on the **Data Import Execution** window. -![Adobe Campaign Import Wizard Data Import Execution](/media/articles/integrations/marketing/adobe-campaign/import-execution.png) - That's it! You successfully imported your Auth0 users into Adobe Campaign. diff --git a/articles/integrations/marketing/alterian/index.md b/articles/integrations/marketing/alterian/index.md index e2cc5e03b9..5f39fbdff9 100644 --- a/articles/integrations/marketing/alterian/index.md +++ b/articles/integrations/marketing/alterian/index.md @@ -1,24 +1,19 @@ --- -title: Alterian Integration -description: Learn how to import your Auth0 user data into Alterian. +title: Export User Data To Alterian +description: Learn how to export your Auth0 user data and import it into Alterian. toc: true topics: - marketing - alterian contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Alterian Integration +# Export User Data To Alterian -## Import Users to Alterian +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into Alterian with the campaign manager's data import tool. -To import your Auth0 users into Alterian: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file into Alterian with the Campaign Manager's Data Import tool. - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -39,7 +34,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note [Alterian Campaign Manager: Data Import](http://cm.help.alterian.com/CM404/Default.htm#Customer_Analytics/Import_Export/Data_Import.htm) @@ -61,6 +56,6 @@ To import your CSV file into Alterian, follow these steps: ![Data Import: New Imports](/media/articles/integrations/marketing/alterian/new-data-imports.png) -7. After you've reviewed your settings, click **Run Processess**. +7. After you've reviewed your settings, click **Run Processes**. That's it! You successfully imported your Auth0 users into Alterian. diff --git a/articles/integrations/marketing/constant-contact/index.md b/articles/integrations/marketing/constant-contact/index.md index d64ebe4db7..55048e1ca4 100644 --- a/articles/integrations/marketing/constant-contact/index.md +++ b/articles/integrations/marketing/constant-contact/index.md @@ -1,24 +1,19 @@ --- -title: Constant Contact Integration -description: Learn how to import your Auth0 user data into Constant Contact. +title: Export User Data To Constant Contact +description: Learn how to export your Auth0 user data and import it into Constant Contact. toc: true topics: - marketing - constant-contact contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Constant Contact Integration +# Export User Data To Constant Contact -## Import Users to Constant Contact +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into the Constant Contact dashboard. -To import your Auth0 users into Constant Contact: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file on the Constant Contact dashboard. - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -39,7 +34,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note [Constant Contact Knowledge Base: Import or Upload a File of Contact Email Addresses](https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5296-import-or-upload-a-file-of-contact-email-addresses) diff --git a/articles/integrations/marketing/eloqua/index.md b/articles/integrations/marketing/eloqua/index.md index 7dda713e79..7b3e3bad71 100644 --- a/articles/integrations/marketing/eloqua/index.md +++ b/articles/integrations/marketing/eloqua/index.md @@ -1,25 +1,20 @@ --- -title: Oracle Eloqua Integration -description: Learn how to import your Auth0 user data into Eloqua. +title: Export User Data To Oracle Eloqua +description: Learn how to export your Auth0 user data and import it into Oracle Eloqua. toc: true topics: - marketing - eloqua - oracle contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Oracle Eloqua Integration +# Export User Data To Oracle Eloqua -## Import Users to Eloqua +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into Eloqua with the contact upload wizard. -To import your Auth0 users into Eloqua: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file using Oracl Eloqua's contact upload wizard. - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -40,7 +35,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note [Oracle Eloqua Help Center: Uploading Contacts](https://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAA/index.html#Help/Contacts/Tasks/UploadingContacts.htm) diff --git a/articles/integrations/marketing/index.md b/articles/integrations/marketing/index.md index fde0d1ef7f..b562fe8e1b 100644 --- a/articles/integrations/marketing/index.md +++ b/articles/integrations/marketing/index.md @@ -1,16 +1,16 @@ --- classes: topic-page -title: Marketing Integrations -description: Learn how to integrate Auth0 with marketing applications and services. +title: Export User Data To Marketing Tools +description: Learn how to export Auth0 user data to marketing applications and services. topics: - marketing contentType: index -useCase: integrate-marketing +useCase: export-users-marketing ---
    -

    Marketing Integrations

    +

    Export User Data To Marketing Tools

    The better the data, the better the marketing campaign. With Auth0 you can provide user data for your marketing tools to personalize marketing and increase user engagement. Take a look below for tutorials to get started!

    diff --git a/articles/integrations/marketing/mailchimp/index.md b/articles/integrations/marketing/mailchimp/index.md index d1f1ad008c..6b9c68dafc 100644 --- a/articles/integrations/marketing/mailchimp/index.md +++ b/articles/integrations/marketing/mailchimp/index.md @@ -1,24 +1,19 @@ --- -title: MailChimp Integration -description: Learn how to import your Auth0 user data into MailChimp. +title: Export User Data To MailChimp +description: Learn how to export your Auth0 user data and import it into MailChimp. toc: true topics: - marketing - mailchimp contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# MailChimp Integration +# Export User Data To MailChimp -## Import Users to MailChimp +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into the [MailChimp dashboard](https://login.mailchimp.com/). -To import your Auth0 users into MailChimp: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file into MailChimp on the [MailChimp Dashboard](https://login.mailchimp.com/). - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -43,7 +38,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note [MailChimp Knowledge Base: Import Subscribers to a List](https://kb.mailchimp.com/lists/growth/import-subscribers-to-a-list) diff --git a/articles/integrations/marketing/marketo/index.md b/articles/integrations/marketing/marketo/index.md index 53b54291d5..4df61e62c9 100644 --- a/articles/integrations/marketing/marketo/index.md +++ b/articles/integrations/marketing/marketo/index.md @@ -1,24 +1,19 @@ --- -title: Marketo Integration -description: Learn how to import your Auth0 user data into Marketo. +title: Export User Data To Marketo +description: Learn how to export your Auth0 user data and import it into Marketo. toc: true topics: - marketing - marketo contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Marketo Integration +# Export User Data To Marketo -## Import Users to Marketo +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into Marketo using the [Bulk Leads endpoint](http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#/Bulk_Leads) of the Marketo REST API. -To import your Auth0 users into Marketo: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file into Marketo using the [Bulk Leads endpoint](http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#/Bulk_Leads) of the Marketo REST API. - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -39,7 +34,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +### Import a user data file ::: note [Marketo Documentation: Bulk Lead Import](http://developers.marketo.com/rest-api/bulk-import/bulk-lead-import/) diff --git a/articles/integrations/marketing/sailthru/index.md b/articles/integrations/marketing/sailthru/index.md index 2456ccec12..c4eaeb32a1 100644 --- a/articles/integrations/marketing/sailthru/index.md +++ b/articles/integrations/marketing/sailthru/index.md @@ -1,24 +1,19 @@ --- -title: Sailthru Integration -description: Learn how to import your Auth0 user data into Sailthru. +title: Export User Data To Sailthru +description: Learn how to export your Auth0 user data and import it into Sailthru. toc: true topics: - marketing - sailthru contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Sailthru Integration +# Export User Data To Sailthru -## Import Users to Sailthru +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into the Sailthru dashboard. -To import your Auth0 users into Sailthru: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file to a list on your Sailthru dashboard. - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -39,7 +34,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +### Import a user data file ::: note [Sailthru Documentation: Adding Users to Sailthru and Sailthru Lists](https://getstarted.sailthru.com/audience/managing-users/add-users-to-sailthru-and-lists/#List_File_Upload) diff --git a/articles/integrations/marketing/salesforce-marketing-cloud/index.md b/articles/integrations/marketing/salesforce-marketing-cloud/index.md index b2ae6fc2e2..95a203e3a0 100644 --- a/articles/integrations/marketing/salesforce-marketing-cloud/index.md +++ b/articles/integrations/marketing/salesforce-marketing-cloud/index.md @@ -1,25 +1,20 @@ --- -title: Salesforce Marketing Cloud Integration -description: Learn how to import your Auth0 user data into Salesforce Marketing Cloud. +title: Export User Data To Salesforce Marketing Cloud +description: Learn how to export your Auth0 user data and import it into Salesforce Marketing Cloud. toc: true topics: - marketing - salesforce - marketing-cloud contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Salesforce Marketing Cloud Integration +# Export User Data To Salesforce Marketing Cloud -## Import Users to Salesforce Marketing Cloud +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into Salesforce Marketing Cloud using [Email Studio](https://help.salesforce.com/articleView?id=mc_es_get_started_with_email_studio.htm&type=5). -To import your Auth0 users into Salesforce Marketing Cloud: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file into Salesforce Marketing Cloud using [Email Studio](https://help.marketingcloud.com/en/documentation/exacttarget/getting_started/). - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -40,7 +35,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note [Email Studio: Import Subscribers](https://help.marketingcloud.com/en/documentation/exacttarget/subscribers/subscribers_for_interactive_marketing_hub/imports/importing_subscribers/) diff --git a/articles/integrations/marketing/salesforce/index.md b/articles/integrations/marketing/salesforce/index.md index e9cf91703e..586964c0f1 100644 --- a/articles/integrations/marketing/salesforce/index.md +++ b/articles/integrations/marketing/salesforce/index.md @@ -1,24 +1,19 @@ --- -title: Salesforce Integration -description: Learn how to import your Auth0 user data into Salesforce. +title: Export User Data To Salesforce +description: Learn how to export your Auth0 user data and import it into Salesforce. toc: true topics: - marketing - salesforce contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Salesforce Integration +# Export User Data To Salesforce -## Import Users to Salesforce +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into Salesforce using the [Data Import Wizard](https://help.salesforce.com/articleView?id=data_import_wizard.htm). -To import your Auth0 users into Salesforce: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file into Salesforce using the [Data Import Wizard](https://help.salesforce.com/articleView?id=data_import_wizard.htm). - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -43,7 +38,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note [Salesforce: Import Data with the Data Import Wizard](https://help.salesforce.com/articleView?id=import_with_data_import_wizard.htm) diff --git a/articles/integrations/marketing/watson-campaign-automation/index.md b/articles/integrations/marketing/watson-campaign-automation/index.md index 646e6a5078..5f65f357ce 100644 --- a/articles/integrations/marketing/watson-campaign-automation/index.md +++ b/articles/integrations/marketing/watson-campaign-automation/index.md @@ -1,24 +1,19 @@ --- -title: Watson Campaign Automation Integration -description: Learn how to import your Auth0 user data into Watson Campaign Automation. +title: Export User Data To Watson Campaign Automation +description: Learn how to export your Auth0 user data and import it into Watson Campaign Automation. toc: true topics: - marketing - watson-campaign contentType: how-to -useCase: integrate-marketing +useCase: export-users-marketing --- -# Watson Campaign Automation Integration +# Export User Data To Watson Campaign Automation -## Import Users to Watson Campaign Automation +In this article, you’ll learn how to export user data in Auth0 to a CSV file then import it into the Watson Campaign Automation dashboard. -To import your Auth0 users into Watson Campaign Automation: - -- Export your user data as a CSV file with the [User Import / Export Extension](/extensions/user-import-export). -- Import the file (database) on your Watson Campaign Automation dashboard. - -### Create a User Data File +## Create a user data file Start by navigating to the [Extensions](${manage_url}/#/extensions) section of the Dashboard and open the **User Import / Export Extension**. On the extension page, select **Export** from the menu. @@ -43,7 +38,7 @@ User Field | Column Name After adding the user fields, click on the **Export Users** button to start the export. Once the export is complete, download the CSV file to use in the following section. -### Import a User Data File +## Import a user data file ::: note [Watson Campaign Automation: About importing a database](https://www.ibm.com/support/knowledgecenter/en/SSWU4L/Data/imc_Data/Import_a_Database.html) diff --git a/articles/integrations/office-365-custom-provisioning.md b/articles/integrations/office-365-custom-provisioning.md index 52f44e43f9..cddf7399d4 100644 --- a/articles/integrations/office-365-custom-provisioning.md +++ b/articles/integrations/office-365-custom-provisioning.md @@ -12,9 +12,9 @@ useCase: integrate-saas-sso # Office 365 Custom Provisioning -The default Office 365 setup will include Active Directory and DirSync/Azure AD Sync Services to synchronize and provision your AD users in Azure AD for SSO. Auth0 will then be configured to be an identity provider which is providing SSO for these users. +The default Office 365 setup will include Active Directory and DirSync/Azure AD Sync Services to synchronize and provision your AD users in Azure AD for SSO. Auth0 will then be configured to be an identity provider which is providing Single Sign-on (SSO) for these users. -All of this is fine when you want SSO for your own users living in your AD. But for scenarios where you want to allow contractors, partners or even customers to access your Office 365 environment (eg: SharePoint) this approach is not optimal since these users would need to be created in your own AD environment. This is why Auth0 allows custom provisioning of Azure AD users from our rules. This would allow you to create users in Azure AD (and effectively Office 365) just as they login from any connection available in Auth0 (in that case your rule will take over DirSync's task for any type of connection where DirSync would not work). This will allow you to offer Facebook, LinkedIn, Google Apps, ... logins to your Office 365 environment. +All of this is fine when you want SSO for your own users living in your AD. But for scenarios where you want to allow contractors, partners or even customers to access your Office 365 environment (eg: SharePoint) this approach is not optimal since these users would need to be created in your own AD environment. This is why Auth0 allows custom provisioning of Azure AD users from our rules. This would allow you to create users in Azure AD (and effectively Office 365) just as they login from any connection available in Auth0 (in that case your rule will take over DirSync's task for any type of connection where DirSync would not work). This will allow you to offer Facebook, LinkedIn, G Suite, ... logins to your Office 365 environment. ## Configuring Office 365 @@ -47,14 +47,14 @@ The following rule shows the provisioning process: 1. If the user comes from the AD connection, skip the provisioning process (because this will be handled by DirSync) 2. If the user was already provisioned in Azure AD, just continue with the login transaction. - 3. Get an Access Token of the Graph API using the Azure AD Client ID and Key + 3. Get an Access Token of the Graph API using the Azure AD Client ID and Key 4. Create a user in Azure AD 5. Assign a license to the user. 6. Continue with the login transaction. The username is generated with the `createAzureADUser` function, which by default generates a username in the format `auth0-c3fb6eec-3afd-4d52-8e0a-d9f357dd19ab@fabrikamcorp.be`. You can change this to whatever you like, just make sure this value is unique for all your users. -Make sure you set the correct values for the `AUTH0_OFFICE365_CLIENT_ID`, `AAD_CUSTOM_DOMAIN`, `AAD_DOMAIN`, `AAD_APPLICATION_ID` and `AAD_APPLICATION_API_KEY` values in the rule code. +Make sure you set the correct values for the `AUTH0_OFFICE365_CLIENT_ID`, `AAD_CUSTOM_DOMAIN`, `AAD_DOMAIN`, `AAD_APPLICATION_ID` and `AAD_APPLICATION_API_KEY` values in your [configuration object](/rules/current#use-the-configuration-object) to make the values available in your rule code. In the code you'll also see that the rule will wait about 15 seconds after the user is provisioned. This is because it takes a few seconds before the provisioned user is available for Office 365. @@ -72,15 +72,15 @@ function (user, context, callback) { // You can get it from the URL when editing the SSO integration, // it will look like // https://manage.auth0.com/#/externalapps/{the_client_id}/settings - var AUTH0_OFFICE365_CLIENT_ID = 'CLIENT_ID_OF_MY_THIRD_PARTY_APP_IN_AUTH0'; + var AUTH0_OFFICE365_CLIENT_ID = configuration.AUTH0_OFFICE365_CLIENT_ID; // The main domain of our company. var YOUR_COMPANY_DOMAIN = 'mycompanyurl.com'; // Your Azure AD domain. - var AAD_DOMAIN = 'mycompanyurl.onmicrosoft.com'; + var AAD_DOMAIN = configuration.AAD_DOMAIN; // The Application ID generated while creating the Azure AD app. - var AAD_APPLICATION_ID = 'fc885c73-ce83-4d1e-9fo3-kako45460489'; + var AAD_APPLICATION_ID = configuration.AAD_APPLICATION_ID; // The generated API key for the Azure AD app. - var AAD_APPLICATION_API_KEY = 'ZqnwPIsiMP07Wz7AQkx0RsD7mYTElny1tpKot8lizE9='; + var AAD_APPLICATION_API_KEY = configuration.AAD_APPLICATION_API_KEY; // The location of the users that are going to access Microsoft products. var AAD_USAGE_LOCATION = 'US'; // Azure AD doesn't recognize the user instantly, it needs a few seconds @@ -227,7 +227,7 @@ function (user, context, callback) { } // After provisioning the user and giving a license to them, we record - // (on Auth) that this Google Apps user has already been provisioned. We + // (on Auth) that this G Suite user has already been provisioned. We // also record the user's principal username and immutableId to properly // redirect them on future logins. function saveUserMetadata() { diff --git a/articles/integrations/office-365.md b/articles/integrations/office-365.md index 02002afcd1..03c17657ba 100644 --- a/articles/integrations/office-365.md +++ b/articles/integrations/office-365.md @@ -10,7 +10,7 @@ useCase: integrate-saas-sso --- # Office 365 Integration -Auth0 can help radically simplify the authentication process for Office 365. In this tutorial, you'll learn how to add Single Sign On (SSO) to Office 365 using Auth0. +Auth0 can help radically simplify the authentication process for Office 365. In this tutorial, you'll learn how to add Single Sign-on (SSO) to Office 365 using Auth0. ## Why use Auth0 for Office 365 @@ -30,7 +30,7 @@ Office 365 uses Azure AD as an identity store which supports different account m 1. **Cloud Identity**: Users are created in the cloud (Office 365/Azure AD) with no relation to an on-premises directory. Authentication happens with Azure AD. 2. **Synchronized Identity**: Users are synchronized from an on-premises LDAP directory (like Active Directory) to Azure AD. This means the user management can happen on-premises but authentication will always happen in the cloud using Azure AD. -3. **Federated Identity**: Users are synchronized from an on-premises LDAP directory (like Active Directory) to Azure AD. In this case Azure AD will act as the user store, but authentication will happen with a SAML 2.0 identity provider configured by the customer. This can be an ADFS server, Shibboleth, or in our case, Auth0. With this third model you can add SSO support to Office 365. +3. **Federated Identity**: Users are synchronized from an on-premises LDAP directory (like Active Directory) to Azure AD. In this case Azure AD will act as the user store, but authentication will happen with a SAML 2.0 identity provider configured by the customer. This can be an ADFS server, Shibboleth, or in our case, Auth0. With this third model you can add SSO support to Office 365. This means that even if you use Auth0 for SSO support in Office 365, you will always need to synchronize your on-premises users to Office 365/Azure AD because it will be used as a user store (for user information, assigning licenses to those users, and so on.). @@ -165,19 +165,23 @@ You will need the `YOUR_CLIENT_ID` part of the segment. 2. Go to the **Rules** section and create a new rule. Start from the **Empty** template, name it `Set Issuer for Office 365 SSO Integration` and write code similar to this to set the issuer according to the domain of the user's email: -```JavaScript +```js function (user, context, callback) { - const office365ClientId = 'xxxxxx'; // put the right client id + // retrieve values from the configuration object + const office365ClientId = configuration.OFFICE365_CLIENT_ID; // put the right client id + const primaryDomain = configuration.PRIMARY_DOMAIN; // for example, exampleco.com + const secondaryDomain = configuration.SECONDARY_DOMAIN; + if (context.clientID !== office365ClientId) return callback(null, user, context); var getIssuerURI = function(domain) { // write code that returns the right issuer URI // for each domain - if (domain === 'fabrikam.be') { - return 'urn:fabrikam.be'; - } else if (domain === 'contoso.com') { - return 'urn:contoso.com'; + if (domain === primaryDomain) { + return 'urn:' + primaryDomain; + } else if (domain === secondaryDomain) { + return 'urn:' + secondaryDomain; } return null; } diff --git a/articles/integrations/sharepoint-apps.md b/articles/integrations/sharepoint-apps.md index 37ab911427..54666c43c3 100644 --- a/articles/integrations/sharepoint-apps.md +++ b/articles/integrations/sharepoint-apps.md @@ -8,7 +8,7 @@ useCase: integrate-saas-sso --- # Connecting Provider Hosted Apps to SharePoint Online -Auth0 can help radically simplify the authentication process for SharePoint Apps. Auth0 will negotiate an Access Token you can the use to call SharePoint APIs. +Auth0 can help radically simplify the authentication process for SharePoint Apps. Auth0 will negotiate an Access Token you can the use to call SharePoint APIs. You won't need any special libraries. You can use any of the SDKs supported by Auth0. @@ -46,7 +46,7 @@ Since Auth0 is in between your app and the Office 365 infrastructure, you need t * `connection` is just the name you will use in Auth0's connections (such as "sharepoint"). * `client_id` identifies your app in Auth0 (created in steps 1). -* `redirect_uri` is the location in your actual app, where your users will land eventually after all negotiations complete. If you don't specify it, it will always be the app's callback URL defined in Auth0 (it could be localhost) +* `redirect_uri` is the location in your actual app, where your users will land eventually after all negotiations complete. If you don't specify it, it will always be the app's callback URL defined in Auth0 (it could be localhost) ### Package the app and upload to SharePoint: diff --git a/articles/integrations/sharepoint.md b/articles/integrations/sharepoint.md index 1ae1f3eefa..4870a916cb 100644 --- a/articles/integrations/sharepoint.md +++ b/articles/integrations/sharepoint.md @@ -1,5 +1,5 @@ --- -description: How to integrate with SharePoint 2010/2013, including setup, troubleshooting, acessing logs and next steps. +description: How to integrate with SharePoint 2010/2013, including setup, troubleshooting, accessing logs and next steps. topics: - integrations - sharepoint @@ -9,7 +9,7 @@ useCase: integrate-saas-sso # SharePoint 2010/2013 Integration -Auth0 can help to radically simplify the authentication process for SharePoint. In this tutorial, you'll learn how to add Single Sign On (SSO) to Sharepoint using Auth0. Your users will be able to log in using any of our [Social Identity Providers](/identityproviders) (Facebook, Twitter, Github, and so on), [Enterprise Providers](/identityproviders) (LDAP, Active Directory, ADFS, and so on) or with a username and password. +Auth0 can help to radically simplify the authentication process for SharePoint. In this tutorial, you'll learn how to add Single Sign-on (SSO) to Sharepoint using Auth0. Your users will be able to log in using any of our [Social Identity Providers](/identityproviders) (Facebook, Twitter, Github, and so on), [Enterprise Providers](/identityproviders) (LDAP, Active Directory, ADFS, and so on) or with a username and password. ## Setup @@ -79,11 +79,11 @@ Depending on which claims have been mapped when installing the claims provider t ## Customizing the Login Page -You can customize the login page by following the instructions in the [documentation on customizing the login page](/hosted-pages/login#how-to-customize-your-login-page). +You can customize the login page by following the instructions in the [documentation on customizing the login page](/universal-login#simple-customization). You might wish to provide a way to let users authenticate with Sharepoint using Windows Authentication, bypassing Auth0. You can do that by customizing the login page, adding a link to the Windows Authentication endpoint (usually similar to `https://yoursharepointserver/_windows/default.aspx?ReturnUrl=/_layouts/15/Authenticate.aspx`). -On way of doing it is by using jQuery to modify the Lock widget and add a link to the Windows Authentication endpoint. +On way of doing it is by using jQuery to modify the Lock widget and add a link to the Windows Authentication endpoint. You need to add a reference to jQuery at the top of the `` section of the customized login page. @@ -94,14 +94,43 @@ You need to add a reference to jQuery at the top of the `` section of the Before calling `lock.show()`, add code to modify the HTML DOM that adds the link. ```js -lock.on('signin ready', function() { - $('.auth0-lock-tabs-container') - .after(''); - }); +// construct Lock +// var lock = ... +[...] +// One or more SharePoint client IDs here for which you want +// a Windows Auth button +var sharepointClientIDs = ['your_sharepoint_client_id']; + +if (sharepointClientIDs.indexOf(config.clientID) >= 0) { + lock.on('signin ready', function() { + var getParameterByName = function(name) { + name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); + var regexS = "[\\?&]" + name + "=([^&#]*)"; + var regex = new RegExp(regexS); + var results = regex.exec(window.location.search); + if (results == null) return null; + else return results[1]; + }; + // get the host from the callback URL + var parser = document.createElement('a'); + parser.href = config.callbackURL; + var host = parser.host; + var windowsAuthURL = "https://" + host + "/_windows/default.aspx?ReturnUrl=/_layouts/15/Authenticate.aspx"; + var wctx = getParameterByName("wctx"); + if (wctx) { + windowsAuthURL += "&Source=" + wctx; + } + + $('.auth0-lock-tabs-container') + .after('').attr('href','https://nowhere'); + }); +} + +lock.show(); ``` ![SharePoint Login Page Windows Auth](/media/articles/integrations/sharepoint/sharepoint-login-page-windows-auth.png) @@ -140,7 +169,7 @@ When David logs in using his Azure AD account (and the Security Groups attribute ![User Groups](/media/articles/integrations/sharepoint/sharepoint-profile-groups.png) -If we want to make these groups available as Roles in SharePoint we'll need to write a [Rule](${manage_url}/#/rules) that adds this to the SAML configuration. This rule will only run for the application named **Fabrikam Intranet (SharePoint)**. +If we want to make these groups available as Roles in SharePoint we'll need to write a [Rule](${manage_url}/#/rules) that adds this to the SAML configuration. This rule will only run for the application named **Fabrikam Intranet (SharePoint)**. ``` function (user, context, callback) { diff --git a/articles/integrations/sso/_template.md b/articles/integrations/sso/_template.md index 75d772f840..3cf0d599a6 100644 --- a/articles/integrations/sso/_template.md +++ b/articles/integrations/sso/_template.md @@ -1,20 +1,22 @@ -# ${service} Single Sign On Integration +# Configure SSO Integration for ${service} + +This guide will show you how to configure an SSO integration. <% if (service === "Active Directory RMS") { %> ::: warning -The steps in this tutorial are valid for Active Directory Rights Management Services 2008 and earlier. +The steps in this guide are valid for Active Directory Rights Management Services 2008 and earlier. ::: <% } %> -The ${service} Single Sign On (SSO) Integration lets your users log in to ${service} with Auth0 [identity providers](/identityproviders), and provides SSO to [configured applications](/sso/current/setup). +The ${service} [Single Sign-on (SSO)](/sso) Integration lets you create a client application that uses Auth0 for authentication and provides SSO capabilities. Your users log in to ${service} with Auth0 [identity providers](/identityproviders), which means they perform the identity credentials verification. -## Create a New SSO Integration +## Create an SSO Integration -Navigate to [Dashboard > SSO Integrations](${manage_url}/#/externalapps) and click **+ Create New SSO Integration**. +To create a new SSO Integration, navigate to [Dashboard > SSO Integrations](https://manage.auth0.com/#/externalapps) and click **+ Create SSO Integration**. ![](/media/articles/sso/integrations/new.png) -Select the **${service}** option. +Next, select a provider. ![](/media/articles/sso/integrations/options.png) @@ -22,13 +24,16 @@ Set the name for your SSO Integration. Click **Create**. ![](/media/articles/sso/integrations/name.png) -You will be brought to the **${service} Configuration Instructions** page. We'll perform these steps in a later section. +You will be brought to the **Tutorial** page for the provider, which contains instructions on how you can complete the integration with the external services provider so that it works with Auth0 for authentication. ![](/media/articles/sso/integrations/${img}.png) -Next, click on the **Settings** tab to configure the integration's settings. +Once you're done configuring your integration, note that there are two additional tabs with additional options for you to manage: + +1. **Settings**, which will allow you to change the integration's settings +2. **Connections**, which will allow you to enable/disable the integration for the connections associated with your tenant -## Configure Settings +### Settings On the **Settings** page, configure the following values: @@ -88,6 +93,16 @@ On the **Settings** page, configure the following values: The connection to use with this integration, typically an Active Directory connection. <% } %> + <% if (service === "Sentry") { %> + + Organization Slug + The generated slug for your Sentry organization found in your URL (i.e., the slug for `https://sentry.acme.com/acme-org/` would `acme-org`. + + + Sentry URL Prefix + Your URL prefix if you're using Sentry Community Edition; otherwise, leave blank. + + <% } %> <% if (service === "Slack") { %> Team Name @@ -133,24 +148,27 @@ On the **Settings** page, configure the following values: <% } %> - Use Auth0 instead of the IdP to do single sign on - If enabled, Auth0 will handle Single Sign On instead of ${service}. + Use Auth0 instead of the IdP to do Single Sign-on (SSO). **Legacy tenants only.** + If enabled, Auth0 will handle SSO instead of ${service}. Click **Save**. -## Configure ${service} - -When you configure ${service}, refer to the **${service} Configuration Instructions** page on [Dashboard > SSO Integrations > ${service}](${manage_url}/#/externalapps/) and follow each of the steps as shown. +### Enable Connections -![](/media/articles/sso/integrations/${img}.png) +<% if (service === "Zendesk") { %> +::: warning +Zendesk **requires** that all users have an email address. When enabling Enterprise or Social connections, make sure that they will provide an email address +that can be sent to Zendesk. +::: -## Enable Connections +<% } %> +The **Connections** tab features a list of user sources available to your tenant. Your connections are organized by type (e.g., Database, Social, Enterprise, Passwordless). -Click the **Connections** tab for the integration to select which connections you want to enable for this integration. +You can choose the connections that you want used with your newly-created SSO integration; this allows the users in those connections to log in to ${service}. -## Setup Complete +## Complete Set Up -That's it! You've set up a Single Sign On integration with ${service} and Auth0. Your users can now choose this as a way to authenticate. +Once you've followed the configuration instructions in the tutorial, modified your settings (if necessary), and enabled your connection(s), you're done with setting up an SSO integration between ${service} and Auth0. diff --git a/articles/integrations/sso/ad-rms.md b/articles/integrations/sso/ad-rms.md index f1ab3e203a..c54065deb4 100644 --- a/articles/integrations/sso/ad-rms.md +++ b/articles/integrations/sso/ad-rms.md @@ -1,6 +1,6 @@ --- -title: Active Directory RMS Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Active Directory RMS and Auth0. +title: Active Directory RMS Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Active Directory RMS and Auth0. toc: true public: true topics: @@ -11,8 +11,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Active Directory RMS", - img: "ad-rms" -}) %> +<%= include('../../../snippets/sso-integrations/ad-rms/0') %> +<%= include('../../../snippets/sso-integrations/ad-rms/1') %> +<%= include('../../../snippets/sso-integrations/ad-rms/2') %> +<%= include('../../../snippets/sso-integrations/ad-rms/3') %> +<%= include('../../../snippets/sso-integrations/ad-rms/4') %> +<%= include('../../../snippets/sso-integrations/ad-rms/5') %> +<%= include('../../../snippets/sso-integrations/ad-rms/6') %> +<%= include('../../../snippets/sso-integrations/ad-rms/7') %> diff --git a/articles/integrations/sso/adobe-sign.md b/articles/integrations/sso/adobe-sign.md new file mode 100644 index 0000000000..ade392a1f9 --- /dev/null +++ b/articles/integrations/sso/adobe-sign.md @@ -0,0 +1,21 @@ +--- +title: Adobe Sign Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Adobe Sign and Auth0. +toc: true +public: true +topics: + - sso + - adobe + - sign + - echosign +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/adobe-sign/0') %> +<%= include('../../../snippets/sso-integrations/adobe-sign/1') %> +<%= include('../../../snippets/sso-integrations/adobe-sign/2') %> +<%= include('../../../snippets/sso-integrations/adobe-sign/3') %> +<%= include('../../../snippets/sso-integrations/adobe-sign/4') %> +<%= include('../../../snippets/sso-integrations/adobe-sign/5') %> +<%= include('../../../snippets/sso-integrations/adobe-sign/6') %> +<%= include('../../../snippets/sso-integrations/adobe-sign/7') %> diff --git a/articles/integrations/sso/box.md b/articles/integrations/sso/box.md index e5bfe1ddf2..808a65ec41 100644 --- a/articles/integrations/sso/box.md +++ b/articles/integrations/sso/box.md @@ -1,6 +1,6 @@ --- -title: Box Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Box and Auth0. +title: Box Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Box and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Box", - img: "box" -}) %> +<%= include('../../../snippets/sso-integrations/box/0') %> +<%= include('../../../snippets/sso-integrations/box/1') %> +<%= include('../../../snippets/sso-integrations/box/2') %> +<%= include('../../../snippets/sso-integrations/box/3') %> +<%= include('../../../snippets/sso-integrations/box/4') %> +<%= include('../../../snippets/sso-integrations/box/5') %> +<%= include('../../../snippets/sso-integrations/box/6') %> +<%= include('../../../snippets/sso-integrations/box/7') %> \ No newline at end of file diff --git a/articles/integrations/sso/cisco-webex.md b/articles/integrations/sso/cisco-webex.md new file mode 100644 index 0000000000..2619fcdd71 --- /dev/null +++ b/articles/integrations/sso/cisco-webex.md @@ -0,0 +1,19 @@ +--- +title: Cisco WebEx Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Cisco WebEx and Auth0. +toc: true +public: true +topics: + - sso + - cisco-webex +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/cisco-webex/0') %> +<%= include('../../../snippets/sso-integrations/cisco-webex/1') %> +<%= include('../../../snippets/sso-integrations/cisco-webex/2') %> +<%= include('../../../snippets/sso-integrations/cisco-webex/3') %> +<%= include('../../../snippets/sso-integrations/cisco-webex/4') %> +<%= include('../../../snippets/sso-integrations/cisco-webex/5') %> +<%= include('../../../snippets/sso-integrations/cisco-webex/6') %> +<%= include('../../../snippets/sso-integrations/cisco-webex/7') %> diff --git a/articles/integrations/sso/cloudbees.md b/articles/integrations/sso/cloudbees.md index 76a44eaef4..912c641323 100644 --- a/articles/integrations/sso/cloudbees.md +++ b/articles/integrations/sso/cloudbees.md @@ -1,6 +1,6 @@ --- -title: CloudBees Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with CloudBees and Auth0. +title: CloudBees Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with CloudBees and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "CloudBees", - img: "cloudbees" -}) %> +<%= include('../../../snippets/sso-integrations/cloudbees/0') %> +<%= include('../../../snippets/sso-integrations/cloudbees/1') %> +<%= include('../../../snippets/sso-integrations/cloudbees/2') %> +<%= include('../../../snippets/sso-integrations/cloudbees/3') %> +<%= include('../../../snippets/sso-integrations/cloudbees/4') %> +<%= include('../../../snippets/sso-integrations/cloudbees/5') %> +<%= include('../../../snippets/sso-integrations/cloudbees/6') %> +<%= include('../../../snippets/sso-integrations/cloudbees/7') %> diff --git a/articles/integrations/sso/concur.md b/articles/integrations/sso/concur.md index cbde7aa53b..96a7527cca 100644 --- a/articles/integrations/sso/concur.md +++ b/articles/integrations/sso/concur.md @@ -1,6 +1,6 @@ --- -title: Concur Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Concur and Auth0. +title: Concur Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Concur and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Concur", - img: "concur" -}) %> +<%= include('../../../snippets/sso-integrations/concur/0') %> +<%= include('../../../snippets/sso-integrations/concur/1') %> +<%= include('../../../snippets/sso-integrations/concur/2') %> +<%= include('../../../snippets/sso-integrations/concur/3') %> +<%= include('../../../snippets/sso-integrations/concur/4') %> +<%= include('../../../snippets/sso-integrations/concur/5') %> +<%= include('../../../snippets/sso-integrations/concur/6') %> +<%= include('../../../snippets/sso-integrations/concur/7') %> diff --git a/articles/integrations/sso/datadog.md b/articles/integrations/sso/datadog.md new file mode 100644 index 0000000000..3cf7f55a83 --- /dev/null +++ b/articles/integrations/sso/datadog.md @@ -0,0 +1,19 @@ +--- +title: Datadog Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Datadog and Auth0. +toc: true +public: true +topics: + - sso + - dropxbox +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/datadog/0') %> +<%= include('../../../snippets/sso-integrations/datadog/1') %> +<%= include('../../../snippets/sso-integrations/datadog/2') %> +<%= include('../../../snippets/sso-integrations/datadog/3') %> +<%= include('../../../snippets/sso-integrations/datadog/4') %> +<%= include('../../../snippets/sso-integrations/datadog/5') %> +<%= include('../../../snippets/sso-integrations/datadog/6') %> +<%= include('../../../snippets/sso-integrations/datadog/7') %> diff --git a/articles/integrations/sso/disqus.md b/articles/integrations/sso/disqus.md index 9ccd884a51..def0e7328a 100644 --- a/articles/integrations/sso/disqus.md +++ b/articles/integrations/sso/disqus.md @@ -1,8 +1,8 @@ --- -title: Disqus Single Sign On Integration -description: How to set up Single Sign On (SSO) integration with Disqus and Auth0. +title: Disqus Single Sign-On Integration +description: Learn how to set up Single Sign-on (SSO) integration with Disqus and Auth0. toc: true -public: true +public: false topics: - sso - disqus @@ -10,9 +10,9 @@ contentType: how-to useCase: integrate-saas-sso --- -# Disqus Single Sign On Integration +# Disqus Single Sign-On Integration -Disqus allows you to embed a discussion section onto your site where your users can enter comments and interact with you and your other visitors. By implementing a Single Sign On (SSO) integration between Disqus and Auth0, users that have signed in and authenticated via Auth0 can leave comments as themselves in your Disqus discussion section. +Disqus allows you to embed a discussion section onto your site where your users can enter comments and interact with you and your other visitors. By implementing a Single Sign-on (SSO) integration between Disqus and Auth0, users that have signed in and authenticated via Auth0 can leave comments as themselves in your Disqus discussion section. ## Install and Configure Disqus @@ -37,12 +37,12 @@ Disqus allows you to embed a discussion section onto your site where your users 5. Configure your Disqus installation by providing the requested information about your website. When done (or if you want to complete this at a later time using the *Settings* page), click **Complete Setup**. -## Enable and Configure Single Sign On with Disqus +## Enable and Configure Single Sign-on with Disqus -Once you have installed and configured your Disqus instance, you need to enable Single Sign On. +Once you have installed and configured your Disqus instance, you need to enable SSO. ::: warning -A Disqus Pro level subscription is required to use the [Disqus Single Sign-On (SSO) add-on](https://help.disqus.com/customer/portal/articles/236206-integrating-single-sign-on). +A Disqus Pro level subscription is required to use the [Disqus Single Sign-on (SSO) add-on](https://help.disqus.com/customer/portal/articles/236206-integrating-single-sign-on). ::: 1. Navigate to the [Applications section of the Disqus API](https://disqus.com/api/applications/) to register your application. diff --git a/articles/integrations/sso/dropbox.md b/articles/integrations/sso/dropbox.md index c33216a0b1..8e4f2b3105 100644 --- a/articles/integrations/sso/dropbox.md +++ b/articles/integrations/sso/dropbox.md @@ -1,6 +1,6 @@ --- -title: Dropbox Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Dropbox and Auth0. +title: Dropbox Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Dropbox and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Dropbox", - img: "dropbox" -}) %> +<%= include('../../../snippets/sso-integrations/dropbox/0') %> +<%= include('../../../snippets/sso-integrations/dropbox/1') %> +<%= include('../../../snippets/sso-integrations/dropbox/2') %> +<%= include('../../../snippets/sso-integrations/dropbox/3') %> +<%= include('../../../snippets/sso-integrations/dropbox/4') %> +<%= include('../../../snippets/sso-integrations/dropbox/5') %> +<%= include('../../../snippets/sso-integrations/dropbox/6') %> +<%= include('../../../snippets/sso-integrations/dropbox/7') %> diff --git a/articles/integrations/sso/dynamics-crm.md b/articles/integrations/sso/dynamics-crm.md index 2a15f2b2a7..70382fd3bc 100644 --- a/articles/integrations/sso/dynamics-crm.md +++ b/articles/integrations/sso/dynamics-crm.md @@ -1,6 +1,6 @@ --- -title: Microsoft Dynamics CRM Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Microsoft Dynamics CRM and Auth0. +title: Microsoft Dynamics CRM Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Microsoft Dynamics CRM and Auth0. toc: true public: true topics: @@ -10,8 +10,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Microsoft Dynamics CRM", - img: "dynamics-crm" -}) %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/0') %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/1') %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/2') %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/3') %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/4') %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/5') %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/6') %> +<%= include('../../../snippets/sso-integrations/dynamics-crm/7') %> diff --git a/articles/integrations/sso/echosign.md b/articles/integrations/sso/echosign.md deleted file mode 100644 index 36a59eea7e..0000000000 --- a/articles/integrations/sso/echosign.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: EchoSign Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Adobe EchoSign and Auth0. -toc: true -public: true -topics: - - sso - - echosign -contentType: how-to -useCase: integrate-saas-sso ---- - -<%= include('./_template', { - service: "EchoSign", - img: "echosign" -}) %> diff --git a/articles/integrations/sso/egencia.md b/articles/integrations/sso/egencia.md new file mode 100644 index 0000000000..032d4f2031 --- /dev/null +++ b/articles/integrations/sso/egencia.md @@ -0,0 +1,19 @@ +--- +title: Egencia Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Egencia and Auth0. +toc: true +public: true +topics: + - sso + - egencia +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/egencia/0') %> +<%= include('../../../snippets/sso-integrations/egencia/1') %> +<%= include('../../../snippets/sso-integrations/egencia/2') %> +<%= include('../../../snippets/sso-integrations/egencia/3') %> +<%= include('../../../snippets/sso-integrations/egencia/4') %> +<%= include('../../../snippets/sso-integrations/egencia/5') %> +<%= include('../../../snippets/sso-integrations/egencia/6') %> +<%= include('../../../snippets/sso-integrations/egencia/7') %> diff --git a/articles/integrations/sso/egnyte.md b/articles/integrations/sso/egnyte.md index eb2908e53a..fd5395bcac 100644 --- a/articles/integrations/sso/egnyte.md +++ b/articles/integrations/sso/egnyte.md @@ -1,6 +1,6 @@ --- -title: Egnyte Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Egnyte and Auth0. +title: Egnyte Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Egnyte and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Egnyte", - img: "egnyte" -}) %> +<%= include('../../../snippets/sso-integrations/egnyte/0') %> +<%= include('../../../snippets/sso-integrations/egnyte/1') %> +<%= include('../../../snippets/sso-integrations/egnyte/2') %> +<%= include('../../../snippets/sso-integrations/egnyte/3') %> +<%= include('../../../snippets/sso-integrations/egnyte/4') %> +<%= include('../../../snippets/sso-integrations/egnyte/5') %> +<%= include('../../../snippets/sso-integrations/egnyte/6') %> +<%= include('../../../snippets/sso-integrations/egnyte/7') %> diff --git a/articles/integrations/sso/eloqua.md b/articles/integrations/sso/eloqua.md new file mode 100644 index 0000000000..3c1fe2c7e2 --- /dev/null +++ b/articles/integrations/sso/eloqua.md @@ -0,0 +1,19 @@ +--- +title: Eloqua Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Eloqua and Auth0. +toc: true +public: true +topics: + - sso + - eloqua +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/eloqua/0') %> +<%= include('../../../snippets/sso-integrations/eloqua/1') %> +<%= include('../../../snippets/sso-integrations/eloqua/2') %> +<%= include('../../../snippets/sso-integrations/eloqua/3') %> +<%= include('../../../snippets/sso-integrations/eloqua/4') %> +<%= include('../../../snippets/sso-integrations/eloqua/5') %> +<%= include('../../../snippets/sso-integrations/eloqua/6') %> +<%= include('../../../snippets/sso-integrations/eloqua/7') %> diff --git a/articles/integrations/sso/freshdesk.md b/articles/integrations/sso/freshdesk.md new file mode 100644 index 0000000000..46018221fe --- /dev/null +++ b/articles/integrations/sso/freshdesk.md @@ -0,0 +1,19 @@ +--- +title: Freshdesk Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Freshdesk and Auth0. +toc: true +public: true +topics: + - sso + - freshdesk +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/freshdesk/0') %> +<%= include('../../../snippets/sso-integrations/freshdesk/1') %> +<%= include('../../../snippets/sso-integrations/freshdesk/2') %> +<%= include('../../../snippets/sso-integrations/freshdesk/3') %> +<%= include('../../../snippets/sso-integrations/freshdesk/4') %> +<%= include('../../../snippets/sso-integrations/freshdesk/5') %> +<%= include('../../../snippets/sso-integrations/freshdesk/6') %> +<%= include('../../../snippets/sso-integrations/freshdesk/7') %> diff --git a/articles/integrations/sso/github-enterprise-cloud.md b/articles/integrations/sso/github-enterprise-cloud.md new file mode 100644 index 0000000000..8ad8b8220d --- /dev/null +++ b/articles/integrations/sso/github-enterprise-cloud.md @@ -0,0 +1,19 @@ +--- +title: GitHub Enterprise Cloud Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with GitHub Enterprise Cloud and Auth0. +toc: true +public: true +topics: + - sso + - github-enterprise-cloud +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/0') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/1') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/2') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/3') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/4') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/5') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/6') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-cloud/7') %> diff --git a/articles/integrations/sso/github-enterprise-server.md b/articles/integrations/sso/github-enterprise-server.md new file mode 100644 index 0000000000..3a49e22ce5 --- /dev/null +++ b/articles/integrations/sso/github-enterprise-server.md @@ -0,0 +1,19 @@ +--- +title: GitHub Enterprise Server Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with GitHub Enterprise Server and Auth0. +toc: true +public: true +topics: + - sso + - github-enterprise-server +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/github-enterprise-server/0') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-server/1') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-server/2') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-server/3') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-server/4') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-server/5') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-server/6') %> +<%= include('../../../snippets/sso-integrations/github-enterprise-server/7') %> diff --git a/articles/integrations/sso/google-workspace.md b/articles/integrations/sso/google-workspace.md new file mode 100644 index 0000000000..b9abad69f3 --- /dev/null +++ b/articles/integrations/sso/google-workspace.md @@ -0,0 +1,19 @@ +--- +title: Google Workspace Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Google Workspace and Auth0. +toc: true +public: true +topics: + - sso + - Google Workspace +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/google-workspace/0') %> +<%= include('../../../snippets/sso-integrations/google-workspace/1') %> +<%= include('../../../snippets/sso-integrations/google-workspace/2') %> +<%= include('../../../snippets/sso-integrations/google-workspace/3') %> +<%= include('../../../snippets/sso-integrations/google-workspace/4') %> +<%= include('../../../snippets/sso-integrations/google-workspace/5') %> +<%= include('../../../snippets/sso-integrations/google-workspace/6') %> +<%= include('../../../snippets/sso-integrations/google-workspace/7') %> diff --git a/articles/integrations/sso/heroku.md b/articles/integrations/sso/heroku.md new file mode 100644 index 0000000000..9ad96804fb --- /dev/null +++ b/articles/integrations/sso/heroku.md @@ -0,0 +1,19 @@ +--- +title: Heroku Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Heroku and Auth0. +toc: true +public: true +topics: + - sso + - heroku +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/heroku/0') %> +<%= include('../../../snippets/sso-integrations/heroku/1') %> +<%= include('../../../snippets/sso-integrations/heroku/2') %> +<%= include('../../../snippets/sso-integrations/heroku/3') %> +<%= include('../../../snippets/sso-integrations/heroku/4') %> +<%= include('../../../snippets/sso-integrations/heroku/5') %> +<%= include('../../../snippets/sso-integrations/heroku/6') %> +<%= include('../../../snippets/sso-integrations/heroku/7') %> diff --git a/articles/integrations/sso/hosted-graphite.md b/articles/integrations/sso/hosted-graphite.md new file mode 100644 index 0000000000..e72168fcc7 --- /dev/null +++ b/articles/integrations/sso/hosted-graphite.md @@ -0,0 +1,19 @@ +--- +title: Hosted Graphite Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Hosted Graphite and Auth0. +toc: true +public: true +topics: + - sso + - hosted-graphite +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/hosted-graphite/0') %> +<%= include('../../../snippets/sso-integrations/hosted-graphite/1') %> +<%= include('../../../snippets/sso-integrations/hosted-graphite/2') %> +<%= include('../../../snippets/sso-integrations/hosted-graphite/3') %> +<%= include('../../../snippets/sso-integrations/hosted-graphite/4') %> +<%= include('../../../snippets/sso-integrations/hosted-graphite/5') %> +<%= include('../../../snippets/sso-integrations/hosted-graphite/6') %> +<%= include('../../../snippets/sso-integrations/hosted-graphite/7') %> diff --git a/articles/integrations/sso/index.md b/articles/integrations/sso/index.md index 4a0ba0ec71..afe2efda39 100644 --- a/articles/integrations/sso/index.md +++ b/articles/integrations/sso/index.md @@ -1,50 +1,48 @@ --- -title: Single Sign On Integrations -description: Overview of Auth0 Single Sign On (SSO) Integrations. +title: Single Sign-On Integrations +description: Learn about Auth0 Single Sign-on (SSO) Integrations. topics: - sso contentType: - - how-to - index useCase: integrate-saas-sso --- +# Single Sign-On Integrations -# Single Sign On Integrations - -Single Sign On (SSO) Integrations enable the use of external services for single sign-on. +Single Sign-on (SSO) Integrations are client applications that enable the use of external services (e.g., Dropbox, Slack, or Zoom) for SSO. The integration allows your users to log in using Auth0's [identity providers](/identityproviders). Auth0 provides SSO Integrations for the following services: - [Active Directory RMS](/integrations/sso/ad-rms) +- [Adobe Sign](/integrations/sso/adobe-sign) - [Box](/integrations/sso/box) +- [Cisco WebEx](/integrations/sso/cisco-webex) - [CloudBees](/integrations/sso/cloudbees) - [Concur](/integrations/sso/concur) -- [Disqus](/integrations/sso/disqus) +- [Datadog](/integrations/sso/datadog) - [Dropbox](/integrations/sso/dropbox) -- [Microsoft Dynamics CRM](/integrations/sso/dynamics-crm) -- [Adobe Echosign](/integrations/sso/echosign) +- [Dynamics CRM](/integrations/sso/dynamics-crm) +- [Egencia](/integrations/sso/egencia) - [Egnyte](/integrations/sso/egnyte) +- [Eloqua](/integrations/sso/eloqua) +- [Freshdesk](/integrations/sso/freshdesk) +- [Google Workspace](/integrations/sso/google-workspace) +- [GitHub Enterprise Cloud](/integrations/sso/github-enterprise-cloud) +- [GitHub Enterprise Server](/integrations/sso/github-enterprise-server) +- [Heroku](/integrations/sso/heroku) +- [Hosted Graphite](/integrations/sso/hosted-graphite) +- [Litmos](/integrations/sso/litmos) - [New Relic](/integrations/sso/new-relic) - [Office 365](/integrations/sso/office-365) -- [SalesForce](/integrations/sso/salesforce) -- [SharePoint](/integrations/sso/sharepoint) +- [Pluralsight](/integrations/sso/pluralsight) +- [Salesforce](/integrations/sso/salesforce) +- [Sentry](/integrations/sso/sentry) - [Slack](/integrations/sso/slack) - [SpringCM](/integrations/sso/springcm) +- [Sprout Video](/integrations/sso/sprout-video) +- [Tableau Online](/integrations/sso/tableau-online) +- [Tableau Server](/integrations/sso/tableau-server) +- [Workday](/integrations/sso/workday) +- [Workpath](/integrations/sso/workpath) - [Zendesk](/integrations/sso/zendesk) - [Zoom](/integrations/sso/zoom) - -## Create an SSO Integration - -To create a new SSO Integration, navigate to [Dashboard > SSO Integrations](https://manage.auth0.com/#/externalapps) and click **+ Create SSO Integration**. - -![](/media/articles/sso/integrations/new.png) - -Next, select a provider. - -![](/media/articles/sso/integrations/options.png) - -Set the name for your SSO Integration. Click **Create**. - -![](/media/articles/sso/integrations/name.png) - -You will be brought to the **Configuration Instructions** page for the provider, follow the instructions to complete the SSO Integration. diff --git a/articles/integrations/sso/litmos.md b/articles/integrations/sso/litmos.md new file mode 100644 index 0000000000..d29d7ccc42 --- /dev/null +++ b/articles/integrations/sso/litmos.md @@ -0,0 +1,19 @@ +--- +title: Litmos Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Litmos and Auth0. +toc: true +public: true +topics: + - sso + - litmos +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/litmos/0') %> +<%= include('../../../snippets/sso-integrations/litmos/1') %> +<%= include('../../../snippets/sso-integrations/litmos/2') %> +<%= include('../../../snippets/sso-integrations/litmos/3') %> +<%= include('../../../snippets/sso-integrations/litmos/4') %> +<%= include('../../../snippets/sso-integrations/litmos/5') %> +<%= include('../../../snippets/sso-integrations/litmos/6') %> +<%= include('../../../snippets/sso-integrations/litmos/7') %> diff --git a/articles/integrations/sso/new-relic.md b/articles/integrations/sso/new-relic.md index 11637de5f3..68fbf8906b 100644 --- a/articles/integrations/sso/new-relic.md +++ b/articles/integrations/sso/new-relic.md @@ -1,6 +1,6 @@ --- -title: New Relic Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with New Relic and Auth0. +title: New Relic Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with New Relic and Auth0. toc: true public: true topics: @@ -9,8 +9,12 @@ topics: contentType: how-to useCase: integrate-saas-sso --- +<%= include('../../../snippets/sso-integrations/new-relic/0') %> +<%= include('../../../snippets/sso-integrations/new-relic/1') %> +<%= include('../../../snippets/sso-integrations/new-relic/2') %> +<%= include('../../../snippets/sso-integrations/new-relic/3') %> +<%= include('../../../snippets/sso-integrations/new-relic/4') %> +<%= include('../../../snippets/sso-integrations/new-relic/5') %> +<%= include('../../../snippets/sso-integrations/new-relic/6') %> +<%= include('../../../snippets/sso-integrations/new-relic/7') %> -<%= include('./_template', { - service: "New Relic", - img: "new-relic" -}) %> diff --git a/articles/integrations/sso/office-365.md b/articles/integrations/sso/office-365.md index 5e58b8261d..155d016fdd 100644 --- a/articles/integrations/sso/office-365.md +++ b/articles/integrations/sso/office-365.md @@ -1,6 +1,6 @@ --- -title: Office 365 Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Office 365 and Auth0. +title: Office 365 Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Office 365 and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Office 365", - img: "office-365" -}) %> +<%= include('../../../snippets/sso-integrations/office-365/0') %> +<%= include('../../../snippets/sso-integrations/office-365/1') %> +<%= include('../../../snippets/sso-integrations/office-365/2') %> +<%= include('../../../snippets/sso-integrations/office-365/3') %> +<%= include('../../../snippets/sso-integrations/office-365/4') %> +<%= include('../../../snippets/sso-integrations/office-365/5') %> +<%= include('../../../snippets/sso-integrations/office-365/6') %> +<%= include('../../../snippets/sso-integrations/office-365/7') %> diff --git a/articles/integrations/sso/pluralsight.md b/articles/integrations/sso/pluralsight.md new file mode 100644 index 0000000000..48c55cfa21 --- /dev/null +++ b/articles/integrations/sso/pluralsight.md @@ -0,0 +1,19 @@ +--- +title: Pluralsight Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Pluralsight and Auth0. +toc: true +public: true +topics: + - sso + - dropxbox +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/pluralsight/0') %> +<%= include('../../../snippets/sso-integrations/pluralsight/1') %> +<%= include('../../../snippets/sso-integrations/pluralsight/2') %> +<%= include('../../../snippets/sso-integrations/pluralsight/3') %> +<%= include('../../../snippets/sso-integrations/pluralsight/4') %> +<%= include('../../../snippets/sso-integrations/pluralsight/5') %> +<%= include('../../../snippets/sso-integrations/pluralsight/6') %> +<%= include('../../../snippets/sso-integrations/pluralsight/7') %> diff --git a/articles/integrations/sso/salesforce.md b/articles/integrations/sso/salesforce.md index 729d038875..2946044f0f 100644 --- a/articles/integrations/sso/salesforce.md +++ b/articles/integrations/sso/salesforce.md @@ -1,6 +1,6 @@ --- -title: Salesforce Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Salesforce and Auth0. +title: Salesforce Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Salesforce and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Salesforce", - img: "salesforce" -}) %> +<%= include('../../../snippets/sso-integrations/salesforce/0') %> +<%= include('../../../snippets/sso-integrations/salesforce/1') %> +<%= include('../../../snippets/sso-integrations/salesforce/2') %> +<%= include('../../../snippets/sso-integrations/salesforce/3') %> +<%= include('../../../snippets/sso-integrations/salesforce/4') %> +<%= include('../../../snippets/sso-integrations/salesforce/5') %> +<%= include('../../../snippets/sso-integrations/salesforce/6') %> +<%= include('../../../snippets/sso-integrations/salesforce/7') %> diff --git a/articles/integrations/sso/sentry.md b/articles/integrations/sso/sentry.md new file mode 100644 index 0000000000..5bf371deb2 --- /dev/null +++ b/articles/integrations/sso/sentry.md @@ -0,0 +1,19 @@ +--- +title: Sentry Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Sentry and Auth0. +toc: true +public: true +topics: + - sso + - sentry +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/sentry/0') %> +<%= include('../../../snippets/sso-integrations/sentry/1') %> +<%= include('../../../snippets/sso-integrations/sentry/2') %> +<%= include('../../../snippets/sso-integrations/sentry/3') %> +<%= include('../../../snippets/sso-integrations/sentry/4') %> +<%= include('../../../snippets/sso-integrations/sentry/5') %> +<%= include('../../../snippets/sso-integrations/sentry/6') %> +<%= include('../../../snippets/sso-integrations/sentry/7') %> diff --git a/articles/integrations/sso/sharepoint.md b/articles/integrations/sso/sharepoint.md index de1d934bec..8fde6b36df 100644 --- a/articles/integrations/sso/sharepoint.md +++ b/articles/integrations/sso/sharepoint.md @@ -1,16 +1,19 @@ --- -title: SharePoint Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with SharePoint and Auth0. +title: SharePoint Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with SharePoint and Auth0. toc: true -public: true +public: false topics: - sso - sharepoint contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "SharePoint", - img: "sharepoint" -}) %> +<%= include('../../../snippets/sso-integrations/sharepoint/0') %> +<%= include('../../../snippets/sso-integrations/sharepoint/1') %> +<%= include('../../../snippets/sso-integrations/sharepoint/2') %> +<%= include('../../../snippets/sso-integrations/sharepoint/3') %> +<%= include('../../../snippets/sso-integrations/sharepoint/4') %> +<%= include('../../../snippets/sso-integrations/sharepoint/5') %> +<%= include('../../../snippets/sso-integrations/sharepoint/6') %> +<%= include('../../../snippets/sso-integrations/sharepoint/7') %> diff --git a/articles/integrations/sso/slack.md b/articles/integrations/sso/slack.md index 64f2675696..7fff98bb76 100644 --- a/articles/integrations/sso/slack.md +++ b/articles/integrations/sso/slack.md @@ -1,6 +1,6 @@ --- -title: Slack Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Slack and Auth0. +title: Slack Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Slack and Auth0. toc: true public: true topics: @@ -9,12 +9,15 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Slack", - img: "slack" -}) %> +<%= include('../../../snippets/sso-integrations/slack/0') %> +<%= include('../../../snippets/sso-integrations/slack/1') %> +<%= include('../../../snippets/sso-integrations/slack/2') %> +<%= include('../../../snippets/sso-integrations/slack/3') %> +<%= include('../../../snippets/sso-integrations/slack/4') %> +<%= include('../../../snippets/sso-integrations/slack/5') %> +<%= include('../../../snippets/sso-integrations/slack/6') %> +<%= include('../../../snippets/sso-integrations/slack/7') %> ::: note -For more information, check out Slack's article on [enabling SAML-based single sign-on](https://get.slack.help/hc/en-us/articles/203772216-Enabling-SAML-based-single-sign-on). +For more information, check out Slack's article on [enabling SAML-based Single Sign-on (SSO)](https://get.slack.help/hc/en-us/articles/203772216-Enabling-SAML-based-single-sign-on). ::: diff --git a/articles/integrations/sso/springcm.md b/articles/integrations/sso/springcm.md index 4475bf4b2b..ca7ea7e521 100644 --- a/articles/integrations/sso/springcm.md +++ b/articles/integrations/sso/springcm.md @@ -1,6 +1,6 @@ --- -title: SpringCM Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with SpringCM and Auth0. +title: SpringCM Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with SpringCM and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "SpringCM", - img: "springcm" -}) %> +<%= include('../../../snippets/sso-integrations/springcm/0') %> +<%= include('../../../snippets/sso-integrations/springcm/1') %> +<%= include('../../../snippets/sso-integrations/springcm/2') %> +<%= include('../../../snippets/sso-integrations/springcm/3') %> +<%= include('../../../snippets/sso-integrations/springcm/4') %> +<%= include('../../../snippets/sso-integrations/springcm/5') %> +<%= include('../../../snippets/sso-integrations/springcm/6') %> +<%= include('../../../snippets/sso-integrations/springcm/7') %> diff --git a/articles/integrations/sso/sprout-video.md b/articles/integrations/sso/sprout-video.md new file mode 100644 index 0000000000..9299a866ec --- /dev/null +++ b/articles/integrations/sso/sprout-video.md @@ -0,0 +1,19 @@ +--- +title: Sprout Video Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Sprout Video and Auth0. +toc: true +public: true +topics: + - sso + - sprout-video +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/sprout-video/0') %> +<%= include('../../../snippets/sso-integrations/sprout-video/1') %> +<%= include('../../../snippets/sso-integrations/sprout-video/2') %> +<%= include('../../../snippets/sso-integrations/sprout-video/3') %> +<%= include('../../../snippets/sso-integrations/sprout-video/4') %> +<%= include('../../../snippets/sso-integrations/sprout-video/5') %> +<%= include('../../../snippets/sso-integrations/sprout-video/6') %> +<%= include('../../../snippets/sso-integrations/sprout-video/7') %> diff --git a/articles/integrations/sso/tableau-online.md b/articles/integrations/sso/tableau-online.md new file mode 100644 index 0000000000..89848db4c2 --- /dev/null +++ b/articles/integrations/sso/tableau-online.md @@ -0,0 +1,19 @@ +--- +title: Tableau Online Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Tableau Online and Auth0. +toc: true +public: true +topics: + - sso + - tableau-online +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/tableau-online/0') %> +<%= include('../../../snippets/sso-integrations/tableau-online/1') %> +<%= include('../../../snippets/sso-integrations/tableau-online/2') %> +<%= include('../../../snippets/sso-integrations/tableau-online/3') %> +<%= include('../../../snippets/sso-integrations/tableau-online/4') %> +<%= include('../../../snippets/sso-integrations/tableau-online/5') %> +<%= include('../../../snippets/sso-integrations/tableau-online/6') %> +<%= include('../../../snippets/sso-integrations/tableau-online/7') %> diff --git a/articles/integrations/sso/tableau-server.md b/articles/integrations/sso/tableau-server.md new file mode 100644 index 0000000000..648e77c4ab --- /dev/null +++ b/articles/integrations/sso/tableau-server.md @@ -0,0 +1,19 @@ +--- +title: Tableau Server Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Tableau Server and Auth0. +toc: true +public: true +topics: + - sso + - tableau-server +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/tableau-server/0') %> +<%= include('../../../snippets/sso-integrations/tableau-server/1') %> +<%= include('../../../snippets/sso-integrations/tableau-server/2') %> +<%= include('../../../snippets/sso-integrations/tableau-server/3') %> +<%= include('../../../snippets/sso-integrations/tableau-server/4') %> +<%= include('../../../snippets/sso-integrations/tableau-server/5') %> +<%= include('../../../snippets/sso-integrations/tableau-server/6') %> +<%= include('../../../snippets/sso-integrations/tableau-server/7') %> diff --git a/articles/integrations/sso/workday.md b/articles/integrations/sso/workday.md new file mode 100644 index 0000000000..d77f02f586 --- /dev/null +++ b/articles/integrations/sso/workday.md @@ -0,0 +1,19 @@ +--- +title: Workday Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Workday and Auth0. +toc: true +public: true +topics: + - sso + - workday +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/workday/0') %> +<%= include('../../../snippets/sso-integrations/workday/1') %> +<%= include('../../../snippets/sso-integrations/workday/2') %> +<%= include('../../../snippets/sso-integrations/workday/3') %> +<%= include('../../../snippets/sso-integrations/workday/4') %> +<%= include('../../../snippets/sso-integrations/workday/5') %> +<%= include('../../../snippets/sso-integrations/workday/6') %> +<%= include('../../../snippets/sso-integrations/workday/7') %> diff --git a/articles/integrations/sso/workpath.md b/articles/integrations/sso/workpath.md new file mode 100644 index 0000000000..6857d56b43 --- /dev/null +++ b/articles/integrations/sso/workpath.md @@ -0,0 +1,19 @@ +--- +title: Workpath Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Workpath and Auth0. +toc: true +public: true +topics: + - sso + - workpath +contentType: how-to +useCase: integrate-saas-sso +--- +<%= include('../../../snippets/sso-integrations/workpath/0') %> +<%= include('../../../snippets/sso-integrations/workpath/1') %> +<%= include('../../../snippets/sso-integrations/workpath/2') %> +<%= include('../../../snippets/sso-integrations/workpath/3') %> +<%= include('../../../snippets/sso-integrations/workpath/4') %> +<%= include('../../../snippets/sso-integrations/workpath/5') %> +<%= include('../../../snippets/sso-integrations/workpath/6') %> +<%= include('../../../snippets/sso-integrations/workpath/7') %> diff --git a/articles/integrations/sso/zendesk.md b/articles/integrations/sso/zendesk.md index f47700658a..f4409ec17d 100644 --- a/articles/integrations/sso/zendesk.md +++ b/articles/integrations/sso/zendesk.md @@ -1,6 +1,6 @@ --- -title: Zendesk Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Zendesk and Auth0. +title: Zendesk Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Zendesk and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Zendesk", - img: "zendesk" -}) %> +<%= include('../../../snippets/sso-integrations/zendesk/0') %> +<%= include('../../../snippets/sso-integrations/zendesk/1') %> +<%= include('../../../snippets/sso-integrations/zendesk/2') %> +<%= include('../../../snippets/sso-integrations/zendesk/3') %> +<%= include('../../../snippets/sso-integrations/zendesk/4') %> +<%= include('../../../snippets/sso-integrations/zendesk/5') %> +<%= include('../../../snippets/sso-integrations/zendesk/6') %> +<%= include('../../../snippets/sso-integrations/zendesk/7') %> diff --git a/articles/integrations/sso/zoom.md b/articles/integrations/sso/zoom.md index 658169a190..c987b3d838 100644 --- a/articles/integrations/sso/zoom.md +++ b/articles/integrations/sso/zoom.md @@ -1,6 +1,6 @@ --- -title: Zoom Single Sign On Integration -description: How to set up a Single Sign On (SSO) integration with Zoom and Auth0. +title: Zoom Single Sign-On Integration +description: Learn how to set up a Single Sign-on (SSO) integration with Zoom and Auth0. toc: true public: true topics: @@ -9,8 +9,11 @@ topics: contentType: how-to useCase: integrate-saas-sso --- - -<%= include('./_template', { - service: "Zoom", - img: "zoom" -}) %> +<%= include('../../../snippets/sso-integrations/zoom/0') %> +<%= include('../../../snippets/sso-integrations/zoom/1') %> +<%= include('../../../snippets/sso-integrations/zoom/2') %> +<%= include('../../../snippets/sso-integrations/zoom/3') %> +<%= include('../../../snippets/sso-integrations/zoom/4') %> +<%= include('../../../snippets/sso-integrations/zoom/5') %> +<%= include('../../../snippets/sso-integrations/zoom/6') %> +<%= include('../../../snippets/sso-integrations/zoom/7') %> diff --git a/articles/integrations/using-auth0-as-an-identity-provider-with-github-enterprise.md b/articles/integrations/using-auth0-as-an-identity-provider-with-github-enterprise.md deleted file mode 100644 index 04714b1ef0..0000000000 --- a/articles/integrations/using-auth0-as-an-identity-provider-with-github-enterprise.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -description: How to use Auth0 as an identity provider with GitHub Enterprise. -crews: crew-2 -topics: - - integrations - - github - - github-enterprise -contentType: how-to -useCase: integrate-saas-sso ---- - -# Using Auth0 as an Identity Provider with GitHub Enterprise - -When using GitHub Enterprise, you can configure Auth0 to act as an identity provider. - -## Configure Your Auth0 Application - -Create a new or select an existing Application using the [Applications](${manage_url}/#/applications) page of the Management Dashboard. - -On the row associated with your chosen Application, click on the **Addons** button, which is the second button from the right on the appropriate Application row. - -![](/media/articles/scenarios/github-enterprise/clients.png) - -When the **Addons** page opens, set the slider in the box called **SAML2 WEB APP** to the right. The slider will turn green to indicate that the Addon is active. - -![](/media/articles/scenarios/github-enterprise/addons.png) - -You will then be presented with the Addon Settings page: - -![](/media/articles/scenarios/github-enterprise/addon-settings.png) - -Set the following configuration variables: - -* **Application Callback URL**: the Assertion consumption URL of your GitHub Exterprise instance; - * Example: `https://your_github_enterprise_url/saml/consume` -* **Settings**: the URL for your GitHub Enterprise instance set as the `audience`. - * Example: `{ "audience": "https://your_github_enterprise_url" }` - -You can check the validity of these settings by clicking **Debug**. - -To persist your changes, click **Save**. - -To obtain the values necessary for configuring your GitHub Enterprise account, switch over to the **Usage** tab. - -![](/media/articles/scenarios/github-enterprise/addon-usage.png) - -You will need values/files for the following configuration settings: - -* Issuer; -* Auth0 Certificate (download this file so that you can upload it to GitHub); -* Identity Provider Login URL. - -## Configure Your GitHub Enterprise Account - -Log in to your GitHub Enterprise Management Console. You should have a custom URL that follows this format: `https:// your_github_enterprise_url:8443/setup/settings`. - -Navigate to the **Authentication** section under the **Settings** page. - -![](/media/articles/scenarios/github-enterprise/auth-settings.png) - -Set the following configuration variables: - -* **Authentication Type**: Set as *SAML*; -* **Single sign-on URL**: Paste the *Identity Provider Login URL* copied from the Auth0 Dashboard here; -* **Issuer**: Paste the *Issuer* value copied from the Auth0 Dashboard here. The format of the value is `urn:.auth0.com`. - -Upload the Auth0 Certificate you downloaded under **Replace Certificate**. - -![](/media/articles/scenarios/github-enterprise/auth-certificate.png) - -Click **Save** to persist your changes. Saving automatically restarts your GitHub Enterprise instance. At this point, anyone accessing your GitHub Enterprise will be prompted to sign in with Auth0. diff --git a/articles/integrations/using-auth0-to-secure-a-cli.md b/articles/integrations/using-auth0-to-secure-a-cli.md index b83fdfab1e..deacfe2ad6 100644 --- a/articles/integrations/using-auth0-to-secure-a-cli.md +++ b/articles/integrations/using-auth0-to-secure-a-cli.md @@ -1,45 +1,44 @@ --- -title: Using Auth0 to secure a CLI +title: Secure a CLI with Auth0 description: How to use Auth0 to secure a CLI. topics: - integrations - cli contentType: how-to -useCase: integrate-saas-sso +useCase: + - integrate-saas-sso + - cli-authentication + - --- -# Using Auth0 to secure a CLI +# Secure a CLI with Auth0 -Authentication in CLI programs is straightforward if the identity provider supports sending credentials, like database connections, SMS passwordless and AD. If the identity provider requires a browser redirect, then the process is slightly more complicated. +There are three ways to secure a CLI with Auth0 in order of most secure to least secure: -::: note - If your identity provider supports sending credentials, then the grant you should implement is the [Client Credentials](/api-auth/grant/client-credentials). For details on how to implement this refer to [How to implement the Client Credentials Grant](/api-auth/tutorials/client-credentials). -::: - -Auth0 implements the [Proof Key for Code Exchange by OAuth Public Clients](https://tools.ietf.org/html/rfc7636). This flow makes it easy to add authentication to a CLI while keeping higher standards of security. +* [Device Authorization Flow](#device-authorization-flow) +* [Client Credentials Grant Flow](#client-credentials-grant-flow) +* [Resource Owner Password Grant Flow](#resource-owner-password-grant-flow) (not recommended) -## How PKCE works +The first two options are for user-based authentication, whereas the third option is only when you're attempting to authenticate the CLI client itself, which is a very rare situation. -Traditionally, public applications (such as mobile apps, SPAs and CLIs) have used the [implicit flow](/api-auth/grant/implicit) to obtain a token. In this flow, there's no __application authentication__ because there's no easy way of storing a `client_secret`. +## Device Authorization Flow -The [PKCE flow](/api-auth/grant/authorization-code-pkce) (`pixy` for friends), increases security by adding a cryptographic challenge in the token exchange. This prevents rogue apps to intercept the response from Auth0, and get hold of the token. +With input-constrained devices that connect to the internet, rather than authenticate the user directly, the device asks the user to go to a link on their computer or smartphone and authorize the device. This avoids a poor user experience for devices that do not have an easy way to enter text. To do this, device apps use the Device Authorization Flow (drafted in [OAuth 2.0](https://tools.ietf.org/html/draft-ietf-oauth-device-flow-15)), in which they pass along their Client ID to initiate the authorization process and get a token. -## How to implement PKCE +The easiest way to implement the [Device Authorization Flow](/flows/concepts/device-auth) is to follow the steps in [Call API Using Device Authorization Flow](/flows/guides/device-auth/call-api-device-auth). -The steps to follow to implement this grant are the following: +## Client Credentials Grant Flow -1. __Create a Code Verifier__. This is a randomly generated value that will be used to generate the `code_challenge` (which will be sent in the authorization request). +Use the Client Credentials Grant (CCG) flow when users and downstream identity providers aren't involved and you want to authenticate based on distinct machines or devices. -2. __Create a Code Challenge__. A hashed (`SHA256`) and base64Url encoded value, generated using the `code_verifier`. +If your identity provider supports sending credentials, then you should use the [Client Credentials Flow](/flows/concepts/client-credentials). For details on how to implement this, refer to [Call API Using the Client Credentials Flow](/flows/guides/client-credentials/call-api-client-credentials). -3. __Initiate the Authorization Request__. The regular OAuth 2.0 authorization request, with the caveat that now it includes two parameters: the `code_challenge` and the `code_challenge_method` which should be `S256`. If the authorization is successful, then Auth0 will redirect the browser to the callback with a `code` query parameter: `${account.callback}/?code=123`. +## Resource Owner Password Grant Flow -::: warning - In order for the CLI to be able to receive the callback and retrieve the code, it should run on the web server. -::: +We do not recommend using the Resource Owner Password Grant (ROPG) flow for native applications. In the [RFC 8252 OAuth 2.0 for Native Apps](https://tools.ietf.org/html/rfc8252) from the Internet Engineering Task Force (IETF), it is recommended that “OAuth 2.0 authorization request from native apps should ONLY be made through external user-agents, primarily the user’s browser”. For details, see [RFC 8252 Embedded User-Agents](https://tools.ietf.org/html/rfc8252#section-8.12). -4. __Exchange the Authorization Code for a Token__. With the `code`, the program then uses the [/oauth/token endpoint](/api/authentication#authorization-code-pkce-) to obtain a token. In this second step, the CLI program adds a `verifier` parameter with the exact same random secret generated in step 1. Auth0 uses this to correlate and verify that the request originates from the same application. If successful the response is another JSON object, with an ID Token and Access Token. Note that if the `verifier` doesn't match with what was sent in the [/authorize endpoint](/api/authentication#authorization-code-grant-pkce-), the request will fail. +Using Resource Owner Password Grant (ROPG) are less secure than the redirect-based options described above. ROPG is only for legacy. In the context of CLIs, it only makes sense for things like connection strings where you need to support legacy programs. ::: note - For implementation details and sample scripts, refer to [Execute an Authorization Code Grant Flow with PKCE](/api-auth/tutorials/authorization-code-grant-pkce). -::: +If you must use ROPG in your native app instead of Device Flow as we recommend, then you can use our [OIDC compliant ROPG endpoint](/api/authentication#resource-owner-password). +::: \ No newline at end of file diff --git a/articles/libraries/_includes/_change_get_profile.md b/articles/libraries/_includes/_change_get_profile.md index 41cdc0a986..96838117ae 100644 --- a/articles/libraries/_includes/_change_get_profile.md +++ b/articles/libraries/_includes/_change_get_profile.md @@ -1,5 +1,5 @@ ### Change calls to getProfile() -The deprecated `getProfile()` function was reimplemented in Lock 11. The previous implementation received an [ID Token](/tokens/id-token) as a parameter and returned the user profile. +The deprecated `getProfile()` function was reimplemented in Lock 11. The previous implementation received an [ID Token](/tokens/concepts/id-tokens) as a parameter and returned the user profile. -The new implementation requires an [Access Token](/tokens/access-token) parameter instead. +The new implementation requires an Access Token parameter instead. diff --git a/articles/libraries/_includes/_configure_custom_domain.md b/articles/libraries/_includes/_configure_custom_domain.md index 3e346bdc10..5a98890df2 100644 --- a/articles/libraries/_includes/_configure_custom_domain.md +++ b/articles/libraries/_includes/_configure_custom_domain.md @@ -10,16 +10,16 @@ var lock = new Auth0Lock('${account.clientId}', 'login.your-domain.com', options); ``` -4. Set the `configurationBaseUrl` option to `https://cdn.auth0.com`. +4. Set the `configurationBaseUrl` option to `https://cdn.us.auth0.com`. ``` var options = { - configurationBaseUrl: 'https://cdn.auth0.com' + configurationBaseUrl: 'https://cdn.us.auth0.com' }; ``` ::: note -The CDN URL varies by region. For regions outside of the US, use `https://cdn.{region}.auth0.com` (for example, use `eu` for Europe, `au` for Australia). +The CDN URL varies by region. Tenants created before 11 June 2020 should use `https://cdn.auth0.com` if the region is the United States, or add `eu` or `au` for Europe or Australia. If your tenant was created after 11 June 2020, use `https://cdn.us.auth0.com` if the region is the United States. ::: #### Management Application diff --git a/articles/libraries/_includes/_default_values.md b/articles/libraries/_includes/_default_values.md index ac6d09ca78..48b1b9eff4 100644 --- a/articles/libraries/_includes/_default_values.md +++ b/articles/libraries/_includes/_default_values.md @@ -1,6 +1,6 @@ ### Default values -Auth0.js v9 will default the value of the [scope](/scopes) parameter to `openid profile email`. +Auth0.js v9 will default the value of the scope parameter to `openid profile email`. If you are running your website from `http://localhost` or `http://127.0.0.1` and you do not specify the `openid profile email` scope when initializing auth0.js, calling the `getSSOData()` method will result in the following error in the browser console: diff --git a/articles/libraries/_includes/_default_values_lock.md b/articles/libraries/_includes/_default_values_lock.md index 8549aa5117..b66229d099 100644 --- a/articles/libraries/_includes/_default_values_lock.md +++ b/articles/libraries/_includes/_default_values_lock.md @@ -1,6 +1,6 @@ ### Default values -Lock 11 will default the [scope](/scopes) parameter to `'openid profile email'`. This is to make the **Last time you logged in with** window work correctly. +Lock 11 will default the scope parameter to `'openid profile email'`. This is to make the **Last time you logged in with** window work correctly. If you are running your website from `http://localhost` or `http://127.0.0.1` and you do not specify the `openid profile email` scope when initializing Lock, you may get the following error in the browser console: diff --git a/articles/libraries/_includes/_embedded_sso.md b/articles/libraries/_includes/_embedded_sso.md index 534f174a01..bd379358ae 100644 --- a/articles/libraries/_includes/_embedded_sso.md +++ b/articles/libraries/_includes/_embedded_sso.md @@ -1,10 +1,10 @@ -### SSO with embedded authentication +### Single Sign-On with embedded authentication -Apps with embedded login must meet two criteria in order to have SSO. +Apps with embedded login must meet two criteria in order to have Single Sign-on (SSO). -1. Both of the applications attempting SSO must be [first-party applications](/applications/application-types#first-party-application). SSO with third party applications will not work. +1. Both of the applications attempting SSO must be first-party applications. SSO with third-party applications will not work. 1. They need to make use of [custom domains](/custom-domains) and have both the applications which intend to have SSO as well as the Auth0 tenant on the same domain. Traditionally, Auth0 domains are in the format `foo.auth0.com`, but custom domains allow you to use the same domain for each of the applications in question as well as your Auth0 tenant, preventing the risk of CSRF attacks. ::: note -Our recommendation is to use [Universal Login](/hosted-pages/login) instead of setting up SSO in embedded login scenarios. Universal Login is the most reliable and stable way to perform SSO, and is the only way to do so if you must use multiple domains for your applications, or use [third-party applications](/applications/application-types#third-party-application). +Our recommendation is to use Universal Login instead of setting up SSO in embedded login scenarios. Universal Login is the most reliable and stable way to perform SSO, and is the only way to do so if you must use multiple domains for your applications, or use [third-party applications](/applications/guides/enable-third-party-apps). ::: diff --git a/articles/libraries/_includes/_get_lock_latest_version.md b/articles/libraries/_includes/_get_lock_latest_version.md index 7c1cbac020..8f775a2240 100644 --- a/articles/libraries/_includes/_get_lock_latest_version.md +++ b/articles/libraries/_includes/_get_lock_latest_version.md @@ -1,6 +1,6 @@ ### Update Lock -Update the Lock library using npm or yarn. +Update the Lock library using npm or yarn. ```bash # installation with npm diff --git a/articles/libraries/_includes/_ip_ranges.md b/articles/libraries/_includes/_ip_ranges.md index 17128b45ed..b3813c37ce 100644 --- a/articles/libraries/_includes/_ip_ranges.md +++ b/articles/libraries/_includes/_ip_ranges.md @@ -1,7 +1,7 @@ -### Single sign on using IP ranges +### Single sign-on using IP ranges In earlier versions of Lock, you could configure an IP range in an Active Directory/LDAP connection. You could then use that range to allow integrated Windows Authentication if the user's IP was within the range. When this was true, Lock would display a button that users could click and get redirected to the integrated authentication dialog. ![SSO With Lock 10 and Windows IP Ranges](/media/articles/libraries/lock/lock-11-windows-authentication.png) -This functionality has been removed from embedded login using Lock 11. There is no IP detection, and the user will need to type user and password in Lock. It is still available when using Universal Login. +This functionality has been removed from embedded login using Lock 11. There is no IP detection, and the user will need to type user and password in Lock. It is still available when using Universal Login. diff --git a/articles/libraries/_includes/_last_logged_in_window.md b/articles/libraries/_includes/_last_logged_in_window.md index c187f96462..696166ebfb 100644 --- a/articles/libraries/_includes/_last_logged_in_window.md +++ b/articles/libraries/_includes/_last_logged_in_window.md @@ -1,6 +1,6 @@ ### Last time you logged in with window with authorization code flow -Lock 11 will never show the **Last time you logged in with** window when using the [Authorization Code Flow](/api-auth/grant/authorization-code) (that is, when specifying `response_type='code'`). It will always prompt for credentials. +Lock 11 will never show the **Last time you logged in with** window when using the [Authorization Code Flow](/flows/concepts/auth-code) (that is, when specifying `response_type='code'`). It will always prompt for credentials. ### Last time you logged in with window and redirects diff --git a/articles/libraries/_includes/_legacy_flows.md b/articles/libraries/_includes/_legacy_flows.md index 6563993de2..b6793b4966 100644 --- a/articles/libraries/_includes/_legacy_flows.md +++ b/articles/libraries/_includes/_legacy_flows.md @@ -1,5 +1,5 @@ ### Migrating from legacy authentication flows -The OIDC conformant flows disallow certain practices that were common when developing applications with older versions of the library, like using [Refresh Tokens](tokens/refresh-token), using [ID Tokens](/tokens/id-token) to call APIs, and [accessing non-standard claims in the user profile](/api-auth/tutorials/adoption/scope-custom-claims). +The OIDC conformant flows disallow certain practices that were common when developing applications with older versions of the library, like using Refresh Tokens, using [ID Tokens](/tokens/concepts/id-tokens) to call APIs, and [accessing non-standard claims in the user profile](/api-auth/tutorials/adoption/scope-custom-claims). Follow the steps in the [Migration from Legacy Authentication Flows](guides/migration-legacy-flows) to learn what changes you need to make in your application. diff --git a/articles/libraries/_includes/_oidc_conformant.md b/articles/libraries/_includes/_oidc_conformant.md index d600036909..ec12a82cf5 100644 --- a/articles/libraries/_includes/_oidc_conformant.md +++ b/articles/libraries/_includes/_oidc_conformant.md @@ -2,4 +2,4 @@ When the `oidcConformant` flag was set to true, Lock 10 used [Cross Origin Authentication](/cross-origin-authentication), and did not use the '/usernamepassword/login' and '/ssodata' endpoints. -Given Lock 11 always always uses Cross Origin Authentication and does not use the '/ssodata' endpoint, this flag is not longer needed. If specified, it will be ignored. +Given Lock 11 always uses Cross Origin Authentication and does not use the '/ssodata' endpoint, this flag is not longer needed. If specified, it will be ignored. diff --git a/articles/libraries/_includes/_review_get_ssodata.md b/articles/libraries/_includes/_review_get_ssodata.md index eab4e74fe7..509974a67a 100644 --- a/articles/libraries/_includes/_review_get_ssodata.md +++ b/articles/libraries/_includes/_review_get_ssodata.md @@ -2,7 +2,7 @@ The deprecated `getSSOData()` function was reimplemented in Auth0.js v9 to simplify migration from older versions, but the behavior is not exactly the same. -The function will not work as expected when you use it in Web Applications that use the [Authorization Code Flow](/api-auth/grant/authorization-code) (such as when you specify `response_type='code'`). It will always return that there is not a current session. +The function will not work as expected when you use it in Web Applications that use the [Authorization Code Flow](/flows/concepts/auth-code) (such as when you specify `response_type='code'`). It will always return that there is not a current session. If you want to avoid showing the Lock dialog when there is an existing session in the server, you can use the [checkSession()](/libraries/auth0js#using-checksession-to-acquire-new-tokens) function in Auth0.js. @@ -21,6 +21,6 @@ If you are going to keep using `getSSOData()`, take into account the changes in | lastUsedClientId | The client id for the last active connection | The last application used when authenticating from the current browsers | | lastUsedUserId | The user id for the current session | The same | | lastUsedUsername | User's email or name | The same (requires `scope=’openid profile email’)` | -| lastUsedConnection | Last used connection and strategy. | Last connection used when authenticated from the current browser. It will be `null` if the user authenticated via [Universal Login](/hosted-pages/login). It will not return `strategy`, only `name` | +| lastUsedConnection | Last used connection and strategy. | Last connection used when authenticated from the current browser. It will be `null` if the user authenticated via Universal Login. It will not return `strategy`, only `name` | -In order for the function to work properly, you need to ask for `scope='openid profile email'` when you initialize Auth0.js. +For the function to work properly, you need to ask for `scope='openid profile email'` when you initialize Auth0.js. diff --git a/articles/libraries/_includes/_spa_js_faq.md b/articles/libraries/_includes/_spa_js_faq.md new file mode 100644 index 0000000000..0595e4e5fb --- /dev/null +++ b/articles/libraries/_includes/_spa_js_faq.md @@ -0,0 +1,5 @@ + + +::: note +If you encounter some problems or errors when using the new JavaScript SDK, please [check out the FAQ](https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md) to see if your issue is covered there. +::: \ No newline at end of file diff --git a/articles/libraries/_includes/_verifying_migration.md b/articles/libraries/_includes/_verifying_migration.md index 5d72199ebc..a4edd88b3c 100644 --- a/articles/libraries/_includes/_verifying_migration.md +++ b/articles/libraries/_includes/_verifying_migration.md @@ -1,6 +1,6 @@ ### Verifying your migration -Once you have migrated your codebase, you should no longer see [deprecation notes in your logs](/errors/deprecation-errors). +Once you have migrated your codebase, you should no longer see [deprecation notes in your logs](/troubleshoot/guides/check-deprecation-errors). If you would like to be sure that your applications are no longer calling the legacy endpoints, you can go to the [Dashboard](${manage_url}/#/tenant/advanced) under **Tenant Settings > Advanced** then scroll down to **Migrations** and toggle off the Legacy Lock API switch. Turning off this switch will disable the deprecated Lock / Auth0.js endpoints for your tenant, preventing them from being used at all. diff --git a/articles/libraries/auth0-android/configuration.md b/articles/libraries/auth0-android/configuration.md index 930b792a12..08e87aef3f 100644 --- a/articles/libraries/auth0-android/configuration.md +++ b/articles/libraries/auth0-android/configuration.md @@ -17,7 +17,7 @@ Auth0.Android can be configured with a variety of options, listed below. The `withConnection` option allows you to specify a connection that you wish to authenticate with. ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withConnection("twitter") .start(this, authCallback); ``` @@ -29,17 +29,17 @@ Code grant is the default mode, and will always be used unless calling `useCodeG Before you can use `Code Grant` in Android, make sure to go to your [Dashboard](${manage_url}/#/applications) and check in the application's settings that `Application Type` is `Native`. ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .useCodeGrant(true) .start(this, authCallback); ``` ## withScope -Using scopes can allow you to return specific claims for specific fields in your request. Adding parameters to `withScope` will allow you to add more scopes. You should read our [documentation on scopes](/scopes) for further details about them. +Using scopes can allow you to return specific claims for specific fields in your request. Adding parameters to `withScope` will allow you to add more scopes. You should read our [documentation on scopes](/scopes) for further details about them. ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withScope("openid email profile") .start(this, authCallback); ``` @@ -50,10 +50,10 @@ Note that the default scope used is `openid` ## withConnectionScope -There may be times when you need to authenticate with particular connection scopes, or permissions, from the Authentication Provider in question. Auth0 has [documentation on setting up connection scopes for external Authentication Providers](/tutorials/adding-scopes-for-an-external-idp). However, if you need specific access for a particular situation in your app you can do so by passing parameters to `withConnectionScope`. A full listing of available parameters can be found in that connection's settings in your [Dashboard](${manage_url}), or from the Authentication Providers's documentation. The scope requested here is added on top of the ones specified in the connection's settings in the Dashboard. +There may be times when you need to authenticate with particular connection scopes, or permissions, from the Authentication Provider in question. Auth0 has [documentation on setting up connection scopes for external Authentication Providers](/connections/adding-scopes-for-an-external-idp). However, if you need specific access for a particular situation in your app you can do so by passing parameters to `withConnectionScope`. A full listing of available parameters can be found in that connection's settings in your [Dashboard](${manage_url}), or from the Authentication Providers's documentation. The scope requested here is added on top of the ones specified in the connection's settings in the Dashboard. ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withConnectionScope("email", "profile", "calendar:read") .start(this, authCallback); ``` @@ -65,17 +65,17 @@ To send additional parameters on the authentication, use `withParameters`: ```java Map parameters = new HashMap<>(); //Add entries -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withParameters(parameters) .start(this, authCallback); ``` ## withScheme -If you are not using Android "App Links" or you want to use a different scheme for the redirect URI, then use `withScheme`. Note that you'll need to update the `auth0Scheme` Manifest Placeholder in the `app/build.gradle` file and the whitelisted **Allowed Callback URLs** on the [Dashboard](${manage_url}) in the Application's settings to match the chosen scheme. +If you are not using Android "App Links" or you want to use a different scheme for the redirect URI, then use `withScheme`. Note that you'll need to update the `auth0Scheme` Manifest Placeholder in the `app/build.gradle` file and the whitelisted **Allowed Callback URLs** on the [Dashboard](${manage_url}) in the Application's settings to match the chosen scheme. ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withScheme("myapp") .start(this, authCallback); ``` @@ -86,10 +86,10 @@ Scheme must be lowercase! ## withAudience -To provide an audience, use `withAudience`. +To provide an audience, use `withAudience`. ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withScope("openid") .withAudience("https://${account.namespace}/userinfo") .start(this, authCallback); @@ -100,17 +100,17 @@ WebAuthProvider.init(account) By default a random [state](/protocols/oauth2/oauth-state) is always generated and sent. If you need to use a custom value instead, use `withState`: ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withState("my-custom-state") .start(this, authCallback); ``` ## withNonce -By default a random [nonce](/api-auth/tutorials/nonce) is generated and sent when the response type includes `id_token`. If you need to use a custom value instead, use `withNonce`: +By default a random nonce is generated and sent when the response type includes `id_token`. If you need to use a custom value instead, use `withNonce`: ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withNonce("my-custom-nonce") .start(this, authCallback); ``` diff --git a/articles/libraries/auth0-android/database-authentication.md b/articles/libraries/auth0-android/database-authentication.md index cc9c1453fe..430ed70c91 100644 --- a/articles/libraries/auth0-android/database-authentication.md +++ b/articles/libraries/auth0-android/database-authentication.md @@ -12,14 +12,14 @@ useCase: enable-mobile-auth # Auth0.Android Database Authentication ::: panel-warning Database authentication on Native Platforms -Username/Email & Password authentication from native applications is disabled by default for new tenants as of 8 June 2017. Users are encouraged to use the [Universal Login](/hosted-pages/login) and perform Web Authentication instead. If you still want to proceed you'll need to enable the Password Grant Type on your dashboard first. See [Application Grant Types](/applications/application-grant-types) for more information. +Username/Email & Password authentication from native applications is disabled by default for new tenants as of 8 June 2017. Users are encouraged to use Universal Login and perform Web Authentication instead. If you still want to proceed you'll need to enable the Password Grant Type on your dashboard first. See [Application Grant Types](/applications/concepts/application-grant-types) for more information. ::: ## Log in with a database connection To log in with a database connection, call `login` with the user's **email**, **password**, and the **connection** you wish to authenticate with. The response will be a Credentials object. -Additionally, specifying the **audience** will yield an OIDC conformant response during authentication. +Additionally, specifying the **audience** will yield an OIDC-conformant response during authentication. ```java authentication @@ -39,7 +39,7 @@ authentication ``` ::: note -The default scope used is `openid`. +The default scope used is `openid`. ::: ## Sign up with database connection diff --git a/articles/libraries/auth0-android/index.md b/articles/libraries/auth0-android/index.md index fa93edb568..adfdcc3f4d 100644 --- a/articles/libraries/auth0-android/index.md +++ b/articles/libraries/auth0-android/index.md @@ -25,19 +25,7 @@ Android API version 15 or newer is required. ## Installation -Auth0.Android is available through [Gradle](https://gradle.org/). To install it, simply add the following line to your `build.gradle` file: - -```gradle -dependencies { - compile "com.auth0.android:auth0:1.+" -} -``` - -::: note -You can check for the latest version on the repository [Readme](https://github.com/auth0/auth0.android#installation), in [Maven](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22auth0%22%20g%3A%22com.auth0.android%22), or in [JCenter](https://bintray.com/auth0/android/auth0). -::: - -After adding your Gradle dependency, make sure to remember to sync your project with Gradle files. +<%= include('../../quickstart/native/android/_includes/_gradle.md') %> ## Permissions @@ -76,11 +64,9 @@ account.setOIDCConformant(true); //Use the account in the API applications ``` -Passwordless authentication **cannot be used** with this flag set to `true`. For more information, please see the [OIDC adoption guide](/api-auth/tutorials/adoption). - ## Authentication via Universal Login -First go to the [Dashboard](${manage_url}/#/applications) and go to your application's settings. Make sure you have in **Allowed Callback URLs** a URL with the following format: +First, go to the [Dashboard](${manage_url}/#/applications) and go to your application's settings. Make sure you have in **Allowed Callback URLs** a URL with the following format: ``` https://${account.namespace}/android/{YOUR_APP_PACKAGE_NAME}/callback @@ -155,17 +141,17 @@ Finally, don't forget to add the internet permission: In versions 1.8.0 or lower of Auth0.Android you had to define the **intent-filter** inside your activity to capture the authentication result in the `onNewIntent` method and then call `WebAuthProvider.resume()` with the received data. The intent-filter declaration and resume call are no longer required for versions greater than 1.8.0, as it's now done internally by the library for you. ::: -Now, let's authenticate a user by presenting the universal [login page](hosted-pages/login): +Now, let's authenticate a user by presenting the universal [login page](/universal-login): ```java -WebAuthProvider.init(account) +WebAuthProvider.login(account) .withAudience("https://${account.namespace}/userinfo") .start(this, authCallback); ``` The authentication result will be delivered to the callback. -To ensure an Open ID Connect compliant response you must either set an `audience` using [withAudience](/libraries/auth0-android/configuration#withAudience) or enable the **OIDC Conformant** switch in your Auth0 dashboard under **Dashboard > Settings > Advanced > OAuth**. You can read more about this in the documentation page on [how to use new flows](/api-auth/intro#how-to-use-the-new-flows). +To ensure a response that complies with OpenID Connect (OIDC), you must either set an `audience` using [withAudience](/libraries/auth0-android/configuration#withAudience) or enable the **OIDC Conformant** switch in your Auth0 dashboard under **Dashboard > Settings > Advanced > OAuth**. You can read more about this in the documentation page on [how to use new flows](/api-auth/intro#how-to-use-the-new-flows). ## Using the Authentication API @@ -177,7 +163,7 @@ AuthenticationAPIClient authentication = new AuthenticationAPIClient(account); ### Get user information -To get the information associated with a given user's Access Token, you can call the `userInfo` endpoint, passing the token. +To get the information associated with a given user's Access Token, you can call the `userInfo` endpoint, passing the token. ```java authentication diff --git a/articles/libraries/auth0-android/passwordless.md b/articles/libraries/auth0-android/passwordless.md index 0033f024c8..166610f555 100644 --- a/articles/libraries/auth0-android/passwordless.md +++ b/articles/libraries/auth0-android/passwordless.md @@ -11,13 +11,28 @@ useCase: enable-mobile-auth --- # Auth0.Android Passwordless Authentication -<%= include('../../_includes/_native_passwordless_warning') %> +Passwordless can be done via email or via SMS, and either by sending the user a code, or sending them a link which contains a code. All of these methods of Passwordless authentication will require two steps - requesting the code, and then inputting the code for verification. -Passwordless can be done via email or via SMS, and either by sending the user a code, or sending them a link which contains a code. All of these methods of Passwordless authentication will require two steps - requesting the code, and then inputting the code for verification. +## Configure Auth0 and the Android SDK -Note that Passwordless authentication **cannot be used** with the [OIDC Conformant Mode](/api-auth/intro) enabled. +### Enable the Passwordless OTP Grant for the Application -## 1. Request the code +In order to be able to use the Passwordless API from a Native client, you first need to enable the Passwordless OTP grant for your application in **Dashboard > Applications > (YOUR APPLICATION) > Settings > Advanced Settings > Grant Types**. + +### Initialize the Android SDK + +Using the Passwordless API requires setting using the Auth0 Android SDK version 1.20 or higher, configured to work in OIDC conformant mode. This can be achieved by setting the `OIDCConformant` property to `true`: + +```java +Auth0 account = new Auth0("{YOUR_CLIENT_ID}", "{YOUR_DOMAIN}"); +//Configure the account in OIDC conformant mode +account.setOIDCConformant(true); +//Use the account in the API clients +``` + +## Implement Passwordless Authentication Steps + +## Request the code In this example, requesting the code is done by calling `passwordlessWithEmail` with the user's email, `PasswordlessType.CODE`, and the name of the connection as parameters. On success, you may wish to display a notice to the user that their code is on the way, and perhaps route them to the view where they will input that code. @@ -37,7 +52,9 @@ authentication }); ``` -## 2. Input the code +You can use the `passwordlessWithSms` method to send the code using SMS. + +## Input the code Once the user has a code, they can input it. Call the `loginWithEmail` method, and pass in the user's email, the code they received, and the name of the connection in question. Upon success, you will receive a Credentials object in the response. @@ -57,6 +74,8 @@ authentication }); ``` +You can use the `loginWithSms` method to send the code received by SMS and authenticate the user. + ::: note -The default scope used is `openid`. +The default scope used is `openid`. ::: diff --git a/articles/libraries/auth0-android/save-and-refresh-tokens.md b/articles/libraries/auth0-android/save-and-refresh-tokens.md index 6d7fd32311..c70ab2403e 100644 --- a/articles/libraries/auth0-android/save-and-refresh-tokens.md +++ b/articles/libraries/auth0-android/save-and-refresh-tokens.md @@ -11,17 +11,13 @@ useCase: enable-mobile-auth --- # Auth0.Android Saving and Renewing Tokens -When an authentication is performed with the `offline_access` scope included, it will return a [Refresh Token](/refresh-token) that can be used to request a new user token, without forcing the user to perform authentication again. +When an authentication is performed with the `offline_access` scope included, it will return a Refresh Token that can be used to request a new user token, without forcing the user to perform authentication again. ## Credentials Manager [Auth0.Android](https://github.com/auth0/Auth0.Android) provides a utility class to streamline the process of storing and renewing credentials. You can access the `accessToken` or `idToken` properties from the [Credentials](https://github.com/auth0/Auth0.Android/blob/master/auth0/src/main/java/com/auth0/android/result/Credentials.java) instance. This is the preferred method to manage user credentials. -First, add the library dependency to your build.gradle file: - -```gradle -compile 'com.auth0.android:auth0:1.+' -``` +Credential Managers are included as part of the Auth0.Android SDK. If this is not part of your dependencies yet, make sure to [check the documentation](/libraries/auth0-android). Next, decide which class to use depending on your Android SDK target version. @@ -62,7 +58,7 @@ manager.clearCredentials(); ### Retrieving Credentials -Because the credentials may need to be refreshed against Auth0 Servers, this method is asynchronous. Pass a callback implementation where you'd like to receive the credentials. Credentials returned by this method upon success are always valid. +Because the credentials may need to be refreshed against Auth0 Servers, this method is asynchronous. Pass a callback implementation where you'd like to receive the credentials. Credentials returned by this method upon success are always valid. ```java manager.getCredentials(new BaseCallback() { @@ -106,7 +102,7 @@ The methods to obtain, save, check for existence and clearing the credentials ar ### Pre-Authenticate the User -This class provides optional functionality for additional authentication using the device's configured Lock Screen. If the Lock Screen Security is set to something different than PIN, Pattern, Password or Fingerprint, this feature won't be available. You need to call the method below to enable the authentication. Pass a valid `Activity` context, a request code, and 2 optional Strings to use as title and description for the Lock Screen. +This class provides optional functionality for additional authentication using the device's configured Lock Screen. If the Lock Screen Security is set to something different than PIN, Pattern, Password or Fingerprint, this feature won't be available. You need to call the method below to enable the authentication. Pass a valid `Activity` context, a request code, and 2 optional Strings to use as title and description for the Lock Screen. ```java private static final int RC_UNLOCK_AUTHENTICATION = 123; @@ -128,3 +124,12 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); } ``` + +### Handling usage exceptions + +In the event that something happened while trying to save or retrieve the Credentials, a `CredentialsManagerException` will be thrown. These are some of the failure scenarios you can expect: + +- The Credentials to be stored are invalid, e.g. some of the following fields are not defined: access_token, id_token or expires_at. +- The stored Credentials have expired but there is no refresh_token available to renew them automatically. +- Device's Lock Screen security settings have changed (e.g. the security PIN code was changed). Even when `hasCredentials` returns _true_, the encryption keys will be deemed invalid and until `saveCredentials` is called again it won't be possible to decrypt any previously existing content, since they keys used back then are not the same as the new ones. +- Device is not compatible with some of the cryptography algorithms required by the `SecureCredentialsManager` class. This is considered a _catastrophic event_ and is the only exception that will prevent you from using this implementation. This scenario happens when the OEM has modified the Android ROM of the device removing some of the algorithms officially included in every Android distribution. Nevertheless, you can check if this is the case in the exception instance itself by calling the `isDeviceIncompatible` method. By doing so you can decide the fallback implementation for storing the Credentials, such as using the regular `CredentialsManager` class. diff --git a/articles/libraries/auth0-android/user-management.md b/articles/libraries/auth0-android/user-management.md index a0a102a828..51c085825e 100644 --- a/articles/libraries/auth0-android/user-management.md +++ b/articles/libraries/auth0-android/user-management.md @@ -13,11 +13,11 @@ useCase: enable-mobile-auth The Management API provides functionality that you can use to manage users of your application, including tasks such as the following. -* Link separate user accounts from different providers, tying them to a single profile (Read more about [Linking Accounts](/link-accounts) with Auth0) +* Link separate user accounts from different providers, tying them to a single profile (See [User Account Linking](/users/concepts/overview-user-account-linking) for details.) * Unlink user accounts, returning them to separate identities -* Update user [metadata](/metadata) +* Update [user metadata](/users/concepts/overview-user-metadata) -## Initializing the API Application +## Initialize the UsersAPIClient To get started, create a new `UsersAPIClient` instance by passing it the `account` and the token for the primary identity. In the case of linking users, this primary identity is the user profile that you want to "keep" the data for, and which you plan to link other identities to. @@ -26,9 +26,9 @@ Auth0 account = new Auth0("${account.clientId}", "${account.namespace}"); UsersAPIClient users = new UsersAPIClient(account, "token"); ``` -## Linking users +## Link users -Linking user accounts will allow a user to authenticate from any of their accounts and no matter which one they use, still pull up the same profile upon login. Auth0 treats all of these accounts as separate profiles by default, so if you wish a user's accounts to be linked, this is the way to go. +Linking user accounts will allow a user to authenticate from any of their accounts and no matter which one they use, still pull up the same profile upon login. Auth0 treats all of these accounts as separate profiles by default, so if you wish a user's accounts to refer to the same profile, you must perform account linking. The `link` method accepts two parameters, the primary user id and the secondary user token (the token obtained after login with this identity). The user id in question is the unique identifier for this user account. If the id is in the format `facebook|1234567890`, the id required is the portion after the delimiting pipe. @@ -48,7 +48,7 @@ users }); ``` -## Unlinking users +## Unlink users Unlinking users is a similar process to the linking of users. The `unlink` method takes three parameters, though: the primary user id, the secondary user id, and the secondary provider (of the secondary user). diff --git a/articles/libraries/auth0-php/authentication-api.md b/articles/libraries/auth0-php/authentication-api.md new file mode 100644 index 0000000000..570ccc6e83 --- /dev/null +++ b/articles/libraries/auth0-php/authentication-api.md @@ -0,0 +1,205 @@ +--- +section: libraries +toc: true +description: Using Auth0's Authentication API with your PHP applications. +topics: + - libraries + - php +contentType: + - how-to + - reference +useCase: + - add-login +--- +# PHP: Using the Authentication API + +The Auth0 PHP SDK provides a `Auth0\SDK\API\Authentication` class, which houses the methods you can use to access the [Authentication API](/api/authentication) directly. Please note that this interface is intended for more advanced applications and in general does provide a means of keeping track of user sessions. For most use cases, you'll want to work with the [Auth0 base class](/libraries/auth0-php/basic-use). + +In this article, you'll find examples of common authentication operations. + +## Prerequisites + +The documentation below assumes that you followed the steps in the [PHP getting started guide](/libraries/auth0-php), and continue off from the code provided there. + +## Authorization Code Flow + +An [Authorization Code grant](/api-auth/tutorials/authorization-code-grant) is the basic way to grant users access to your application. This flow is the same one used on the [Basic Use page](/libraries/auth0-php/basic-use#login). If you need more granular control over the login or callback process, this section walks through how to use the Authentication API directly. + +Users must authenticate with Auth0 to generate the authorization code. This is done by redirecting to the `/authorize` endpoint for your tenant domain. The following code would appear on a page that requires authentication: + +```php +// 👆 We're continuing from the "getting started" guide linked in "Prerequisites" above. Append this to the index.php file you created there. + +// Setup a PHP session, which we'll use as a custom session store for the authenticated user. +session_start(); + +// $user will be null if no session is available; otherwise it will contain user data. +$user = $_SESSION['user'] ?? null; + +// Has the user authenticated with us yet? +if ($user === null) { + // Generates cryptographically secure pseudo-random bytes to use as a CSRF mitigating value. + // Store this for retrieval after authentication. + $_SESSION['state'] = bin2hex(random_bytes(16)); + + // Generate the authorize URL, and redirect the user to it. + header('Location: ' . $auth0->authentication()->getLoginLink($_SESSION['state'])); + exit; +} + +echo '

    Sensitive data!

    '; +``` + +The process above does the following: + +1. We check if there is an authenticated user state stored in our custom session handler. Your application might handle user sessions differently. +2. If there is no session, then we need to log the user in by redirecting them to the Universal Login Page. +3. We set a state value with the login request and then verify that value when the code is returned on the callback URL. We're storing this in our PHP session under the 'state' key. +4. The `getLoginLink()` call builds the correct `/authorize` link with the correct response type (`code` in this case), redirect URI (wherein the application we will handle the response, explained below), and state (from above). +5. We then redirect to this URL and wait for the user to be redirected back to us. + +After authentication, the user is redirected back to our application at the callback URL, which is handled with the following: + +```php +// 👆 We're continuing from the "getting started" guide linked in "Prerequisites" above. Append this to the index.php file you created there. + +// Ensure we have our PHP session open so we can retrieve our stored state for comparison. +session_start(); + +// Extract `code` and `state` parameters from the request query, if present. +$code = filter_var($_GET['code'] ?? null, FILTER_UNSAFE_RAW, FILTER_NULL_ON_FAILURE); +$state = filter_var($_GET['state'] ?? null, FILTER_UNSAFE_RAW, FILTER_NULL_ON_FAILURE); + +// Check if a code is present in the request query. +if ($code === null) { + die('No authorization code found.'); +} + +// Check if a state is present, and compare it with the one we generated and stored before redirecting the user. +if ($state === null || $state !== $_SESSION['state']) { + die('Invalid state.'); +} + +// We have compared states, we should discard this stored value now. +unset($_SESSION['state']); + +// Attempt to get an access_token with the code returned and original redirect URI. (This returns a PSR-7 ResponseInterface.) +$response = $auth0->authentication()->codeExchange($code); + +// Does the status code of the response indicate failure? +if ($response->getStatusCode() !== 200) { + die("Code exchange failed."); +} + +// Decode the JSON response into a PHP array: +$response = json_decode(response->getBody()->__toString(), true, 512, JSON_THROW_ON_ERROR); + +// Create an array to store our session information in. +$session = [ + 'id_token' => $response['id_token'] ?? null, + 'access_token' => $response['access_token'] ?? null, + 'scope' => $response['scope'] ?? null, + 'refresh_token' => $response['refresh_token'] ?? null, + 'expires_in' => $response['expires_in'] ?? null, + 'user' => null +]; + +// We retrieved an ID token; let's process it! +if ($session['id_token'] !== null) { + // The Auth0 SDK includes a helpful token processing utility we'll leverage for this: + $token = new \Auth0\SDK\Token($auth0->configuration(), $session['id_token'], \Auth0\SDK\Token::TYPE_ID_TOKEN); + + // Verify the token, and validate it's claims. These will throw an \Auth0\SDK\Exception\InvalidTokenException if a check fails. + $token->verify(); + $token->validate(); + + $session['user'] => $token->toArray(); +} + +// Store our authenticated session state. +$_SESSION['user'] = $session; + +// Let's echo the user claims/identity as a demo of a successful authentication flow: +print_r($session['user']); +``` + +Walking through the process in detail: + +1. We look for a `code` parameter in a request query. If it's missing, we abort authentication. +2. We check to make sure we have a `state` value and make sure it matches the same one we generated. This is important to avoid CSRF attacks ([more information](/protocols/oauth2/mitigate-csrf-attacks).) +3. We attempt a code exchange with the `codeExchange()` call, making sure to pass in the `code` Auth0 gave our application when it returned the authenticating user back to us. +4. If this succeeds, we know the exchange was successful, and we have an ID Token and an Access Token among other potential values. +5. We validate the ID Token and use the claims for the user identity. +6. If this last step succeeds, we store the user and redirect back to our sensitive data. + +## Client Credentials Flow + +A [Client Credentials grant](/api-auth/tutorials/client-credentials) gives an application access to a specific API based on the scopes set in the Auth0 Dashboard. This is how applications can, for example, make calls to the Management API. Successful authentication will result in an Access Token being issued for the API requested. + +First, turn on the **Client Credentials** grant on then **Advanced settings > Grant Types** tab on the Application settings page. + +Next, authorize the Application for the API being used on the **Machine to Machine Applications** tab on the API's **Settings** page. Make sure all necessary scopes are selected (but no more) and **Update**. Switch back to the **Settings** tab and copy the **Identifier** value. This needs to be added to a `AUTH0_MANAGEMENT_AUDIENCE` key in your `.env` file. + +Request an Access Token for the API using the example below: + +```php +// 👆 We're continuing from the "getting started" guide linked in "Prerequisites" above. + +// Begin a client credentials exchange: +$response = $auth0->authentication()->clientCredentials([ + 'audience' => $env['AUTH0_MANAGEMENT_AUDIENCE'] +]); + +// Does the status code of the response indicate failure? +if ($response->getStatusCode() !== 200) { + die("Code exchange failed."); +} + +// Decode the JSON response into a PHP array: +$response = json_decode(response->getBody()->__toString(), true, 512, JSON_THROW_ON_ERROR); + +// Echo the response to the browser +print_r($response, true); +``` + +If the grant was successful, you should see something like the following: + +``` +Array +( + [access_token] => eyJ0eXAi...eyJpc3Mi...QoB2c24w + [scope] => read:users read:clients ... + [expires_in] => 86400 + [token_type] => Bearer +) +``` + +See the [Management API page](/libraries/auth0-php/management-api) for more information on how to use this Access Token. + +## Single Sign-on Logout + +While destroying the local session with a `session_destroy()` would be sufficient in deauthenticating a user from your application, you should close your end user's session with Auth0 as well. This ensures that the next time the user sees an Auth0 login form, they will be required to provide their credentials to log in. + +First, determine where the user should end up after the logout has completed. Save this in the Auth0 Application settings in the "Allowed Logout URLs" field. Also, add an `AUTH0_LOGOUT_RETURN_URL` key with this URL as the value in your `.env` file. + +Add the following to your application logout code: + +```php +// 👆 We're continuing from the "getting started" guide linked in "Prerequisites" above. + +// Deauthenticate the user's local session in your application. +session_destroy(); + +// Redirect to Auth0's logout URL to end their Auth0 session: +header("Location: " . $auth0->authentication()->getLogoutLink($env['AUTH0_LOGOUT_RETURN_URL']); +``` + +### Read more + +::: next-steps +* [PHP Getting Started](/libraries/auth0-php) +* [PHP Basic Use](/libraries/auth0-php/basic-use) +* [PHP Management API](/libraries/auth0-php/management-api) +* [PHP JWT Validation](/libraries/auth0-php/jwt-validation) +* [PHP Troubleshooting](/libraries/auth0-php/troubleshooting) +::: diff --git a/articles/libraries/auth0-php/basic-use.md b/articles/libraries/auth0-php/basic-use.md new file mode 100644 index 0000000000..758fd798ad --- /dev/null +++ b/articles/libraries/auth0-php/basic-use.md @@ -0,0 +1,110 @@ +--- +section: libraries +toc: true +description: Integrate a frictionless login and signup experience for your PHP applications. +topics: + - libraries + - php +contentType: + - how-to + - reference +useCase: + - add-login +--- +# PHP: Basic Usage + +The Auth0 PHP SDK bundles three core classes: `Auth0\SDK\Auth0`, `Auth0\SDK\API\Authentication` and `Auth0\SDK\API\Management`, each offering interfaces for different functionality across Auth0's APIs. If you're building a stateful web application that needs to keep track of users' sessions, the base `Auth0` class is what you'll be working with the most. It provides methods for handling common authentication and session handling tasks such as logging in and out, retrieving user credentials, checking of an available session, and callback handling. These tasks are explained below. + +## Prerequisites + +The documentation below assumes that you followed the steps in the [PHP getting started guide](/libraries/auth0-php), and continue off from the code provided there. + +## Logging In + +The default login process in the PHP SDK uses an [Authentication Code grant](/api-auth/tutorials/authorization-code-grant) combined with Auth0's Universal Login Page. In short, that process is: + +1. A user requesting access is redirected to the Universal Login Page. +2. The user authenticates using one of [many possible connections](https://auth0.com/docs/identityproviders): social (Google, Twitter, Facebook), database (email and password), passwordless (email, SMS), or enterprise (ActiveDirectory, ADFS, Office 365). +3. The user is redirected or posted back to your application's callback URL with `code` and `state` values if successful or an `error` and `error_description` if not. +4. If the authentication was successful, the `state` value is validated. +5. If the `state` is valid, the `code` value is exchanged with Auth0 for an ID Token and/or an Access Token. +6. The identity from the ID token can be used to create an account, to start an application-specific session, or to persist as the user session. + +Auth0-PHP handles most of these steps automatically for you. Your application will need to: + +1. Call `Auth0\SDK\Auth0::login()` when users need to login (for example: click a link, visit walled content, etc.) +2. Call `Auth0\SDK\Auth0::exchange()` when users are redirected to your callback URL. +3. Call `Auth0\SDK\Auth0::getCredentials()` when you need to check if a user is logged in and retrieve user information. + +A simple implementation of these steps looks like this: + +```php +// 👆 We're continuing from the "getting started" guide linked in "Prerequisites" above. Append this to the index.php file you created there. + +// getExchangeParameters() can be used on your callback URL to verify all the necessary parameters are present for post-authentication code exchange. +if ($auth0->getExchangeParameters()) { + // If they're present, we should perform the code exchange. + $auth0->exchange(); +} + +// Check if the user is logged in already +$session = $auth0->getCredentials(); + +if ($session === null) { + // User is not logged in! + // Redirect to the Universal Login Page for authentication. + header("Location: " . $auth0->login()); + exit; +} + +// 🎉 At this point we have an authenticated user session accessible from $session; your application logic can continue from here! +echo "Authenticated!"; +``` + +Finally, you'll need to add you're application's URL to your Auth0 Application's "Allowed Callback URLs" field on the settings page. After that, loading your scripted page should: + +1. Immediately redirect you to an Auth0 login page for your tenant. +2. After successfully logging in using any connection, redirect you back to your app. +3. Display a simple page showing 'Authenticated!'. + +## Profile + +Now that we have authenticated a user, we can work with their persisted session data to do things like display user profiles. + +```php +// 👆 We're continuing from code above. Append this to the index.php file. + +printf( + '

    Hi %s!

    +

    +

    Last update: %s

    +

    Contact: %s %s

    +

    Logout

    ', + isset($session->user['nickname']) ? strip_tags($session->user['nickname']) : '[unknown]', + isset($session->user['picture']) ? filter_var($session->user['picture'], FILTER_SANITIZE_URL) : 'https://gravatar.com/avatar/', + isset($session->user['updated_at']) ? date('j/m/Y', strtotime($session->user['updated_at'])) : '[unknown]', + isset($session->user['email']) ? filter_var($session->user['email'], FILTER_SANITIZE_EMAIL) : '[unknown]', + ! empty($session->user['email_verified']) ? '✓' : '✗' +); +``` + +## Logout + +In addition to logging in, we also want users to be able to log out. When users log out, they must invalidate their session for the application. For this SDK, that means destroying their persistent user and token data: + +```php +// Log out of the application. +header("Location: $auth0->logout()); +``` + +If you're using Single Sign-on (SSO) and also want to end their Auth0 session, see the [SSO Logout section here](/libraries/auth0-php/authentication-api#sso-logout). More information about logging out, in general, can be found [here](/logout). + +### Read more + +::: next-steps +* [PHP Getting Started](/libraries/auth0-php) +* [PHP Authentication API](/libraries/auth0-php/authentication-api) +* [PHP Management API](/libraries/auth0-php/management-api) +* [PHP JWT Validation](/libraries/auth0-php/jwt-validation) +* [PHP Troubleshooting](/libraries/auth0-php/troubleshooting) +::: diff --git a/articles/libraries/auth0-php/index.md b/articles/libraries/auth0-php/index.md new file mode 100644 index 0000000000..666ad55e32 --- /dev/null +++ b/articles/libraries/auth0-php/index.md @@ -0,0 +1,113 @@ +--- +section: libraries +toc: true +description: Integrate a frictionless login and signup experience for your PHP applications. +url: /libraries/auth0-php +topics: + - libraries + - php +contentType: + - how-to + - index + - reference +useCase: + - add-login +--- +# PHP: Getting Started + +The Auth0-PHP SDK can integrate into your PHP applications to provide a straightforward way to log your users in and to sign them up in your app. It provides support for social identity providers such as Facebook, Google, or Twitter, as well as enterprise providers such as Active Directory. The SDK provides convenient methods for accessing Auth0's Authentication and Management endpoints. + +The Auth0-PHP repository is open source and [hosted on GitHub](https://github.com/auth0/auth0-PHP). We appreciate all contributions, including bug reports, enhancement proposals, and pull requests. + +## Requirements + +- PHP 7.4+ (8.0+ recommended) +- [Composer](https://getcomposer.org/doc/00-intro.md) 2 + +## Installation + +Installing the Auth0 PHP SDK requires [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos), the standard dependency management utility for PHP. Composer allows you to declare the dependent libraries your project needs and installs them for you. Please ensure Composer is installed and accessible from your shell before continuing. + +Next, run the following shell command within your project directory to install the SDK: + +```sh +composer require auth0/auth0-php +``` + +This will create a `vendor` folder within your project and download all the dependencies needed to use the PHP SDK. This will also create a `vendor/autoload.php` file necessary for the SDK to work with your application, which we'll import later. + +## Getting Started + +To use the Auth0 Authentication and Management APIs, you'll need a free Auth0 account and an Application: + +1. Go to [auth0.com/signup](https://auth0.com/signup) and create an account. +2. From your dashboard, go to **Applications**, then **Create Application**. +3. Give your Application a name, select **Regular Web Application**, then **Create** +4. Click the **Settings** tab for the required credentials used below. More information about these settings is [here](/dashboard/reference/settings-application). + +### Configure the SDK + +You should use [environment variables](https://secure.php.net/manual/en/reserved.variables.environment.php) to store and load sensitive Auth0 credentials. This eliminates the need for hardcoding them into your application. Let's create an `.env` file within the root of our project directory to store our application's credentials: + +```sh +# The URL of our Auth0 Tenant Domain. +# If we're using a Custom Domain, be sure to set this to that value instead. +AUTH0_DOMAIN='https://${account.namespace}' + +# Our Auth0 application's Client ID. +AUTH0_CLIENT_ID='${account.clientId}' + +# Our Auth0 application's Client Secret. +AUTH0_CLIENT_SECRET='${account.clientSecret}' + +# A long secret value we'll use to encrypt session cookies. This can be generated using `openssl rand -hex 32` from our shell. +AUTH0_COOKIE_SECRET='SEE COMMENT ABOVE' + +# The base URL of our application. +AUTH0_BASE_URL='http://127.0.0.1:3000' +``` + +You should never commit this file to version control or share it in an unsecure manner. The contents should be handled with care and treated like a password. + +As PHP is unable to read our `.env` file natively, you'll need to install a PHP library to do so. For the purposes of this documentation we'll be using `vlucas/phpdotenv`, but any 'dotenv' library you prefer will work. From our project directory, run the following shell command to install the library: + +```sh +composer require vlucas/phpdotenv +``` + +### Initialize the SDK + +We're ready to configure and initialize an instance of the SDK within our new PHP application. Let's start by creating the PHP source file we'll be working with for this demonstration, `index.php`, and use the following snippet to get started: + +```php +load(); + +// Now instantiate the Auth0 class with our configuration: +$auth0 = new \Auth0\SDK\Auth0([ + 'domain' => $env['AUTH0_DOMAIN'], + 'clientId' => $env['AUTH0_CLIENT_ID'], + 'clientSecret' => $env['AUTH0_CLIENT_SECRET'], + 'cookieSecret' => $env['AUTH0_COOKIE_SECRET'] +]); +``` + +Congratulations, your application is now setup and ready to use with Auth0! You can now move on to building an example application using one of our PHP quickstarts. Choose the type of application you're looking to build to follow along with a quickstart suited for your needs: + +* [PHP Web Application](/quickstart/webapp/php/) +* [PHP Backend API](/quickstart/backend/php/) + +## Next Steps + +::: next-steps +* [PHP Basic Usage](/libraries/auth0-php/basic-use) +* [PHP Authentication API](/libraries/auth0-php/authentication-api) +* [PHP Management API](/libraries/auth0-php/management-api) +* [PHP JWT Validation](/libraries/auth0-php/jwt-validation) +* [PHP Troubleshooting](/libraries/auth0-php/troubleshooting) +::: diff --git a/articles/libraries/auth0-php/jwt-validation.md b/articles/libraries/auth0-php/jwt-validation.md new file mode 100644 index 0000000000..3c98d21c19 --- /dev/null +++ b/articles/libraries/auth0-php/jwt-validation.md @@ -0,0 +1,75 @@ +--- +section: libraries +toc: true +description: Validating JSON Web Tokens (JWTs) with your PHP applications. +topics: + - libraries + - php +contentType: + - how-to + - reference +--- +# PHP: Validating JWTs + +The Auth0 PHP SDK provides a `Auth0\SDK\Token` class used for processing JSON Web Tokens (JWT). It enables you to decode, validate and verify tokens for use by your application. More information on JWTs and how to build and decode them can be found [jwt.io](https://jwt.io/). + +The class can process both HS256 and RS256 tokens. Both types require the algorithm and valid audiences to be configured with the SDK before processing. HS256 tokens require the client secret to be configured. RS256 tokens require an authorized issuer, which is used to fetch a JWKs file during the decoding process. + +## Prerequisites + +The documentation below assumes that you followed the steps in the [PHP getting started guide](/libraries/auth0-php), and continue off from the code provided there. + +## Example Usage + +The following is an example of a small, URL-based JSON Web Token processor based on the SDK's `Token` class. + +```php +load(); + +$token = filter_var($_GET['token'] ?? null, FILTER_UNSAFE_RAW, FILTER_NULL_ON_FAILURE); +$algorithm = filter_var($_GET['algorithm'] ?? 'HS256', FILTER_UNSAFE_RAW, FILTER_NULL_ON_FAILURE); + +if ($token === null) { + die('No `token` request parameter.'); +} + +if (! in_array($algorithm, ['HS256', 'RS256'])) { + die('Invalid `algorithm` supplied.'); +} + +// The Auth0 SDK includes a helpful token processing utility we'll leverage for this: +$token = new \Auth0\SDK\Token([ + 'domain' => $env['AUTH0_DOMAIN'], + 'clientId' => $env['AUTH0_CLIENT_ID'], + 'clientSecret' => $env['AUTH0_CLIENT_SECRET'], + 'tokenAlgorithm' => $algorithm +], $token, \Auth0\SDK\Token::TYPE_ID_TOKEN); + +// Verify the token: (This will throw an \Auth0\SDK\Exception\InvalidTokenException if verification fails.) +$token->verify(); + +// Validate the token claims: (This will throw an \Auth0\SDK\Exception\InvalidTokenException if validation fails.) +$token->validate(); + +echo '
    ';
    +print_r($token->toArray(), true);
    +echo '
    '; +``` + +Both `verify()` and `validate()` offer a number of options arguments that can be used to customize their behavior, including validating nonce claims, restricting maximum time since a token's `auth_time`, `leeway` clock tolerance for time checks, and more. These methods are fully commented for review of these options either via the source code or your IDE of choice. + +### Read more + +::: next-steps +* [PHP Getting Started](/libraries/auth0-php) +* [PHP Basic Use](/libraries/auth0-php/basic-use) +* [PHP Authentication API](/libraries/auth0-php/authentication-api) +* [PHP Management API](/libraries/auth0-php/management-api) +* [PHP Troubleshooting](/libraries/auth0-php/troubleshooting) +::: diff --git a/articles/libraries/auth0-php/management-api.md b/articles/libraries/auth0-php/management-api.md new file mode 100644 index 0000000000..2fbae10fe9 --- /dev/null +++ b/articles/libraries/auth0-php/management-api.md @@ -0,0 +1,123 @@ +--- +section: libraries +toc: true +description: Using Auth0's Management API with your PHP applications. +topics: + - libraries + - php +contentType: + - how-to + - reference +--- +# PHP: Using the Management API + +The Auth0 PHP SDK provides a `Auth0\SDK\API\Management` class, which houses the methods you can use to access the [Management API](/api/management/v2) and perform operations on your Auth0 tenant. Using this interface, you can easily: + +- Search for and create users +- Create and update Applications +- Retrieve log entries +- Manage rules + +... and much more. See our [APi reference](/api/management/v2) for information on what's possible! + +## Authentication + +To use the Management API, you must authenticate one of two ways: + +- For temporary access or testing, you can [manually generate an API token](/api/management/v2/tokens#get-a-token-manually) and save it in your `.env` file. +- For extended access, you must create and execute and Client Credentials grant when access is required. This process is detailed on the [Authentication API page](/libraries/auth0-php/authentication-api#regular-web-app-login-flow). + +Regardless of the method, the token generated must have the scopes required for the operations your app wants to execute. Consult the [API documentation](/api/management/v2) for the scopes required for the specific endpoint you're trying to access. + +To grant the scopes needed: + +1. Go to [APIs](https://manage.auth0.com/#/apis) > Auth0 Management API > **Machine to Machine Applications** tab. +2. Find your Application and authorize it. +3. Click the arrow to expand the row and select the scopes required. + +Now you can authenticate one of the two ways above and use that token to perform operations: + +```php +// 👆 We're continuing from the "getting started" guide linked in "Prerequisites" above. Append this to the index.php file you created there. + +if (isset($env['AUTH0_MANAGEMENT_API_TOKEN'])) { + $auth0->configuration()->setManagementToken($env['AUTH0_MANAGEMENT_API_TOKEN']); +} + +// Create a configured instance of the `Auth0\SDK\API\Management` class, based on the configuration we setup the SDK ($auth0) using. +// If no AUTH0_MANAGEMENT_API_TOKEN is configured, this will automatically perform a client credentials exchange to generate one for you, so long as a client secret is configured. +$management = $auth0->management(); +``` + +The `Management` class stores access to endpoints as factory methods of its instances, for example `$management->users()` returns an instance of `Auth0\SDK\API\Management\Users` that you can use to interact with the /users Management API endpoints. + +### Example: Search Users + +This endpoint is documented [here](/api/management/v2#!/Users/get_users). + +```php +// 👆 We're continuing from the code above. Append this to your source code file. + +$response = $management->users()->getAll(['q' => 'josh']); + +// Does the status code of the response indicate failure? +if ($response->getStatusCode() !== 200) { + die("API request failed."); +} + +// Decode the JSON response into a PHP array: +$response = json_decode(response->getBody()->__toString(), true, 512, JSON_THROW_ON_ERROR); + +if (! empty($response)) { + echo '

    User Results

    '; + + foreach ($response as $result) { + printf( + '

    %s <%s> - %s

    ', + !empty($result['nickname']) ? $result['nickname'] : 'No nickname', + !empty($result['email']) ? $result['email'] : 'No email', + $result['user_id'] + ); + } +} +``` + +### Example: Get All Clients + +This endpoint is documented [here](/api/management/v2#!/Clients/get_clients). + +```php +// 👆 We're continuing from the code above. Append this to your source code file. + +$response = $management->clients()->getAll(['q' => 'josh']); + +// Does the status code of the response indicate failure? +if ($response->getStatusCode() !== 200) { + die("API request failed."); +} + +// Decode the JSON response into a PHP array: +$response = json_decode(response->getBody()->__toString(), true, 512, JSON_THROW_ON_ERROR); + +if (! empty($response)) { + echo '

    Get All Clients

    '; + + foreach ($response as $result) { + printf( + '

    %s - %s

    ', + $result['name'], + $result['client_id'] + ); + } +} +``` + +### Read more + +::: next-steps +* [PHP Introduction](/libraries/auth0-php) +* [PHP Basic Use](/libraries/auth0-php/basic-use) +* [PHP Authentication API](/libraries/auth0-php/authentication-api) +* [PHP JWT Validation](/libraries/auth0-php/jwt-validation) +* [PHP Troubleshooting](/libraries/auth0-php/troubleshooting) +::: diff --git a/articles/libraries/auth0-php/troubleshooting.md b/articles/libraries/auth0-php/troubleshooting.md new file mode 100644 index 0000000000..cbd531246b --- /dev/null +++ b/articles/libraries/auth0-php/troubleshooting.md @@ -0,0 +1,40 @@ +--- +section: libraries +toc: true +description: Troubleshooting commons issues with your PHP applications. +topics: + - libraries + - php +contentType: + - reference +--- +# PHP: Troubleshooting the SDK + +The following is a list of issues you might see when using the Auth0 PHP library and how you might troubleshoot these issues. + +### I'm getting an "Invalid State" exception when trying to log in. + +[State validation](https://auth0.com/docs/protocols/oauth2/oauth-state) was added in 5.1.0 for improved security. By default, this uses session storage and will happen automatically if you are using a combination of `Auth0::login()` and any method which calls `Auth0::exchange()` in your callback. + +If your users encounter this error: +- Ensure your application is not accidentally invoking `Auth0::login()` more than once, which could invalidate the state stored on the end user's device. +- The end user is using a modern browser on their device and not blocking cookies. + +### I am getting `curl error 60: SSL certificate problem: self-signed certificate in certificate chain` on Windows + +This is a common issue with the latest PHP versions under **Windows OS** (it is related to an incompatibility between Windows and OpenSSL CA's database). + +1. Download this CA database `https://curl.haxx.se/ca/cacert.pem` to `c:/cacert.pem`. +2. Edit your php.ini and add `openssl.cafile=c:/cacert.pem`. (It should point to the file you downloaded.) + +### My host does not allow using Composer + +The PHP SDK requires Composer for maintaining dependencies (external PHP libraries). If Composer is now allowed to be installed globally on your host, you can still install it locally to run on your user shell account. Instructions for this can be found on the Composer website: https://getcomposer.org/doc/00-intro.md#locally + +## Keep reading + +* [PHP Introduction](/libraries/auth0-php) +* [PHP Basic Use](/libraries/auth0-php/basic-use) +* [PHP Authentication API](/libraries/auth0-php/authentication-api) +* [PHP Management API](/libraries/auth0-php/management-api) +* [PHP JWT Validation](/libraries/auth0-php/jwt-validation) diff --git a/articles/libraries/auth0-react/index.md b/articles/libraries/auth0-react/index.md new file mode 100644 index 0000000000..c490c1e05e --- /dev/null +++ b/articles/libraries/auth0-react/index.md @@ -0,0 +1,232 @@ +--- +section: libraries +toc: true +title: Auth0 React SDK +description: Auth0 SDK for React Single Page Applications. +topics: + - libraries + - auth0-react +contentType: + - index +--- + + + +# Auth0 React SDK + + +The Auth0 React SDK is a JavaScript library for implementing authentication & authorization in React apps with Auth0. It provides a custom React hook and other Higher Order Components so you can secure React apps using best practices while writing less code. + +The Auth0 React SDK handles grant and protocol details, token expiration and renewal, as well as token storage and caching. Under the hood, it implements [Universal Login](/universal-login) and the [Authorization Code Grant Flow with PKCE](/api-auth/tutorials/authorization-code-grant-pkce). + +The library is [hosted on GitHub](https://github.com/auth0/auth0-react) where you can [read more about the API](https://auth0.github.io/auth0-react/). + +## Installation + +Using [npm](https://npmjs.org): + +```sh +npm install @auth0/auth0-react +``` + +Using [yarn](https://yarnpkg.com): + +```sh +yarn add @auth0/auth0-react +``` + +## Getting Started + +First, you'll need to wrap your application in a single `Auth0Provider` component. This will provide the React Context to components that are placed inside your application. + +```jsx +import React from 'react'; +import ReactDOM from 'react-dom'; +import { Auth0Provider } from '@auth0/auth0-react'; +import App from './App'; + +ReactDOM.render( + + + , + document.getElementById('app') +); +``` + +Use the `useAuth0` hook in your components to access the React Context's authentication state (`isLoading`, `isAuthenticated` and `user`) and authentication methods (`loginWithRedirect` and `logout`). + +### isLoading and error + +Wait for the SDK to initialise and handle any errors with the `isLoading` and `error` states. + +```jsx +import React from 'react'; +import { useAuth0 } from '@auth0/auth0-react'; + +function Wrapper({ children }) { + const { + isLoading, + error, + } = useAuth0(); + + if (isLoading) { + return
    Loading...
    ; + } + if (error) { + return
    Oops... {error.message}
    ; + } + return <>{children}; +} + +export default Wrapper; +``` + +### Login + +Use `loginWithRedirect` or `loginWithPopup` to log your users in. + +```jsx +import React from 'react'; +import { useAuth0 } from '@auth0/auth0-react'; + +function LoginButton() { + const { + isAuthenticated, + loginWithRedirect, + } = useAuth0(); + + return !isAuthenticated && ( + + ); +} + +export default LoginButton; +``` + +### Logout + +Use `logout` to log your users out. Make sure `returnTo` is specified in "Allowed Logout URLs" in your Auth0 Dashboard. + +```jsx +import React from 'react'; +import { useAuth0 } from '@auth0/auth0-react'; + +function LogoutButton() { + const { + isAuthenticated, + logout, + } = useAuth0(); + + return isAuthenticated && ( + + ); +} + +export default Logout; +``` + +### User + +Access user profile information with the `user` value. + +```jsx +import React from 'react'; +import { useAuth0 } from '@auth0/auth0-react'; + +function Profile() { + const { user } = useAuth0(); + + return
    Hello {user.name}
    ; +} + +export default Profile; +``` + +### Use with a class component + +Use the `withAuth0` Higher Order Component to add the `auth0` property to class components instead of using the hook. + +```jsx +import React, { Component } from 'react'; +import { withAuth0 } from '@auth0/auth0-react'; + +class Profile extends Component { + render() { + const { user } = this.props.auth0; + return
    Hello {user.name}
    ; + } +} + +export default withAuth0(Profile); +``` + +### Protect a route + +Protect a route component using the `withAuthenticationRequired` higher order component. Visits to this route when unauthenticated will redirect the user to the login page and back to this page after login. + +```jsx +import React from 'react'; +import { withAuthenticationRequired } from '@auth0/auth0-react'; + +const PrivateRoute = () => (
    Private
    ); + +export default withAuthenticationRequired(PrivateRoute, { + // Show a message while the user waits to be redirected to the login page. + onRedirecting: () => (
    Redirecting you to the login page...
    ) +}); +``` + +**Note** If you are using a custom router, you will need to supply the `Auth0Provider` with a custom `onRedirectCallback` method to perform the action that returns the user to the protected page. See examples for [react-router](https://github.com/auth0/auth0-react/blob/master/EXAMPLES.md#protecting-a-route-in-a-react-router-dom-v6-app), [Gatsby](https://github.com/auth0/auth0-react/blob/master/EXAMPLES.md#protecting-a-route-in-a-gatsby-app) and [Next.js](https://github.com/auth0/auth0-react/blob/master/EXAMPLES.md#protecting-a-route-in-a-nextjs-app-in-spa-mode). + +### Call an API + +To call a protected API with an Access Token, be sure to specify the `audience` and `scope` of your access token, either in `Auth0Provider` or `getAccessTokenSilently`. Then use it to call a protected API by passing it in the `Authorization` header of your request. + +```jsx +import React, { useEffect, useState } from 'react'; +import { useAuth0 } from '@auth0/auth0-react'; + +const Posts = () => { + const { getAccessTokenSilently } = useAuth0(); + const [posts, setPosts] = useState(null); + + useEffect(() => { + (async () => { + try { + const token = await getAccessTokenSilently({ + audience: 'https://api.example.com/', + scope: 'read:posts', + }); + const response = await fetch('https://api.example.com/posts', { + headers: { + Authorization: `Bearer <%= "${token}" %>`, + }, + }); + setPosts(await response.json()); + } catch (e) { + console.error(e); + } + })(); + }, [getAccessTokenSilently]); + + if (!posts) { + return
    Loading...
    ; + } + + return ( +
      + {posts.map((post, index) => { + return
    • {post}
    • ; + })} +
    + ); +}; + +export default Posts; +``` diff --git a/articles/libraries/auth0-spa-js/index.md b/articles/libraries/auth0-spa-js/index.md new file mode 100644 index 0000000000..0055131f0e --- /dev/null +++ b/articles/libraries/auth0-spa-js/index.md @@ -0,0 +1,340 @@ +--- +section: libraries +toc: true +title: Auth0 Single Page App SDK +description: Auth0 SDK for single page applications using Authorization Code Grant Flow with PKCE. +topics: + - libraries + - auth0-spa-js +contentType: + - index +--- + + + +# Auth0 Single Page App SDK + +The Auth0 Single Page App SDK is a new JavaScript library for implementing authentication & authorization in single page apps (SPA) with Auth0. It provides a high-level API and handles a lot of the details so you can secure SPAs using best practices while writing less code. + +The Auth0 SPA SDK handles grant and protocol details, token expiration and renewal, as well as token storage and cacheing. Under the hood, it implements [Universal Login](/universal-login) and the [Authorization Code Grant Flow with PKCE](/api-auth/tutorials/authorization-code-grant-pkce). + +The library is [hosted on GitHub](https://github.com/auth0/auth0-spa-js) and you can find the API documentation [here](https://auth0.github.io/auth0-spa-js/). + +If your SPA is based on React, check out the [Auth0 React SDK](/libraries/auth0-react). + +<%= include('../_includes/_spa_js_faq.md') %> + +## Installation + +You have a few options for using auth0-spa-js in your project: + +From the CDN: + +```html + +``` + +Using [npm](https://npmjs.org): + +```sh +npm install @auth0/auth0-spa-js +``` + +Using [yarn](https://yarnpkg.com): + +```sh +yarn add @auth0/auth0-spa-js +``` + +## Getting Started + +### Create the client + +First, you'll need to create a new instance of `Auth0Client` client object. Create the `Auth0Client` instance before rendering or initializing your application. You can do this using either the async/await method, or with promises. You should only create one instance of the client. + +```js +import createAuth0Client from '@auth0/auth0-spa-js'; + +// either with async/await +const auth0 = await createAuth0Client({ + domain: '${account.namespace}', + client_id: '${account.clientId}' +}); +``` + +```js +// or with promises +createAuth0Client({ + domain: '${account.namespace}', + client_id: '${account.clientId}' +}).then(auth0 => { + //... +}); +``` + +Using `createAuth0Client` does a couple of things automatically: + +* It creates an instance of `Auth0Client`. +* It calls `getTokenSilently` to refresh the user session. +* It suppresses all errors from `getTokenSilently`, except `login_required`. + +You can also create the client directly using the `Auth0Client` constructor. This can be useful if: + +* You wish to bypass the call to `getTokenSilently` on initialization. +* You wish to do custom error handling. +* You wish to initialize the SDK in a synchronous way. + +```js +import { Auth0Client } from '@auth0/auth0-spa-js'; + +const auth0 = new Auth0Client({ + domain: '${account.namespace}', + client_id: '${account.clientId}' +}); +``` + +### Login and get user info + +Next, create a button users can click to start logging in. + +```html + +``` + +Listen for click events on the button you created. When the event occurs, use the desired login method to authenticate the user (`loginWithRedirect()` in this example). After the user is authenticated, you can retrieve the user profile with the `getUser()` method. + +```js +// either with async/await +document.getElementById('login').addEventListener('click', async () => { + await auth0.loginWithRedirect({ + redirect_uri: 'http://localhost:3000/' + }); + //logged in. you can get the user profile like this: + const user = await auth0.getUser(); + console.log(user); +}); +``` + +```js +// or with promises +document.getElementById('login').addEventListener('click', () => { + auth0.loginWithRedirect({ + redirect_uri: 'http://localhost:3000/' + }).then(token => { + //logged in. you can get the user profile like this: + auth0.getUser().then(user => { + console.log(user); + }); + }); +}); +``` + +### Call an API + +To call your API, start by getting the user's Access Token. Then use the Access Token in your request. In this example the `getTokenSilently` method is used to retrieve the Access Token. + +```html + +``` + +```js +// either with async/await +document.getElementById('callApi').addEventListener('click', async () => { + const accessToken = await auth0.getTokenSilently(); + const result = await fetch('https://exampleco.com/api', { + method: 'GET', + headers: { + Authorization: 'Bearer ' + accessToken + } + }); + const data = await result.json(); + console.log(data); +}); +``` + +```js +// or with promises +document.getElementById('callApi').addEventListener('click', () => { + auth0 + .getTokenSilently() + .then(accessToken => + fetch('https://exampleco.com/api', { + method: 'GET', + headers: { + Authorization: 'Bearer ' + accessToken + } + }) + ) + .then(result => result.json()) + .then(data => { + console.log(data); + }); +}); +``` + +### Logout + +Add a button users can click to logout. + +```html + +``` + +```js +document.getElementById('logout').addEventListener('click', () => { + auth0.logout(); +}); +``` + +### Change storage options + +The Auth0 SPA SDK stores tokens in memory by default. However, this does not provide persistence across page refreshes and browser tabs. Instead, you can opt-in to store tokens in local storage by setting the `cacheLocation` property to `localstorage` when initializing the SDK. This can help to mitigate some of the effects of browser privacy technology that prevents access to the Auth0 session cookie by storing Access Tokens for longer. + +::: warning +Storing tokens in browser local storage provides persistence across page refreshes and browser tabs. However, if an attacker can achieve running JavaScript in the SPA using a cross-site scripting (XSS) attack, they can retrieve the tokens stored in local storage. A vulnerability leading to a successful XSS attack can be either in the SPA source code or in any third-party JavaScript code (such as bootstrap, jQuery, or Google Analytics) included in the SPA. + +Read more about [token storage](/tokens/concepts/token-storage#single-page-app-scenarios). +::: + +```js +const auth0 = await createAuth0Client({ + domain: '${account.namespace}', + client_id: '${account.clientId}', + cacheLocation: 'localstorage' +}); +``` + +### Use rotating Refresh Tokens + +The Auth0 SPA SDK can be configured to use [rotating Refresh Tokens](/tokens/concepts/refresh-token-rotation) to get new access tokens silently. These can be used to bypass browser privacy technology that prevents access to the Auth0 session cookie when authenticating silently, as well as providing [built-in reuse detection](/tokens/concepts/refresh-token-rotation#automatic-reuse-detection). + +Configure the SDK to do this by setting `useRefreshTokens` to `true` on initialization: + +```js +const auth0 = await createAuth0Client({ + domain: '${account.namespace}', + client_id: '${account.clientId}', + useRefreshTokens: true +}); + +// Request a new access token using a refresh token +const token = await auth0.getTokenSilently(); +``` + +Refresh Tokens will also need to be [configured for your tenant](/tokens/guides/configure-refresh-token-rotation) before they can be used in your SPA. + +Once configured, the SDK will request the `offline_access` scope during the authorization step. Furthermore, `getTokenSilently` will then call the `/oauth/token` endpoint directly to exchange refresh tokens for access tokens. + +:::note +The SDK will obey the storage configuration when storing refresh tokens. If the SDK has been configured using the default in-memory storage mechanism, refresh tokens will be lost when refreshing the page. +::: + +## Usage + +Below are examples of usage for various methods in the SDK. Note that jQuery is used in these examples. + +### Login with popup + +```js +$('#loginPopup').click(async () => { + await auth0.loginWithPopup(); +}); +``` + +### Login with redirect + +```js +$('#loginRedirect').click(async () => { + await auth0.loginWithRedirect({ + redirect_uri: 'http://localhost:3000/' + }); +}); +``` + +Redirect to the `/authorize` endpoint at Auth0, starting the [Universal Login](/universal-login) flow. + +### Login with redirect callback + +```js +$('#loginRedirectCallback').click(async () => { + await auth0.handleRedirectCallback(); +}); +``` + +### Get Access Token with no interaction + +Get a new Access Token silently using either a hidden iframe and `prompt=none`, or by using a rotating Refresh Token. Refresh Tokens are used when `useRefreshTokens` is set to `true` when configuring the SDK. + +If in-memory storage (the default) and refresh tokens are used, new tokens are retrieved using a web worker on supported browsers. + +```js +$('#getToken').click(async () => { + const token = await auth0.getTokenSilently(); +}); +``` + +The `getTokenSilently()` method requires you to have **Allow Skipping User Consent** enabled in your [API Settings in the Dashboard](${manage_url}/#/apis). Additionally, user consent [cannot be skipped on 'localhost'](/api-auth/user-consent#skipping-consent-for-first-party-applications). + +### Get Access Token with popup + +```js +$('#getTokenPopup').click(async () => { + const token = await auth0.getTokenWithPopup({ + audience: 'https://mydomain/api/', + scope: 'read:rules' + }); +}); +``` + +### Get Access Token for a different audience + +```js +$('#getToken_audience').click(async () => { + const differentAudienceOptions = { + audience: 'https://mydomain/another-api/', + scope: 'read:rules', + redirect_uri: 'http://localhost:3000/callback.html' + }; + const token = await auth0.getTokenSilently(differentAudienceOptions); +}); +``` + +### Get user + +```js +$('#getUser').click(async () => { + const user = await auth0.getUser(); +}); +``` + +### Get ID Token claims + +```js +$('#getIdTokenClaims').click(async () => { + const claims = await auth0.getIdTokenClaims(); + // if you need the raw id_token, you can access it + // using the __raw property + const id_token = claims.__raw; +}); +``` + +### Logout (default) + +```js +$('#logout').click(async () => { + auth0.logout({ + returnTo: 'http://localhost:3000/' + }); +}); +``` + +### Logout with no client ID + +```js +$('#logoutNoClientId').click(async () => { + auth0.logout({ + client_id: null, + returnTo: 'http://localhost:3000/' + }); +}); +``` diff --git a/articles/libraries/auth0-spa-js/migrate-from-auth0js.md b/articles/libraries/auth0-spa-js/migrate-from-auth0js.md new file mode 100644 index 0000000000..40ce0aa180 --- /dev/null +++ b/articles/libraries/auth0-spa-js/migrate-from-auth0js.md @@ -0,0 +1,244 @@ +--- +section: libraries +title: Migrate from Auth0.js to the Auth0 Single Page App SDK +description: How to migrate single page applications from Auth0.js to Auth0 Single Page App SDK +public: false +topics: + - libraries + - auth0-spa-js + - migrations +contentType: + - how-to +useCase: + - migrate +--- + +# Migrate from Auth0.js to the Auth0 Single Page App SDK + +In this article, you’ll see how to migrate your single page app (SPA) from [auth0.js](/libraries/auth0js) to [auth0-spa-js](/libraries/auth0-spa-js). Listed below are scenarios using auth0.js and the equivalent auth0-spa-js code. + +## Functionality that cannot be migrated + +Not all auth0.js functionality can be directly migrated to auth0-spa-js. Scenarios that cannot be directly migrated include: + +- embedded [login with username/password](https://auth0.github.io/auth0.js/global.html#login) as well as embedded [passwordless login](https://auth0.github.io/auth0.js/global.html#passwordlessLogin) +- user [signup](https://auth0.github.io/auth0.js/global.html#signup) +- [get a user profile from /userinfo endpoint](https://auth0.github.io/auth0.js/global.html#userInfo) +- [request an email to change the user's password](https://auth0.github.io/auth0.js/global.html#changePassword) +- [link users with the Management API](https://auth0.github.io/auth0.js/global.html#linkUser) +- [get user with the Management API](https://auth0.github.io/auth0.js/global.html#getUser) +- [update user attributes with the Management API](https://auth0.github.io/auth0.js/global.html#patchUserAttributes) +- [update user metadata with the Management API](https://auth0.github.io/auth0.js/global.html#patchUserMetadata) +- There are also some options that are configurable in Auth0.js that do not have a counterpart in the auth0-spa-js. An example of this is `responseType`. There is a reason that there is not a direct 1:1 mapping for each option. In this case, `responseType` is unnecessary, because the SDK is only for use in SPAs, and so one would not need to change the response type. + +## Authentication Parameters are not modified anymore + +Auth0.js converts custom parameters you set from `camelCase` to `snake_case` internally. For example, if you set `deviceType: 'offline'`, auth0.js actually sends `device_type: 'offline'` to the server. + +When using auth0-spa-js, custom parameters **are not converted** from `camelCase` to `snake_case`. It will relay whatever parameter you send to the authorization server. + +## Create the client + +### auth0.js + +* [WebAuth](https://auth0.github.io/auth0.js/WebAuth.html) + +```js +import { WebAuth } from 'auth0.js'; + +window.addEventListener('load', () => { + var auth0 = new WebAuth({ + domain: '${account.namespace}', + clientID: '${account.clientId}', + redirectUri: '${account.callback}' + }); +}); +``` + +### auth0-spa-js + +* [createAuth0Client()](https://auth0.github.io/auth0-spa-js/globals.html#createauth0client) +* [Auth0ClientOptions](https://auth0.github.io/auth0-spa-js/interfaces/auth0clientoptions.html) + +```js +import createAuth0Client from '@auth0/auth0-spa-js'; + +window.addEventListener('load', () => { + const auth0 = await createAuth0Client({ + domain: '${account.namespace}', + client_id: '${account.clientId}', + redirect_uri: '${account.callback}' + }); +}); +``` + +## Redirect to the Universal Login Page + +### auth0.js + +* [authorize()](https://auth0.github.io/auth0.js/global.html#authorize) + +```js +document.getElementById('login').addEventListener('click', () => { + auth0.authorize(); +}); +``` + +### auth0-spa-js + +* [Auth0Client.loginWithRedirect()](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#loginwithredirect) +* [RedirectLoginOptions](https://auth0.github.io/auth0-spa-js/interfaces/redirectloginoptions.html) + +```js +document.getElementById('login').addEventListener('click', async () => { + await auth0.loginWithRedirect(); +}); +``` + +## Parse the hash after the redirect + +### auth0.js + +* [parseHash()](https://auth0.github.io/auth0.js/global.html#parseHash) + +```js +window.addEventListener('load', () => { + auth0.parseHash({ hash: window.location.hash }, function(err, authResult) { + if (err) { + return console.log(err); + } + console.log(authResult); + }); +}); +``` + +### auth0-spa-js + +* [Auth0Client.handleRedirectCallback()](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#handleredirectcallback) + +```js +window.addEventListener('load', async () => { + await auth0.handleRedirectCallback(); +}); +``` + +## Get the user information + +### auth0.js + +The `userInfo()` function makes a call to the [/userinfo endpoint](https://auth0.com/docs/api/authentication#user-profile) and returns the user profile. + +* [userInfo()](https://auth0.github.io/auth0.js/global.html#userInfo) + +```js +window.addEventListener('load', () => { + auth0.client.userInfo(accessToken, function(err, user) { + console.log(user) + }); +}); +``` + +### auth0-spa-js + +Unlike auth0.js, the Auth0 SPA SDK does not call to the [/userinfo endpoint](https://auth0.com/docs/api/authentication#user-profile) for the user profile. Instead `Auth0Client.getUser()` returns user information from the decoded `id_token`. + +* [Auth0Client.getUser()](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#getuser) +* [GetUserOptions](https://auth0.github.io/auth0-spa-js/interfaces/getuseroptions.html) + +```js +window.addEventListener('load', async () => { + const user = await auth0.getUser(); + console.log(user); +}); +``` + +## Open the Universal Login Page in a popup + +### auth0.js + +```js +document.getElementById('login').addEventListener('click', () => { + auth0.popup.authorize(); +}); +``` + +### auth0-spa-js + +* [Auth0Client.loginWithPopup()](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#loginwithpopup) +* [PopupLoginOptions](https://auth0.github.io/auth0-spa-js/interfaces/popuploginoptions.html) + +```js +document.getElementById('login').addEventListener('click', async () => { + await auth0.loginWithPopup(); +}); +``` + +## Refresh tokens + +### auth0.js + +* [checkSession()](https://auth0.github.io/auth0.js/global.html#checkSession) + +```js +document.getElementById('login').addEventListener('click', () => { + auth0.checkSession({}, function(err, authResult) { + // Authentication tokens or error + }); +}); +``` + +### auth0-spa-js + +The Auth0 SPA SDK handles Access Token refresh for you. Every time you call `getTokenSilently`, you'll either get a valid Access Token or an error if there's no session at Auth0. + +* [Auth0Client.getTokenSilently()](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#gettokensilently) + +```js +document.getElementById('login').addEventListener('click', async () => { + await auth0.getTokenSilently(); +}); +``` + +## Get a token for a different audience or with more scopes + +### auth0.js + +* [checkSession()](https://auth0.github.io/auth0.js/global.html#checkSession) + +```js +document.getElementById('login').addEventListener('click', () => { + auth0.checkSession({ + audience: 'https://mydomain/another-api/', + scope: 'read:messages' + }, function(err, authResult) { + // Authentication tokens or error + }); +}); +``` + +### auth0-spa-js + +The Auth0 SPA SDK handles Access Token refresh for you. Every time you call `getTokenSilently`, you'll either get a valid Access Token or an error if there's no session at Auth0. + +* [Auth0Client.getTokenSilently()](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#gettokensilently) +* [GetTokenSilentlyOptions](https://auth0.github.io/auth0-spa-js/interfaces/gettokensilentlyoptions.html) + +```js +document.getElementById('login').addEventListener('click', async () => { + await auth0.getTokenSilently({ + audience: 'https://mydomain/another-api/', + scope: 'read:messages' + }); +}); +``` + +Use [getTokenWithPopup](https://auth0.github.io/auth0-spa-js/classes/auth0client.html#gettokenwithpopup) to open a popup and allow the user to consent to the new API: + +```js +document.getElementById('login').addEventListener('click', async () => { + await auth0.getTokenWithPopup({ + audience: 'https://mydomain/another-api/', + scope: 'read:messages' + }); +}); +``` diff --git a/articles/libraries/auth0-swift/database-authentication.md b/articles/libraries/auth0-swift/database-authentication.md index 31f71eb5ff..039f9467b1 100644 --- a/articles/libraries/auth0-swift/database-authentication.md +++ b/articles/libraries/auth0-swift/database-authentication.md @@ -1,7 +1,7 @@ --- section: libraries toc: true -description: Using Database Connections with Auth0.Swift +description: Using database connections with Auth0.Swift topics: - libraries - swift @@ -9,8 +9,13 @@ topics: contentType: how-to useCase: enable-mobile-auth --- + # Using Database Connections with Auth0.Swift +::: panel-warning Database authentication on Native Platforms +Username/Email & Password authentication from native applications is disabled by default for new tenants as of 8 June 2017. Users are encouraged to use Universal Login and perform Web Authentication instead. If you still want to proceed you'll need to enable the Password Grant Type on your dashboard first. See [Application Grant Types](/applications/concepts/application-grant-types) for more information. +::: + The Authentication API provides methods to authenticate and sign up database users. ## Signing up with a database connection @@ -25,12 +30,11 @@ Auth0 password: "secret-password", connection: "Username-Password-Authentication", userMetadata: ["first_name": "First", - "last_name": "Last"] - ) + "last_name": "Last"]) .start { result in switch result { case .success(let user): - print("User Signed up: \(user)") + print("User: \(user)") case .failure(let error): print("Failed with \(error)") } @@ -52,7 +56,7 @@ Auth0 .start { result in switch result { case .success(let credentials): - print("Obtained credentials: \(credentials)") + print("Credentials: \(credentials)") case .failure(let error): print("Failed with \(error)") } diff --git a/articles/libraries/auth0-swift/index.md b/articles/libraries/auth0-swift/index.md index afed867efb..bc88fd539e 100644 --- a/articles/libraries/auth0-swift/index.md +++ b/articles/libraries/auth0-swift/index.md @@ -11,6 +11,7 @@ contentType: - index useCase: enable-mobile-auth --- + # Auth0.swift Auth0.swift is a client-side library for Auth0. @@ -21,15 +22,29 @@ Check out the [Auth0.swift repository](https://github.com/auth0/Auth0.swift) on ## Requirements -- iOS 9 or later -- Xcode 8 -- Swift 3.0 +- iOS 9+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+ +- Xcode 11.4+ / 12.x +- Swift 4.x / 5.x ## Installation +### Cocoapods + +If you are using [Cocoapods](https://cocoapods.org), add this line to your `Podfile`: + +```ruby +pod 'Auth0', '~> 1.0' +``` + +Then run `pod install`. + +::: note +For more information on Cocoapods, check [their official documentation](https://guides.cocoapods.org/using/getting-started.html). +::: + ### Carthage -If you are using Carthage, add the following lines to your `Cartfile`: +If you are using [Carthage](https://github.com/Carthage/Carthage), add the following line to your `Cartfile`: ```ruby github "auth0/Auth0.swift" ~> 1.0 @@ -38,22 +53,25 @@ github "auth0/Auth0.swift" ~> 1.0 Then run `carthage bootstrap`. ::: note -For more information about Carthage usage, check [the official documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos). +For more information about Carthage usage, check [their official documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos). ::: -### Cocoapods +### SPM -If you are using [Cocoapods](https://cocoapods.org/), add these lines to your `Podfile`: +If you are using the Swift Package Manager, open the following menu item in Xcode: -```ruby -use_frameworks! -pod 'Auth0', '~> 1.0' +**File > Swift Packages > Add Package Dependency...** + +In the **Choose Package Repository** prompt add this url: + +```text +https://github.com/auth0/Auth0.swift.git ``` -Then, run `pod install`. +Then press **Next** and complete the remaining steps. ::: note -For further reference on Cocoapods, check [the official documentation](http://guides.cocoapods.org/using/getting-started.html). +For further reference on SPM, check [its official documentation](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app). ::: ## Adding Auth0 Credentials @@ -73,9 +91,9 @@ You will need to add an `Auth0.plist` file, containing your Auth0 client id and ``` -### Web-based Auth (iOS Only) +### Web-based Auth (iOS / macOS 10.15+) -First go to [Auth0 Dashboard](${manage_url}/#/applications) and go to application's settings. Make sure you have in **Allowed Callback URLs** a URL with the following format: +First go to [Auth0 Dashboard](${manage_url}/#/applications) and go to application's settings. Make sure you have in **Allowed Callback URLs** a URL with the following format: ```text {YOUR_BUNDLE_IDENTIFIER}://${account.namespace}/ios/{YOUR_BUNDLE_IDENTIFIER}/callback @@ -107,20 +125,30 @@ If your `Info.plist` is not shown in this format, you can **Right Click** on `In Auth0.swift will only handle URLs with your Auth0 domain as host, for example `com.auth0.MyApp://samples.auth0.com/ios/com.auth0.MyApp/callback` ::: -Allow Auth0 to handle authentication callbacks. In your `AppDelegate.swift` add the following: +Allow Auth0 to handle authentication callbacks. In your `AppDelegate.swift`, add the following: + +##### iOS ```swift -func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool { - return Auth0.resumeAuth(url, options: options) +func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any]) -> Bool { + return Auth0.resumeAuth(url) +} +``` + +##### macOS + +```swift +func application(_ application: NSApplication, open urls: [URL]) { + Auth0.resumeAuth(urls) } ``` #### Authenticate with Universal Login -The first step in adding authentication to your iOS application is to provide a way for your users to log in. The fastest, most secure, and most feature-rich way to do this with Auth0 is to use [Universal Login](/hosted-pages/login). +The first step in adding authentication to your application is to provide a way for your users to log in. The fastest, most secure, and most feature-rich way to do this with Auth0 is to use Universal Login. ::: note -To ensure an [OpenID Connect compliant response](/api-auth/intro), you must either request an `audience` or enable the **OIDC Conformant** switch in your [Auth0 dashboard](${manage_url}), under **Application > Settings > Show Advanced Settings > OAuth**. For more information, refer to [How to use the new flows](/api-auth/intro#how-to-use-the-new-flows). +For more information on the two types of login flows, please refer to [Browser-Based vs. Native Login Flows on Mobile Devices](/design/browser-based-vs-native-experience-on-mobile) ::: ```swift @@ -128,17 +156,21 @@ Auth0 .webAuth() .audience("https://${account.namespace}/userinfo") .start { result in - switch result { + switch result { // Auth0.Result case .success(let credentials): - print("credentials: \(credentials)") + print("Credentials: \(credentials)") case .failure(let error): print(error) } } ``` +::: warning +If you're using **Swift 5+**, `Auth0.Result` may shadow Swift's `Result` type. To prevent that, replace it with `Swift.Result` whenever you want to refer to Swift's built-in type. This will be fixed in the next major version of Auth0.swift. +::: + ::: note -If you need help between the two types of login flows, refer to [Browser-Based vs. Native Login Flows on Mobile Devices](/tutorials/browser-based-vs-native-experience-on-mobile) +To ensure a response that complies with OpenID Connect (OIDC), you must either request an `audience` or enable the **OIDC Conformant** switch in your [Auth0 dashboard](${manage_url}), under **Application > Settings > Show Advanced Settings > OAuth**. For more information, refer to [How to use the new flows](/api-auth/tutorials/adoption#how-to-use-the-new-flows). ::: #### Authenticate with a specific Auth0 connection @@ -153,7 +185,7 @@ Auth0 .start { result in switch result { case .success(let credentials): - print("credentials: \(credentials)") + print("Credentials: \(credentials)") case .failure(let error): print(error) } @@ -162,7 +194,7 @@ Auth0 #### Authenticate using a specific scope -Using scopes can allow you to return specific claims for specfic fields in your request. Adding parameters to `scope` will allow you to add more scopes. The default scope is `openid`, and you should read our [documentation on scopes](/scopes) for further details about them. +Using scopes can allow you to return specific claims for specific fields in your request. Adding parameters to `scope` will allow you to add more scopes. The default scope is `openid`, and you should read our [documentation on scopes](/scopes/current) for further details about them. ```swift Auth0 @@ -173,7 +205,7 @@ Auth0 .start { result in switch result { case .success(let credentials): - print("credentials: \(credentials)") + print("Credentials: \(credentials)") case .failure(let error): print(error) } @@ -182,7 +214,7 @@ Auth0 ### Getting user information -In order to retrieve a user's profile, you call the `userInfo` method and pass it the user's `accessToken`. Although the call returns a [UserInfo](https://github.com/auth0/Auth0.swift/blob/master/Auth0/UserInfo.swift) instance, this is a basic OIDC conformant profile and the only guaranteed claim is the `sub` which contains the user's id, but depending on the requested scope the claims returned may vary. You can also use the `sub` value to call the [Management API](#Management-API) and return a full user profile. +In order to retrieve a user's profile, you call the `userInfo` method and pass it the user's `accessToken`. Although the call returns a [UserInfo](https://github.com/auth0/Auth0.swift/blob/master/Auth0/UserInfo.swift) instance, this is a basic OIDC conformant profile and the only guaranteed claim is the `sub`, which contains the user's ID. Depending on the requested scope, the claims returned may vary. You can also use the `sub` value to call the [Management API](https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id) and return a full user profile. ```swift Auth0 @@ -200,12 +232,12 @@ Auth0 ## Next Steps -Take a look at the following resources to see how the Auth0.Swift SDK can be customized for your needs: +Take a look at the following resources to see how the Auth0.swift SDK can be customized for your needs: ::: next-steps * [Auth0.Swift Database Authentication](/libraries/auth0-swift/database-authentication) * [Auth0.Swift Passwordless Authentication](/libraries/auth0-swift/passwordless) * [Auth0.Swift Refresh Tokens](/libraries/auth0-swift/save-and-refresh-jwt-tokens) * [Auth0.Swift User Management](/libraries/auth0-swift/user-management) -* [Auth0.Swift TouchID Authentication](/libraries/auth0-swift/touchid-authentication) +* [Auth0.Swift Touch ID / Face ID Authentication](/libraries/auth0-swift/touchid-authentication) ::: diff --git a/articles/libraries/auth0-swift/passwordless.md b/articles/libraries/auth0-swift/passwordless.md index 20fb8ba878..664f8e8d7f 100644 --- a/articles/libraries/auth0-swift/passwordless.md +++ b/articles/libraries/auth0-swift/passwordless.md @@ -1,7 +1,7 @@ --- section: libraries toc: true -description: Using Auth0.Swift in Passwordless mode +description: Using Auth0.Swift in passwordless mode topics: - libraries - swift @@ -9,11 +9,12 @@ topics: contentType: how-to useCase: enable-mobile-auth --- + # Passwordless Authentication with Auth0.Swift -<%= include('../../_includes/_native_passwordless_warning') %> +Passwordless authentication allows users to login using only an email address or phone number, reducing the friction that occurs when a user must remember a password. Passwordless authentication can be done via email or via SMS, and either by sending the user a code, or sending them a link which contains a code. -Passwordless authentication allows users to login using only an email address or phone number, reducing the friction that occurs when a user must remember a password. Passwordless authentication can be done via email or via SMS, and either by sending the user a code, or sending them a link which contains a code. +To use Passwordless Authentication you need Auth0.Swift version `1.20.0` or greater. ## How Passwordless works @@ -31,7 +32,7 @@ In this example, requesting the code is done by calling `startPasswordless` with ```swift Auth0 .authentication() - .startPasswordless(email: "support@auth0.com", connection: "email") + .startPasswordless(email: "support@auth0.com") .start { result in switch result { case .success: @@ -50,14 +51,34 @@ Once the user has a code, they can input it. Call the `login` method, and pass i Auth0 .authentication() .login( - usernameOrEmail: "support@auth0.com", - password: "123456", - realm: "Username-Password-Authentication" - ) + email: "support@auth0.com", + code: "123456", + audience: "https://myapi.com/api", + scope: "openid email") + .start { result in + switch result { + case .success(let credentials): + print("Access Token: \(credentials.accessToken)") + case .failure(let error): + print(error) + } + } +``` + +If you used SMS, the call would be like: + +```swift +Auth0 + .authentication() + .login( + phoneNumber: "+4591131761367", + code: "123456", + audience: "https://myapi.com/api", + scope: "openid email") .start { result in switch result { case .success(let credentials): - print("access_token: \(credentials.accessToken)") + print("Access Token: \(credentials.accessToken)") case .failure(let error): print(error) } @@ -85,4 +106,4 @@ or | `email` | required | (String) Either `email` or `phoneNumber` is required (not both), depending on which will be used. | | `phoneNumber` | required | (String) Either `email` or `phoneNumber` is required (not both), depending on which will be used. | | `type` | optional | (String) The type of Passwordless transaction to use, either `.Code` or `.iOSLink`. Defaults to `.Code`. | -| `connection` | optional | (String) The name of the connection to use for the Passwordless authentication. Defaults to `sms`. | +| `connection` | optional | (String) The name of the connection to use for the Passwordless authentication. Defaults to `sms` for the SMS overload or to `email` for the email overload | diff --git a/articles/libraries/auth0-swift/save-and-refresh-jwt-tokens.md b/articles/libraries/auth0-swift/save-and-refresh-jwt-tokens.md index 55093e856d..c633a9c650 100644 --- a/articles/libraries/auth0-swift/save-and-refresh-jwt-tokens.md +++ b/articles/libraries/auth0-swift/save-and-refresh-jwt-tokens.md @@ -11,19 +11,19 @@ useCase: enable-mobile-auth # Auth0.swift Saving and Renewing Tokens -When an authentication is performed with the `offline_access` scope included, it will return a [Refresh Token](/refresh-token) that can be used to request a new user token, without asking for credentials again. +When an authentication is performed with the `offline_access` scope included, it will return a Refresh Token that can be used to request a new token without asking for credentials again. ## Credentials Manager [Auth0.swift](https://github.com/auth0/Auth0.swift) provides a utility class to streamline the process of storing and renewing credentials. You can access the `accessToken` or `idToken` properties from the [Credentials](https://github.com/auth0/Auth0.swift/blob/master/Auth0/Credentials.swift) instance. This is the preferred method to manage user credentials. -First, import the `Auth0` module: +First import the `Auth0` module: ```swift import Auth0 ``` -Next, present the Login: +Next present the Universal Login page: ```swift let credentialsManager = CredentialsManager(authentication: Auth0.authentication()) @@ -32,10 +32,10 @@ Auth0 .webAuth() .scope("openid profile offline_access") .audience("https://${account.namespace}/userinfo") - .start { - switch $0 { + .start { result in + switch result { case .failure(let error): - // Handle the error + // Handle error case .success(let credentials): // Pass the credentials over to the Credentials Manager credentialsManager.store(credentials: credentials) @@ -43,13 +43,17 @@ Auth0 } ``` +::: warning +The Keychain items do not get deleted after your app is uninstalled. We recommend to always clear all of your app's Keychain items on first launch. +::: + ### Credentials Check -It can be useful to perform a quick sanity check that you have valid credentials stored in the manager. If not the user can then be directed to authenticate. +It can be useful to perform a quick sanity check to ensure that you have valid credentials stored in the manager. If not, the user can then be directed to authenticate. ```swift guard credentialsManager.hasValid() else { - // Present Login Page + // Present login screen } ``` @@ -60,21 +64,21 @@ You can retrieve the user's credentials as follows: ```swift credentialsManager.credentials { error, credentials in guard error == nil, let credentials = credentials else { - // Handle Error, Present Login Page + // Handle error, present login page } - // Valid credentials, you can access the token properties such as `idToken`, `accessToken`. + // Valid credentials; you can access token properties such as `idToken`, `accessToken`. } ``` ::: note -Renewing a user's credentials works exactly the same way, if the token has expired. The Credentials Manager will automatically renew the credentials, then store the renewed credentials to the Keychain and finally return them in the closure. +Renewing a user's credentials works exactly the same way if the token has expired. The Credentials Manager will automatically renew the credentials, store the renewed credentials to the Keychain, then return them in the closure. ::: ## Alternative Method - SimpleKeychain -If you are familiar with Lock v1, you may already be using the [SimpleKeychain](https://github.com/auth0/SimpleKeychain) SDK to handle iOS Keychain read/write access. This section is for developers who would prefer to keep using the SimpleKeychain and not upgrade to the preferred Credentials Manager. +If you are familiar with Lock v1, you may already be using the [SimpleKeychain](https://github.com/auth0/SimpleKeychain) SDK to handle iOS Keychain read/write access. This section is for developers who would prefer to keep using the SimpleKeychain and not upgrade to the preferred Credentials Manager. -First thing you need to do is store the tokens you need. In this case, you will store the `access_token` and `refresh_token` in the Keychain after a successful authentication. +The first thing you will do is store the tokens you need. In this case, you will store the `access_token` and `refresh_token` in the Keychain after a successful authentication. ```swift let keychain = A0SimpleKeychain(service: "Auth0") @@ -83,15 +87,19 @@ Auth0 .webAuth() .scope("openid profile offline_access") .audience("https://${account.namespace}/userinfo") - .start { - switch $0 { + .start { result in + switch result { case .failure(let error): - // Handle the error + // Handle error case .success(let credentials): - guard let accessToken = credentials.accessToken, let refreshToken = credentials.refreshToken else { // Handle Error } - keychain.setString(accessToken, forKey: "access_token") - keychain.setString(refreshToken, forKey: "refresh_token") - // You might want to route to a user profile screen at this point + guard let accessToken = credentials.accessToken, + let refreshToken = credentials.refreshToken else { + // Handle error + return + } + keychain.setString(accessToken, forKey: "access_token") + keychain.setString(refreshToken, forKey: "refresh_token") + // You might want to route to a user profile screen at this point } } ``` @@ -109,12 +117,19 @@ Auth0 .start { result in switch(result) { case .success(let credentials): - // Store the new Access Token + // If you have Refresh Token Rotation enabled, you get a new Refresh Token + // Otherwise you only get a new Access Token + guard let accessToken = credentials.accessToken, + let refreshToken = credentials.refreshToken else { + // Handle error + return + } + // Store the new tokens keychain.setString(accessToken, forKey: "access_token") - // You do not get a new refresh_token, you can still use the one you originally had + keychain.setString(refreshToken, forKey: "refresh_token") case .failure(let error): keychain.clearAll() - // Handle Error + // Handle error } } ``` diff --git a/articles/libraries/auth0-swift/touchid-authentication.md b/articles/libraries/auth0-swift/touchid-authentication.md index 6a5a017c5b..e86bcad058 100644 --- a/articles/libraries/auth0-swift/touchid-authentication.md +++ b/articles/libraries/auth0-swift/touchid-authentication.md @@ -1,18 +1,20 @@ --- section: libraries -description: How to implement Touch ID authentication with Auth0.swift. +description: How to implement Touch ID / Face ID authentication with Auth0.swift. topics: - libraries - swift - touch-id + - face-id contentType: how-to useCase: enable-mobile-auth --- -# Auth0.swift Touch ID Authentication -Here's the scenario: After user authentication, you want to store the user's credentials and use them as long as they are valid. Once they expire, you would want to renew them using the `refreshToken` in order to avoid presenting the login page again. Rather than doing this automatically you require the user to validate with their fingerprint. +# Auth0.swift Touch ID / Face ID Authentication -You will be using the [Credentials Manager](https://github.com/auth0/Auth0.swift/blob/master/Auth0/CredentialsManager.swift) utility in [Auth0.swift](https://github.com/auth0/Auth0.swift/) to streamline the management of user credentials and perform the Touch ID authentication. +Here's the scenario: After user authentication, you want to store the user's credentials and use them as long as they are valid. Once they expire, you would want to renew them using the `refreshToken` in order to avoid presenting the login page again. Rather than doing this automatically, you require the user to validate with their fingerprint or face. + +You will be using the [Credentials Manager](https://github.com/auth0/Auth0.swift/blob/master/Auth0/CredentialsManager.swift) utility in [Auth0.swift](https://github.com/auth0/Auth0.swift/) to streamline the management of user credentials and perform biometric authentication. ## Getting Started @@ -24,27 +26,37 @@ import Auth0 ### Credentials Manager -Setup the Credentials Manager and enable Touch ID authentication, you can pass the title to show in the Touch ID prompt: +Before retrieving credentials, you can also engage the biometric authentication (Face ID or Touch ID) supported by your iOS device. + +Begin by setting up the Credentials Manager. Then enable biometrics. You can also pass in a title to show in the prompt. ```swift -let credentialsManager = CredentialsManager(authentication: Auth0.authentication()) -credentialsManager.enableTouchAuth(withTitle: "Touch to Authenticate") +var credentialsManager = CredentialsManager(authentication: Auth0.authentication()) +credentialsManager.enableBiometrics(withTitle: "Touch ID / Face ID Login") +``` + +We strongly recommend that you add the [NSFaceIDUsageDescription](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW75) setting to your project's `Info.plist` to display a reason for using Face ID. In some cases, if you do not provide a description string and the user attempts Face ID authentication, the user's attempt may fail. + +```xml +... +NSFaceIDUsageDescription +Reason why we use Face ID here +... ``` ### Login -Present the login page and pass the credentials upon successful authentication to the Credentials Manager. +Present the Universal Login page and, upon successful authentication, pass the credentials to the Credentials Manager. ```swift Auth0 .webAuth() .scope("openid profile offline_access") .audience("https://${account.namespace}/userinfo") - .start { - switch $0 { + .start { result in + switch result { case .failure(let error): - // Handle the error - print("Error: \(error)") + // Handle error case .success(let credentials): // Store credentials securely with the Credentials Manager credentialsManager.store(credentials: credentials) @@ -54,15 +66,15 @@ Auth0 ### Renew User Credentials -When you need to renew the user's credentials you can call the `credentials` method from the Credentials Manager to take care of this. The user will be promoted for Touch ID. +When you need to renew the user's credentials, you can call the `credentials` method from the Credentials Manager. ```swift credentialsManager.credentials { error, credentials in guard error == nil, let credentials = credentials else { - // Handle Error - // Fallback to Login Screen + // Handle error + // Fallback to login screen } - // Continue routing the user as authentication was a success + // Continue routing the user as authentication was successful } ``` @@ -70,4 +82,4 @@ There is no need manually store the new credentials as this is handled by the Cr ## Next Steps -You can download a sample project and follow the tutorial in our [Touch ID Authentication](/quickstart/native/ios-swift/08-touch-id-authentication) quickstart. +You can download a sample project and follow the instructions in the iOS quickstart section on [Touch ID / Face ID in iOS](/quickstart/native/ios-swift/08-touch-id-authentication). diff --git a/articles/libraries/auth0-swift/user-management.md b/articles/libraries/auth0-swift/user-management.md index cd28da9f5d..c2ad08deab 100644 --- a/articles/libraries/auth0-swift/user-management.md +++ b/articles/libraries/auth0-swift/user-management.md @@ -9,43 +9,44 @@ topics: contentType: how-to useCase: enable-mobile-auth --- + # User Management with Auth0.Swift -The Management API provides functionality that allows you to link and unlink separate user accounts from different providers, tying them to a single profile (Read more about [Linking Accounts](/link-accounts) with Auth0). It also allows you to update user metadata. +The Management API provides [User Account Linking](/users/concepts/overview-user-account-linking), which allows you to link and unlink separate user accounts from different providers, tying them to a single profile. It also allows you to update user metadata and other profile information. -## Linking users +## Link users -Linking user accounts will allow a user to authenticate from any of their accounts and no matter which one they use, still pull up the same profile upon login. Auth0 treats all of these accounts as separate profiles by default, so if you wish a user's accounts to be linked, this is the way to go. +Linking user accounts will allow a user to authenticate from any of their accounts and, no matter which one they use, still pull up the same profile upon login. Auth0 treats all of these accounts as separate profiles by default, so if you wish for a user's accounts to be linked, this is the way to go. -The `link` method accepts two parameters, the primary user id and the secondary user token (the token obtained after login with this identity). The user id in question is the unique identifier for this user account. If the id is in the format `facebook|1234567890`, the id required is the portion after the delimiting pipe. +The `link` method accepts two parameters: the primary profile's user ID and the secondary profile's Access Token (the token obtained after login with this identity). The user ID in question is the unique identifier for this user account. If the ID is in the format `facebook|1234567890`, the ID required is the portion after the delimiting pipe (in this case, `1234567890`). ```swift Auth0 - .users(token: "user token") + .users(token: "user-scoped access token") .link(userId, withOtherUserToken: "another user token") .start { result in switch result { case .success(let userInfo): - print("user: \(userInfo)") + print("User: \(userInfo)") case .failure(let error): print(error) } } ``` -## Unlinking users +## Unlink users -Unlinking users is a similar provess to the linking of users. The `unlink` method takes three parameters, though: the secondary user id, and the secondary provider (the provider of the secondary user), and the primary user id. +Unlinking users is a similar process to linking users. The `unlink` method takes three parameters: the secondary profile's user ID, the secondary profile's provider (the connection's identity provider), and the primary profile's user ID. The parameters read, essentially: "Unlink this **secondary user** (with this **provider**) from this **primary user**". ```swift Auth0 - .users(token: "user token") + .users(token: "user-scoped access token") .unlink(identityId: identifier, provider: provider, fromUserId:userId) .start { result in switch result { case .success(let userInfo): - print("user: \(userInfo)") + print("User: \(userInfo)") case .failure(let error): print(error) } @@ -53,19 +54,19 @@ Auth0 ``` ::: note -Note that when accounts are linked, the secondary account's metadata is not merged with the primary account's metadata. Similarly, when unlinking two accounts, the secondary account does not retain the primary account's metadata when it becomes separate again. +Note that when accounts are linked, the metadata from the secondary account's profile is not merged with the metadata from the primary account's profile. Similarly, when unlinking accounts, the secondary account's profile does not retain metadata from the primary account's profile. ::: -## Retrieving user metadata +## Retrieve user metadata ```swift Auth0 - .users(token: idToken) + .users(token: "user-scoped access token") .get(userId, fields: ["user_metadata"], include: true) .start { result in switch result { case .success(let userInfo): - print("user: \(userInfo)") + print("User: \(userInfo)") case .failure(let error): print(error) } @@ -74,16 +75,16 @@ Auth0 ## Update user metadata -When updating user metadata, you will create a `userMetadata` object, and then call the `patch` method, passing it the user id and the `userMetadata` object. The values in this object will overwrite existing values with the same key, or add new ones for those that don't yet exist in the user metadata. +When updating user metadata, you will create a `userMetadata` object and then call the `patch` method, passing it the user ID and the `userMetadata` object. The values in this object will overwrite existing values with the same key, or add new ones for those that don't yet exist in the user metadata. ```swift Auth0 - .users(token: "user token") + .users(token: "user-scoped access token") .patch("user identifier", userMetadata: ["first_name": "John", "last_name": "Doe"]) .start { result in switch result { case .success(let userInfo): - print("user: \(userInfo)") + print("User: \(userInfo)") case .failure(let error): print(error) } diff --git a/articles/libraries/auth0js/index.yml b/articles/libraries/auth0js/index.yml index 82ff282c42..44a74ecb88 100644 --- a/articles/libraries/auth0js/index.yml +++ b/articles/libraries/auth0js/index.yml @@ -2,10 +2,6 @@ versioning: baseUrl: libraries/auth0js current: v9 versions: - - v7 - - v8 - v9 defaultArticles: - v7: index - v8: index v9: index diff --git a/articles/libraries/auth0js/v7/index.md b/articles/libraries/auth0js/v7/index.md deleted file mode 100644 index bffce1cf68..0000000000 --- a/articles/libraries/auth0js/v7/index.md +++ /dev/null @@ -1,786 +0,0 @@ ---- -section: libraries -toc: true -description: How to install, initialize and use auth0.js v7 -topics: - - libraries - - auth0js -contentType: - - index - - how-to -useCase: add-login ---- - -# Auth0.js v7 Reference - -<%= include('../../../_includes/_version_warning_auth0js') %> - -Auth0.js is a client-side library for [Auth0](http://auth0.com), for use in your web apps. It allows you to trigger the authentication process and parse the [JSON Web Token](http://openid.net/specs/draft-jones-json-web-token-07.html) (JWT) with just the Auth0 `clientID`. Once you have the JWT, you can use it to authenticate requests to your HTTP API and validate the JWT in your server-side logic with the `clientSecret`. - -::: note -Check out the [Auth0.js repository](https://github.com/auth0/auth0.js/tree/v7) on GitHub. -::: - -## Ready-to-Go Example - -The [example directory](https://github.com/auth0/auth0.js/tree/master/example) of the auth0.js library is a ready-to-go app that can help you to quickly and easily try out auth0.js. In order to run it, follow these quick steps: -1. If you don't have [node](http://nodejs.org/) installed, do that now -1. Download dependencies by running `npm install` from the root of this project -1. Finally, execute `npm run example` from the root of this project, and then browse to your app running on the node server, presumably at `http://localhost:3000`. - - - -It's that easy! - -## Usage - -Now, let's get started integrating auth0.js into your project. We'll cover [methods of installation](#installation-options), [how to initialize auth0.js](#initialize), [signup](#signup), [login](#login), [Passwordless](#passwordless-authentication), [accessing user profiles](#user-profile), and more! - -### Installation Options - -You have a few options for using auth0.js in your project. Pick one of the below depending on your needs: - -Install via [npm](https://npmjs.org): - -```sh -npm install auth0-js -``` - -Install via [bower](http://bower.io): - -```sh -bower install auth0.js -``` - -Include via our CDN: - -```html - -``` - -If you are using [browserify](http://browserify.org/), you will want to install with `npm i auth0-js --production --save`. - -### Initialize - -::: note -The following examples use jQuery, but auth0.js is not tied to jQuery and any library can be used with it. -::: - -Construct a new instance of the Auth0 application as follows: - -```html - - -``` -### Signup - -Here is an example of the `signup` method and some sample code for the form. - -```html -

    Signup Database Connection

    - - - - -``` - -### Login - -This method can be referenced as `signin` or as `login` indifferently. It triggers the login on any of your active identity providers. The following are several examples of calling the `login` method with particular parameters; use the one that makes the most sense for your needs. - -```js - //trigger login with google - $('.login-google').click(function () { - auth0.login({ - connection: 'google-oauth2' - }); - }); - - //trigger login with github - $('.login-github').click(function () { - auth0.login({ - connection: 'github' - }); - }); - - //trigger login with an enterprise connection - $('.login-microsoft').click(function () { - auth0.login({ - connection: 'contoso.com' - }); - }); - - //trigger login with a db connection - $('.login-dbconn').click(function () { - auth0.login({ - connection: 'db-conn', - username: $('.username').val(), - password: $('.password').val(), - }); - }); - - //trigger login with a db connection and avoid the redirect - $('.login-dbconn').click(function () { - auth0.login({ - connection: 'db-conn', - username: $('.username').val(), - password: $('.password').val(), - }, - function (err, result) { - // store in cookies - }); - }); - - //trigger login popup with google - $('.login-google-popup').click(function (e) { - e.preventDefault(); - auth0.login({ - connection: 'google-oauth2', - popup: true, - popupOptions: { - width: 450, - height: 800 - } - }, function(err, result) { - if (err) { - alert("something went wrong: " + err.message); - return; - } - alert('Hello!'); - }); - }); -``` - -You can also request scopes that are not were not configured for the connection. - -```js - //trigger login requesting additional scopes with google - $('.login-google').click(function () { - auth0.login({ - connection: 'google-oauth2', - connection_scope: ['https://www.googleapis.com/auth/orkut', 'https://picasaweb.google.com/data/'] - }); - }); - - // alternatively a comma separated list also works - $('.login-google').click(function () { - auth0.login({ - connection: 'google-oauth2', - connection_scope: 'https://www.googleapis.com/auth/orkut,https://picasaweb.google.com/data/' - }); - }); -``` - -Trigger the login with offline mode support to get the Refresh Token - -```js -$('.login-dbconn').click(function () { - auth0.login({ - connection: 'db-conn', - username: $('.username').val(), - password: $('.password').val(), - scope: 'openid offline_access' - }, - function (err, result) { - // store in cookies - // result.refreshToken is sent because offline_access is set as a scope - }); - }); -``` - -### Logout - -After a user logs in, a JSON Web Token (JWT) is returned and this token can be saved in a cookie or in browser storage for later use. In addition to this, an SSO cookie gets set in the user's browser (unless specifying `sso: false`). - -If you would like to log the user out from their current browser session in your app, provide a method for removing their JWT from the browser. - -```js - $('.logout-dbconn').click(function() { - // local storage example - localStorage.removeItem('id_token'); - }); -``` - -If you would like to invalidate the user's Auth0 SSO session, use the `logout` method from `auth0.js`. - -```js - $('.logout-dbconn').click(function() { - auth0.logout(); - }); -``` - -This method will redirect the user to an Auth0-hosted page that says "OK". You may pass a `returnTo` value to specify where the user should be redirected to after logout. - -```js - $('.logout-dbconn').click(function() { - auth0.logout({ returnTo: 'http://localhost:3000' }, { version: 'v2' }); - }); -``` - -You must whitelist the **Logout URL** for your app at either the account level or the app level. To whitelist a logout URL for your entire account, provide it in your [advanced settings](${manage_url}/#/account/advanced). To whitelist for the application only, provide the logout URL in your [application settings](${manage_url}/#/clients). - -If you whitelist the logout URL at the application level, pass the `client_id` for your app in the query object. - -```js - $('.logout-dbconn').click(function() { - auth0.logout({ returnTo: 'http://localhost:3000', client_id: AUTH0_CLIENT_ID }, { version: 'v2' }); - }); -``` - -For more information about logout, see the [documentation](https://auth0.com/docs/logout). - -### Passwordless Authentication - -Passwordless authentication allows users to log in by receiving a one-time password via email or text message. - -#### With Email - -One option for Passwordless authentication is using email. Once you have configured a passwordless `email` connection, you can request a link or a code to be sent via email that will allow the receiver to sign in to your application. - -##### Link - -```js -$('.request-email-link').click(function (ev) { - ev.preventDefault(); - - auth0.requestMagicLink({ - email: $('.email-input').val() - }, function (err) { - if (err) { - alert(err.error_description); - return; - } - // the request was successful and you should receive - // an email with the link at the specified address - }); -}); -``` - -##### Code - -```js -$('.request-email-code').click(function (ev) { - ev.preventDefault(); - - auth0.requestEmailCode({ - email: $('.email-input').val() - }, function (err) { - if (err) { - alert(err.error_description); - return; - } - // the request was successful and you should receive - // an email with the code at the specified address - }); -}); -``` - -Once you receive the code you can call `verifyEmailCode` to authenticate the user using an `email` and a `code`. - -```js -auth0.verifyEmailCode({ - email: $('.email-input').val(), - code: $('.email-code-input').val() -}, function (err, result) { - if (err) { - alert("something went wrong: " + err.error_description); - return; - } - alert('Hello'); -}); -``` - -If you provide a `callbackURL` parameter when constructing the Auth0 instance, a redirect will be performed and the callback will only be invoked in the case of an error (notice it takes a single argument). - -```js -auth0.verifyEmailCode({ - email: $('.email-input').val(), - code: $('.email-code-input').val() -}, function (err) { - if (err) { - alert("something went wrong: " + err.error_description); - return; - } -}); -``` - -#### With SMS - -You can also do Passwordless authentication via SMS. First you must activate and configure your passwordless [Twilio](https://twilio.com) connection in our [dashboard](${manage_url}/#/connections/passwordless). - -After that you can request a passcode to be sent via SMS to a phone number. Ensure the phone number has the proper [full-length format](https://www.twilio.com/help/faq/phone-numbers/how-do-i-format-phone-numbers-to-work-internationally). - - -```js -$('.request-sms-code').click(function (ev) { - ev.preventDefault(); - - auth0.requestSMSCode({ - phoneNumber: $('.phone-input').val() - }, function (err) { - if (err) { - alert(err.error_description); - return; - } - // the request was successful and you should receive - // a SMS with the code at the specified phone number - }); -}); -``` - -Once you receive the code you can call `verifySMSCode` to authenticate the user using an `phoneNumber` and a `code`. - -```js -auth0.verifySMSCode({ - phoneNumber: $('.phone-input').val(), - code: $('.sms-code-input').val() -}, function (err, result) { - if (err) { - alert("something went wrong: " + err.error_description); - return; - } - alert("Hello"); -}); -``` - -If you provide a `callbackURL` parameter when constructing the Auth0 instance, a redirect will be performed and the callback will only be invoked in the case of an error (notice it takes a single argument). - -```js -auth0.verifySMSCode({ - phoneNumber: $('.phone-input').val(), - code: $('.sms-code-input').val() -}, function (err) { - if (err) { - alert("something went wrong: " + err.error_description); - return; - } -}); -``` - -### User Profile - -The `getProfile` method allows you to obtain the user information after a successful login. - -```js -auth0.getProfile(idToken, function (err, profile) { - if(err) { - // handle error - return; - } - - alert('hello ' + profile.name); -}); -``` - -How do you acquire the `idToken` depends on the mode you are using to log in. See below for examples for [redirect](#single-page-apps) and [popup](#popup-mode) modes. - -### Processing the Callback - -How does control return back to your app after a login has been attempted? This all depends on which login "mode" you choose to use (**Redirect** or **Popup**) and in some cases, which type of connection you're using. - -#### Redirect Mode - -The default mode of the `login` method is Redirect Mode. Here two separate "redirect" actions will occur when `login` is called. First, the browser will navigate to a separate login page to collect the user's credentials. Once the user successfully logs in, the browser will redirect the user *back* to your application via the `callbackURL`. - -For example, let's say you've initialized your Auth0 application as shown in the [Initialize](#initialize) section above. Then the following call to `login` using your `google-oauth2` social connection would result in a redirect to a Google login page and then a redirect back to `http://my-app.com/callback` if successful: - -```js -auth0.login({ - connection: 'google-oauth2' -}); -``` - -##### Single Page Apps - -If you're building a SPA (Single Page Application) and using Redirect Mode, then your `callbackURL` should send the user back to the same page. And because the `responseType` initialization option was set to `'token'`, Auth0 will also append a hash to that URL that will contain an Access Token and ID Token (the JWT). After control returns to your app, the full user profile can be retrieved via the `parseHash` and `getProfile` methods: - -```js -$(function () { - var result = auth0.parseHash(window.location.hash); - - //use result.idToken to call your rest api - - if (result && result.idToken) { - // optionally fetch user profile - auth0.getProfile(result.idToken, function (err, profile) { - alert('hello ' + profile.name); - }); - - // If offline_access was a requested scope - // You can grab the result.refresh_token here - - } else if (result && result.error) { - alert('error: ' + result.error); - } -}); -``` - -If the `scope` option used with the `login` method did not contain `openid profile`, then the profile will only contain `user_id`. In that case just parse the hash to obtain the user ID: - -```js -$(function () { - var result = auth0.parseHash(window.location.hash); - if (result && result.profile) { - alert('your user_id is: ' + result.profile.sub); - //use result.id_token to call your rest api - } - }); -}); -``` - -If there is no hash, `result` will be null. If the hash contains the JWT, the `profile` field will be populated. - -##### Regular Web Apps - -If you're building a regular web application (HTML pages rendered on the server), then `callbackURL` should point to a server-side endpoint that will process the successful login, primarily to set some sort of session cookie. In this scenario you should make sure the `responseType` option is `'code'` (or just not specified) when the Auth0 application is created: - -```js -var auth0 = new Auth0({ - domain: 'mine.auth0.com', - clientID: 'dsa7d77dsa7d7', - callbackURL: 'http://my-app.com/callback' - // responseType not set (defaults to 'code') -}); -``` - -On successful login, Auth0 will redirect to your `callbackURL` with an appended authorization `code` query parameter. Unlike the SPA scenario, this `code` value should get processed completely server-side. - -::: panel Authorization Code Grant -Server-side processing of the `code` looks something like this: Using whichever [Auth0 server-side SDK](/quickstart/webapp) necessary, the endpoint on the server should exchange the `code` for an Access Token and ID Token and optionally a full user profile. It should then set some kind of local session cookie, which is what enables a user to be "logged in" to the website and usually contains data from the user profile. It should finally redirect the user back to a meaningful page. -::: - -#### Popup Mode - -Besides Redirect Mode, the `login` method also supports Popup Mode, which you enable by passing `popup: true` in the `options` argument. In this mode the browser will *not* be redirected to a separate login page. Instead Auth0 will display a popup window where the user enters their credentials. The advantage of this approach is that the original page (and all of its state) remains intact, which can be important, especially for certain Single Page Apps. - -::: panel-warning Popup mode issues -While Popup Mode does have the advantage of preserving page state, it has some issues. Often times users have popup blockers that prevent the login page from even displaying. There are also known issues with mobile browsers. For example, in recent versions of Chrome on iOS, the login popup does not get closed properly after login (see an example [here](https://github.com/auth0/lock/issues/71)). For these reasons, we encourage developers to favor Redirect Mode over Popup Mode, even with Single Page Apps. -::: - -In Popup Mode you also have no need to be redirected back to the application, since, once the user has logged in, the popup is simply closed. Instead Auth0 uses the `login` method's `callback` argument to return control to your client-side application, for both failed and successful logins. Along with the `err` argument, `callback` should also receive a `result` argument with the following properties: `idTokenPayload, idToken, accessToken, state` (and optionally `refreshToken` if the `offline_access` scope has been requested): - -```js -auth0.login({ - popup: true, - connection: 'google-oauth2' -}, -function(err, result) { - if (err) { - // Handle the error! - return; - } - - // Success! - - // optionally fetch user profile - auth0.getProfile(result.idToken, function (err, profile) { - alert('hello ' + profile.name); - }); -}); -``` - -#### Database and Active Directory/LDAP connections - -The behavior of Redirect and Popup Modes differs if you're using a [Database](/connections/database/mysql) or [Active Directory/LDAP](/connections/enterprise/active-directory) connection. Those differences depend on two factors: whether SSO ([Single Sign-On](/sso/single-sign-on)) is enabled and whether or not credentials are being directly passed to the `login` method. - -##### SSO enabled - -By default SSO is enabled (equivalent to passing the `sso: true` option to the `login` method). This means that after a successful login, Auth0 will set a special cookie that [can be used](#sso) to automatically log a user onto additional websites that are registered as Auth0 apps. When using either the Database or Active Directory/LDAP connections with SSO enabled, you can still choose to go with Redirect or Popup Mode. - -As with other connection types, Redirect Mode will happen by default. The browser will navigate to a login page that will prompt the user for their credentials and then, when login is complete, redirect back to the `callbackURL`. However, one of the unique options you have with Database and Active Directory/LDAP connections is that the redirect to the login page can be bypassed if the `username` and `password` options are passed to the `login` method. These values are typically collected via a *custom login form* in your app: - -```js -auth0.login({ - connection: 'db-conn', - username: $('.username').val(), - password: $('.password').val(), -}, -function (err) { - // this only gets called if there was a login error -}); -``` - -If the login is successful, the browser will then be redirected to `callbackURL`. And as shown above, a `callback` argument should also be provided to the `login` method that handles any authentication errors (without redirecting). - -Furthermore, sometimes you don't want a redirect to occur at all after a login. This is often the case with Single Page Apps where a redirect will result in loss of important page state. To handle all login results client-side, simply provide additional parameters to the `callback` argument JavaScript function: - -```js -auth0.login({ - connection: 'db-conn', - username: $('.username').val(), - password: $('.password').val(), -}, -function(err, result) { - if (err) { - // Handle the error! - return; - } - - // Success! -}); -``` - -::: note -This `callback` approach is similar to what you'd do in the [Popup Mode](#popup-mode) scenario described earlier, except no popups (or redirects) occur since credentials are provided to the `login` method and success and failure is handled in the `callback` argument. -::: - -You can still do Popup Mode with SSO enabled with a Database or Active Directory/LDAP connection if you want to (but please see the **WARNING** in the [Popup Mode](#popup-mode) section above). This is similar to the Redirect Mode scenario where you don't have a custom login form, but want to use a popup window to collect the user's credentials, and also want control to return to the client-side code (vs. redirecting to `callbackURL`). This behavior would occur if you simply specified the `popup: true` option: - -```js -auth0.login({ - connection: 'db-conn', - popup: true -}, -function(err, result) { - if (err) { - // Handle the error! - return; - } - - // Success! -}); -``` - -##### SSO disabled - -If you explicitly don't want SSO enabled in your application, you can pass the `sso: false` option to the `login` method. The result is that when a login occurs, Auth0 performs a CORS POST request (or in IE8 or 9 a JSONP request) against a special "resource owner" endpoint (`/ro`), which allows users to authenticate by sending their username and password. Also, no SSO cookie is set. - -There are a couple important constraints at play when SSO is disabled: - -* Because the `/ro` endpoint requires credentials, the `username` and `password` options must be passed to the `login` method -* It's not possible to use Popup Mode when SSO is disabled, even if you pass `popup: true` - -This leaves you with a call to the `login` method that looks something like this: - -```js -auth0.login({ - connection: 'db-conn', - sso: false, - username: $('.username').val(), - password: $('.password').val() -}, -function(err) { - // this only gets called if there was a login error -}); -``` - -If the login succeeds, Auth0 will redirect to your `callbackURL`, and if it fails, control will be given to the `callback`. - -And if you don't want that redirect to occur (for example, you have a Single Page App), you can use a `callback` argument that takes the additional parameters (like what's shown in [Popup Mode](#popup-mode)), and control will go to your callback function with a failed or successful login. - -### Response configuration - -By default, after a successful login, the browser is redirected back to the `callbackURL` with an authorization `code` included in the `query` string. This `code` is then used by a server to obtain an Access Token. The Access Token can be obtained directly if you provide the `responseType: 'token'` option. In this case the Access Token will be included in the fragment (or hash) part of the `callbackURL`. Finally, you can specify `responseType: 'id_token'` if you just need an ID Token. - -```js -var auth0 = new Auth0({ - domain: 'mine.auth0.com', - clientID: 'dsa7d77dsa7d7', - callbackURL: 'http://my-app.com/callback', - responseType: 'token' // also 'id_token' and 'code' (default) -}); -``` - -Besides being included in the URL, the code or the tokens can be encoded in HTML form and transmitted via an HTTP POST request to the `callbackUrl`. The `responseMode: 'form_post'` option needs to be used to activate this flow. - -```js -var auth0 = new Auth0({ - domain: 'mine.auth0.com', - clientID: 'dsa7d77dsa7d7', - callbackURL: 'http://my-app.com/callback', - responseMode: 'form_post', - responseType: 'token' // also 'id_token' and 'code' (default) -}); -``` - -Both `responseType` and `responseMode` options were added in version `7.2.0`. In previous versions, a subset of the functionality of these options was available through `callbackOnLocationHash`. `responseType: 'code'` is equivalent to `callbackOnLocationHash: false` and `responseType: 'token'` is equivalent to `callbackOnLocationHash: true`. The `callbackOnLocationHash` option is still available for compatibility reasons, but it has been deprecated and will be removed in version `8.0.0`. Also note that is not possible to use `callbackOnLocationHash` and `responseType` at the same time. - -```js -// The next two snippets are equivalent, and a code will be included in the -// callbackURL after a successful login -var auth0 = new Auth0({ - // ... - responseType: 'code' -}); - -var auth0 = new Auth0({ - // ... - callbackOnLocationHash: false -}); - -// The next two snippets are equivalent, and a token will be included in the -// callbackURL after a successful login -var auth0 = new Auth0({ - // ... - responseType: 'token' -}); - -var auth0 = new Auth0({ - // ... - callbackOnLocationHash: true -}); -``` - -### Change Password (database connections): - -```js - $('.change_password').click(function () { - auth0.changePassword({ - connection: 'db-conn', - email: 'foo@bar.com' - }, function (err, resp) { - if(err){ - console.log(err.message); - }else{ - console.log(resp); - } - - }); - }); -``` - -This request will always return a 200, even if the user doesn't exist. -The user will receive an email with a link to reset their password. - -### Delegation Token Request - -A delegation token is a new token for a different service or app/API. - -If you just want to get a new token for an addon that you've activated, you can do the following: - -```js -var options = { - id_token: "your ID Token", // The ID Token you have now - api: 'firebase', // This defaults to the first active addon if any or you can specify this - "scope": "openid profile" // default: openid -}; - -auth0.getDelegationToken(options, function (err, delegationResult) { - // Call your API using delegationResult.id_token -}); -``` - -If you want to get the token for another API or App: - -```js -var options = { - id_token: "your ID Token", // The ID Token you have now - api: 'auth0' // This is default when calling another app that doesn't have an addon - targetClientId: 'The other application id' -}; - -auth0.getDelegationToken(options, function (err, delegationResult) { - // Call your API using delegationResult.id_token -}); -``` - -### Refresh Token - -If you want to refresh your existing (not expired) token, you can just do the following: - -```js -auth0.renewIdToken(current_id_token, function (err, delegationResult) { - // Get here the new delegationResult.id_token -}); -``` - -If you want to refresh your existing (expired) token, if you have the Refresh Token, you can call the following: - -```js -auth0.refreshToken(refresh_token, function (err, delegationResult) { - // Get here the new delegationResult.id_token -}); -``` - -### Validate User - -You can validate a user of a specific connection using username and password: - -```js -auth0.validateUser({ - connection: 'db-conn', - username: 'foo@bar.com', - password: 'blabla' -}, function (err, valid) { }); -``` - -### SSO - -Method `getSSOData` fetches Single Sign-On information: - -```js - auth0.getSSOData(function (err, ssoData) { - if (err) return console.log(err.message); - expect(ssoData.sso).to.exist; - }); -``` - -The returned `ssoData` object will contain the following fields, for example: - -```js -{ - sso: true, - sessionClients: [ - "jGMow0KO3WDJELW8XIxolqb1XIitjkYL" - ], - lastUsedClientID: "jGMow0KO3WDJELW8XIxolqb1XIitjkYL", - lastUsedUsername: "alice@example.com", - lastUsedConnection: { - name: "Username-Password-Authentication", - strategy: "auth0" - } -} -``` - -Load Active Directory data if available (Kerberos): - -```js - auth0.getSSOData(true, fn); -``` - -When Kerberos is available you can automatically trigger Windows Authentication. As a result the user will immediately be authenticated without taking any action. - -```js - auth0.getSSOData(true, function (err, ssoData) { - if (!err && ssoData && ssoData.connection) { - auth0.login({ connection: ssoData.connection }); - } - }); -``` - - - -[npm-image]: https://img.shields.io/npm/v/auth0-js.svg?style=flat-square -[npm-url]: https://npmjs.org/package/auth0-js -[travis-image]: https://travis-ci.org/auth0/auth0.js.svg?branch=master -[travis-url]: https://travis-ci.org/auth0/auth0.js -[coveralls-image]: https://img.shields.io/coveralls/auth0/auth0.js.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/auth0/auth0.js?branch=master -[david-image]: http://img.shields.io/david/auth0/auth0.js.svg?style=flat-square -[david-url]: https://david-dm.org/auth0/auth0.js -[license-image]: http://img.shields.io/npm/l/auth0-js.svg?style=flat-square -[license-url]: #license -[downloads-image]: http://img.shields.io/npm/dm/auth0-js.svg?style=flat-square -[downloads-url]: https://npmjs.org/package/auth0-js diff --git a/articles/libraries/auth0js/v8/index.md b/articles/libraries/auth0js/v8/index.md deleted file mode 100644 index 82ba180029..0000000000 --- a/articles/libraries/auth0js/v8/index.md +++ /dev/null @@ -1,564 +0,0 @@ ---- -section: libraries -toc: true -description: How to install, initialize and use auth0.js v8 -topics: - - libraries - - auth0js -contentType: - - index - - how-to -useCase: add-login ---- -# Auth0.js v8 Reference - -<%= include('../../../_includes/_version_warning_auth0js') %> - -Auth0.js is a client-side library for Auth0. Using auth0.js in your web apps makes it easier to do authentication and authorization with Auth0 in your web apps. - -::: note -Check out the [Auth0.js repository](https://github.com/auth0/auth0.js/tree/v8) on GitHub. -::: - -## Ready-to-go example - -The [example directory](https://github.com/auth0/auth0.js/tree/master/example) of the auth0.js library is a ready-to-go app that can help you to quickly and easily try out auth0.js. In order to run it, follow these quick steps: - -1. If you don't have [node](http://nodejs.org/) installed, do that now -1. Download dependencies by running `npm install` from the root of this project -1. Finally, execute `npm start` from the root of this project, and then browse to your app running on the node server, presumably at `http://localhost:3000/example`. - -## Setup and initialization - -Now, let's get started integrating auth0.js into your project. We'll cover [methods of installation](#installation-options), [how to initialize auth0.js](#initialization), [signup](#sign-up), [login](#login), [logout](#logout), and more! - -### Installation options - -You have a few options for using auth0.js in your project. Pick one of the below depending on your needs: - -Install via [npm](https://npmjs.org): - -```sh -npm install auth0-js -``` - -Install via [bower](http://bower.io): - -```sh -bower install auth0.js -``` - -```html - -``` - -Include via our CDN: - -```html - -``` - -::: note -For production use, the latest patch release (for example, 8.0.0) is recommended, rather than the latest minor release indicated above. -::: - -If you are using a bundler, you will want to install with `npm i auth0-js --production --save`. - -### Initialization - -Initialize a new instance of the Auth0 application as follows: - -```html - -``` - -#### Available parameters - -There are two required parameters that must be passed in the `options` object when instantiating `webAuth`, and more that are optional. - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `domain` | required | (String) Your Auth0 account domain (ex. myaccount.auth0.com) | -| `clientID` | required | (String) Your Auth0 client ID | -| `redirectUri` | optional | (String) The default `redirectUri` used. Defaults to an empty string (none). | -| `scope` | optional | (String) The default scope(s) used by the application. Using scopes can allow you to return specific claims for specific fields in your request. You should read our [documentation on scopes](/scopes) for further details. | -| `audience` | optional | (String) The default audience to be used for requesting API access. | -| `responseType` | optional | (String) The default `responseType` used. It can be any space separated list of the values `code`, `token`, `id_token`. It defaults to `'token'`, unless a `redirectUri` is provided, then it defaults to `'code'`. | -| `responseMode` | optional | (String) This option is omitted by default. Can be set to `'form_post'` in order to send the token or code to the `'redirectUri'` via POST. Supported values are `query`, `fragment` and `form_post`. The `query` value is only supported when `responseType` is `code`. | -| `_disableDeprecationWarnings` | optional | (Boolean) Disables the deprecation warnings, defaults to `false`. | - -## Login - -You can choose a method for login based on the type of auth you need in your application. - -### webAuth.authorize() - -The `authorize()` method can be used for logging in users via [Universal Login](/hosted-pages/login), or via social connections, as exhibited in the examples below. This method invokes the [/authorize endpoint](/api/authentication?javascript#social) of the Authentication API, and can take a variety of parameters via the `options` object. - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `audience` | optional | (String) The default audience to be used for requesting API access. | -| `scope` | optional | (String) The scopes which you want to request authorization for. These must be separated by a space. You can request any of the standard OIDC scopes about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | -| `responseType` | optional | (String) It can be any space separated list of the values `code`, `token`, `id_token`. It defaults to `'token'`, unless a `redirectUri` is provided, then it defaults to `'code'`. | -| `clientID` | optional | (String) Your Auth0 client ID. | -| `redirectUri` | optional | (String) The URL to which Auth0 will redirect the browser after authorization has been granted for the user. | -| `leeway` | optional | (Integer) A value in seconds; leeway to allow for clock skew with regard to JWT expiration times. | - -::: note -Because of clock skew issues, you may occasionally encounter the error `The token was issued in the future`. The `leeway` parameter can be used to allow a few seconds of leeway to JWT expiration times, to prevent that from occuring. -::: - -For hosted login, one must call the `authorize()` method. - -```js -webAuth.authorize({ - //Any additional options can go here -}); -``` - -For social logins, the `connection` parameter will need to be specified: - -```js -webAuth.authorize({ - connection: 'twitter' -}); -``` - -### webAuth.popup.authorize() - -For popup authentication the `popup.authorize` method can be used. - -Hosted login with popup: - -```js -webAuth.popup.authorize({ - //Any additional options can go here -}, function(err, authResult) { - //do something -}); -``` - -And for social login with popup using `authorize`: - -```js -webAuth.popup.authorize({ - connection: 'twitter' -}, function(err, authResult) { - //do something -}); -``` - -### webAuth.redirect.loginWithCredentials() - -To login using redirect with credentials to enterprise connections, the `redirect.loginWithCredentials` method is used. - -```js -webAuth.redirect.loginWithCredentials({ - connection: 'Username-Password-Authentication', - username: 'testuser', - password: 'testpass', - scope: 'openid' -}, function(err, authResult) { - // Auth tokens in the result or an error -}); -``` - -The use of `webauth.redirect.loginWithCredentials` is not recommended when using Auth0.js in your apps; it is recommended that you use `webauth.login` instead. - -However, using `webauth.redirect.loginWithCredentials` **is** the correct choice for use in the Universal Login page, and is the only way to have SSO cookies set for your users who login using Universal Login. - -### webAuth.popup.loginWithCredentials() - -To login using popup mode with credentials to enterprise connections, the `popup.loginWithCredentials` method is used. - -```js -webAuth.popup.loginWithCredentials({ - connection: 'Username-Password-Authentication', - username: 'testuser', - password: 'testpass', - scope: 'openid' -}, function(err, authResult) { - // Auth tokens in the result or an error -}); -``` - -### webAuth.login() - -The `login` method allows for [cross-origin auth](/cross-origin-authentication) using database connections, using `/co/authenticate`. - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `username` | optional | (String) The username to present for authentication. **Either** `username` or `email` must be present. | -| `email` | optional | (String) The email to present for authentication. **Either** `username` or `email` must be present.| -| `password` | required | (String) The password to present for authentication. | -| `realm` | required | (String) The name of the database connection against which to authenticate. See [realm documentation](/api-auth/tutorials/password-grant#realm-support) for more information | - -```js -webAuth.login({ - realm: 'tests', - username: 'testuser', - password: 'testpass', -}); -``` - -### buildAuthorizeUrl(options) - -The `buildAuthorizeUrl` method can be used to build the `/authorize` URL, in order to initialize a new transaction. Use this method if you want to implement browser based authentication. - -```js -// Calculate URL to redirect to -var url = webAuth.client.buildAuthorizeUrl({ - clientID: '${account.clientId}', - responseType: 'token id_token', - redirectUri: '${account.callback}', - state: 'YOUR_STATE' -}); - -// Redirect to url -// ... -``` - -::: note -The `state` parameter is an opaque value that Auth0 will send back to you. This method helps prevent CSRF attacks, and it needs to be specified if you redirect to the URL yourself instead of calling `webAuth.authorize()`. The [OAuth state documentation](/protocols/oauth2/oauth-state) describes how to do use it correctly. -::: - -## Passwordless login - -Passwordless authentication allows users to log in by receiving a one-time password via email or text message. The process will require you to start the Passwordless process, generating and dispatching a code to the user, (or a code within a link), followed by accepting their credentials via the verification method. That could happen in the form of a login screen which asks for their (email or phone number) and the code you just sent them. It could also be implemented in the form of a Passwordless link instead of a code sent to the user. They would simply click the link in their email or text and it would hit your endpoint and verify this data automatically using the same verification method (just without manual entry of a code by the user). - -In order to use Passwordless, you will want to initialize Auth0.js with a `redirectUri` and to set the `responseType: 'token'`. - -```js -var webAuth = new auth0.WebAuth({ - clientID: '${account.clientId}', - domain: '${account.namespace}', - redirectUri: 'http://example.com', - responseType: 'token id_token' -}); -``` - -### Start passwordless - -The first step in Passwordless authentication with Auth0.js is the `passwordlessStart` method, which has several parameters which can be passed within its `options` object: - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `connection` | required | (String) Specifies how to send the code/link to the user. Value must be either `email` or `sms`. | -| `send` | required | (String) Value must be either `code` or `link`. If `null`, a link will be sent. | -| `phoneNumber` | optional | (String) The user's phone number for delivery of a code or link via SMS. | -| `email` | optional | (String) The user's email for delivery of a code or link via email. | - -Note that exactly _one_ of the optional `phoneNumber` and `email` parameters must be sent in order to start the Passwordless transaction. - -```js -webAuth.passwordlessStart({ - connection: 'email', - send: 'code', - email: 'foo@bar.com' - }, function (err,res) { - // handle errors or continue - } -); -``` - -### Passwordless login - -If sending a code, you will then need to prompt the user to enter that code. You will process the code, and authenticate the user, with the `passwordlessLogin` method, which has several parameters which can be sent in its `options` object: - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `connection` | required | (String) Specifies how to send the code/link to the user. Value must be either `email` or `sms` and the same as the value passed to `passwordlessStart`. | -| `verificationCode` | required | (String) The code sent to the user, either as a code or embedded in a link. | -| `phoneNumber` | optional | (String) The user's phone number to which the code or link was delivered via SMS. | -| `email` | optional | (String) The user's email to which the code or link was delivered via email. | - -As with `passwordlessStart`, exactly _one_ of the optional `phoneNumber` and `email` parameters must be sent in order to complete the passwordless login. - -::: note -In order to use `passwordlessLogin`, the options `redirectUri` and `responseType: 'token'` must be specified when first initializing WebAuth. -::: - -```js -webAuth.passwordlessLogin({ - connection: 'email', - email: 'foo@bar.com', - verificationCode: '389945' - }, function (err,res) { - // handle errors or continue - } -); -``` - -## Extract the authResult and get user info - -After authentication occurs, you can use the `parseHash` method to parse a URL hash fragment when the user is redirected back to your application in order to extract the result of an Auth0 authentication response. You may choose to handle this in a callback page that will then redirect to your main application, or in-page, as the situation dictates. - -The `parseHash` method takes an `options` object that contains the following parameters: - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `state` | optional | (String) An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value must be used by the application to prevent CSRF attacks. | -| `nonce` | optional | (String) Used to verify the ID Token -| `hash` | optional | (String) The URL hash (if not provided, `window.location.hash` will be used by default) | - -::: note -This method requires that your tokens are signed with RS256 rather than HS256. For more information about this, check the [Auth0.js v8 Migration Guide](/libraries/auth0js/migration-guide#the-parsehash-method). -::: - -The contents of the authResult object returned by `parseHash` depend upon which authentication parameters were used. It can include: - -| **Item** | **Description** | -| --- | --- | -| `accessToken` | An Access Token for the API, specified by the `audience` | -| `expiresIn` | A string containing the expiration time (in seconds) of the `accessToken` | -| `idToken` | An ID Token JWT containing user profile information | - -```js -webAuth.parseHash({ hash: window.location.hash }, function(err, authResult) { - if (err) { - return console.log(err); - } - - webAuth.client.userInfo(authResult.accessToken, function(err, user) { - // Now you have the user's information - }); -}); -``` - -As shown above, the `client.userInfo` method can be called passing the returned `accessToken`. It will make a request to the `/userinfo` endpoint and return the `user` object, which contains the user's information, formatted similarly to the below example. - -```json -{ - "email_verified": "false", - "email": "test@example.com", - "clientID": "AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH", - "updated_at": "2017-02-07T20:50:33.563Z", - "name": "tester9@example.com", - "picture": "https://gravatar.com/avatar/example.png", - "user_id": "auth0|123456789012345678901234", - "nickname": "tester9", - "identities": [ - { - "user_id": "123456789012345678901234", - "provider": "auth0", - "connection": "Username-Password-Authentication", - "isSocial": "false" - } - ], - "created_at": "2017-01-20T20:06:05.008Z", - "sub": "auth0|123456789012345678901234" -} -``` - -You can now do something else with this information as your application needs, such as acquire the user's entire set of profile information with the Management API, as described below. - -## Using nonces - -By default (and if `responseType` contains `id_token`), `auth0.js` will generate a random `nonce` when you call `webAuth.authorize`, store it in local storage, and pull it out in `webAuth.parseHash`. The default behavior should work in most cases, but some use cases may require a developer to control the `nonce`. -If you want to use a developer generated `nonce`, then you must provide it as an option to both `webAuth.authorize` and `webAuth.parseHash`. - -```js -webAuth.authorize({nonce: '1234', responseType: 'token id_token'}); -webAuth.parseHash({nonce: '1234'}, callback); -``` - -If you're calling `webAuth.checkSession` instead of `webAuth.authorize`, then you only have to specify your custom `nonce` as an option to `checkSession`: - -```js -webAuth.checkSession({ - audience: 'https://example.com/api/v2', - scope: 'openid read:something write:otherthing', - responseType: 'token id_token', - nonce: '1234' -}, function (err, authResult) { - ... -}); -``` - -The `webAuth.checkSession` method will automatically verify that the returned ID Token's `nonce` claim is the same as the option. - -## Logout - -To log out a user, use the `logout` method. This method accepts an options object, which can include the following parameters. - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `returnTo` | optional | (String) URL to redirect the user to after the logout. | -| `clientID` | optional | (String) Your Auth0 client ID | -| `federated` | optional | (Querystring parameter) Add this querystring parameter to the logout URL, to log the user out of their identity provider, as well: `https://${account.namespace}/v2/logout?federated`. | - -::: panel returnTo parameter -Note that if the `clientID` parameter is included, the `returnTo` URL that is provided must be listed in the Application's **Allowed Logout URLs** in the [Auth0 dashboard](${manage_url}). However, if the `clientID` parameter _is not_ included, the `returnTo` URL must be listed in the **Allowed Logout URLs** at the *account level* in the [Auth0 dashboard](${manage_url}). -::: - -```js -webAuth.logout({ - returnTo: 'some url here', - clientID: 'some client ID here' -}); -``` - -## Signup - -To sign up a user, use the `signup` method. This method accepts an options object, which can include the following parameters. - -| **Parameter** | **Required** | **Description** | -| --- | --- | --- | -| `email` | required | (String) User's email address | -| `password` | required | (String) User's desired password | -| `connection` | required | (String) The database connection name on your application upon which to attempt user account creation | - -Signups should be for database connections. Here is an example of the `signup` method and some sample code for a form. - -```html -

    Signup Database Connection

    - - - - -``` - -## Using checkSession to acquire new tokens - -The `checkSession` method allows you to acquire a new token from Auth0 for a user who has a current session in Auth0 server for your domain. The method accepts any valid OAuth2 parameters that would normally be sent to `authorize`. - -```js -webAuth.checkSession({ - audience: 'https://example.com/api/v2', - scope: 'read:something write:otherthing' -}, function (err, authResult) { - // err if automatic parseHash fails - ... -}); -``` - -The actual redirect to `/authorize` happens inside an iframe, so it will not reload your application or redirect away from it. - -Remember to add the URL where the authorization request originates from, to the **Allowed Web Origins** list of your Auth0 application in the [Dashboard](${manage_url}) under your application's **Settings**. - -::: warning -If the connection is a social connection and you are using Auth0 dev keys, the `checkSession` call will always return `login_required`. -::: - -## Password reset requests - -If attempting to set up a password reset functionality, you'll use the `changePassword` method and pass in an "options" object, with a "connection" parameter and an "email" parameter. - -```js - $('.change_password').click(function () { - webAuth.changePassword({ - connection: 'db-conn', - email: 'foo@bar.com' - }, function (err, resp) { - if(err){ - console.log(err.message); - }else{ - console.log(resp); - } - }); - }); -``` - -The user will then receive an email which will contain a link that they can follow to reset their password. - -## Cross-Origin authentication - -Using auth0.js within your application (rather than using [Universal Login](/hosted-pages/login)) requires cross-origin authentication. Make sure you read the [cross-origin authentication documentation](/cross-origin-authentication) to understand how to properly configure your application to make it work. - -## User management - -The Management API provides functionality that allows you to link and unlink separate user accounts from different providers, tying them to a single profile (Read more about [Linking Accounts](/link-accounts) with Auth0). It also allows you to update user metadata. - -To get started, you first need to obtain a an Access Token that can be used to call the Management API. You can do it by specifying the `https://${account.namespace}/api/v2/` audience when initializing Auth0.js, in which case you will get the Access Token as part of the authentication flow. - -```js -var webAuth = new auth0.WebAuth({ - clientID: '${account.clientId}', - domain: '${account.namespace}', - redirectUri: 'http://example.com', - audience: `https://${account.namespace}/api/v2/`, - scope: 'read:current_user', - responseType: 'token id_token' -}); -``` - -You can also do so by using `checkSession()`: - -``` -webAuth.checkSession( - { - audience: `https://${account.namespace}/api/v2/`, - scope: 'read:current_user' - }, function(err, result) { - // use result.accessToken - } -); -``` - -You must specify the specific scopes you need. You can ask for the following scopes: - -* `read:current_user` -* `update:current_user_identities` -* `create:current_user_metadata` -* `update:current_user_metadata` -* `delete:current_user_metadata` -* `create:current_user_device_credentials` -* `delete:current_user_device_credentials` - -Once you have the Access Token, you can create a new `auth0.Management` instance by passing it the account's Auth0 domain, and the Access Token. - -```js -var auth0Manage = new auth0.Management({ - domain: '${account.namespace}', - token: 'ACCESS_TOKEN' -}); -``` - -### Getting the user profile - -In order to get the user profile data, use the `getUser()` method, with the `userId` and a callback as parameters. The method returns the user profile. Note that the `userID` required here will be the same one fetched from the `client.userInfo` method. - -```js -auth0Manage.getUser(userId, cb); -``` - -### Updating the user profile - -When updating user metadata, you will need to first create a `userMetadata` object, and then call the `patchUserMetadata` method, passing it the user id and the `userMetadata` object you created. The values in this object will overwrite existing values with the same key, or add new ones for those that don't yet exist in the user metadata. Visit the [User Metadata](/metadata) documentation for more details on user metadata. - -```js -auth0Manage.patchUserMetadata(userId, userMetadata, cb); -``` - -### Linking users - -Linking user accounts will allow a user to authenticate from any of their accounts and no matter which one they use, still pull up the same profile upon login. Auth0 treats all of these accounts as separate profiles by default, so if you wish a user's accounts to be linked, this is the way to go. - -The `linkUser` method accepts two parameters, the primary `userId` and the secondary user's ID Token (the token obtained after login with this identity). The user id in question is the unique identifier for this user account. If the id is in the format `facebook|1234567890`, the id required is the portion after the delimiting pipe. Visit the [Linking Accounts](/link-accounts) documentation for more details on linking accounts. - -```js -auth0Manage.linkUser(userId, secondaryUserToken, cb); -``` - -After linking the accounts, the second account will no longer exist as a separate entry in the user database, and will only be accessible as part of the primary one. - -::: note -Note that when accounts are linked, the secondary account's metadata is **not** merged with the primary account's metadata, and if they are ever unlinked, the secondary account will likewise not retain the primary account's metadata when it becomes separate again. -::: diff --git a/articles/libraries/auth0js/v8/migration-guide.md b/articles/libraries/auth0js/v8/migration-guide.md deleted file mode 100644 index 3b415cc269..0000000000 --- a/articles/libraries/auth0js/v8/migration-guide.md +++ /dev/null @@ -1,225 +0,0 @@ ---- -section: libraries -title: Auth0.js v7 to v8 Migration Guide -description: How to migrate from auth0.js v7 to auth0.js v8 -toc: true -topics: - - libraries - - auth0js -contentType: - - index - - how-to -useCase: - - add-login - - migrate ---- -# Auth0.js v7 to v8 Migration Guide - -The following instructions assume you are migrating from **auth0.js v7** to **auth0.js v8**. - -The goal of this migration guide is to provide you with all of the information you would need to update Auth0.js in your application. Of course, your first step is to include the latest version of auth0.js. Beyond that, take a careful look at each of the areas on this page. You will need to change your implementation of auth0.js to reflect the new changes. - -Take a look below for more information about changes and additions to Auth0.js in version 8! - -## Reasons to Migrate - -The first question to answer before getting into the changes is why to migrate your app to the new version at all. Here are a few quick points that address that: - -* With version 8 of the Auth0.js SDK, you can use [our latest and most secure authentication pipeline](/api-auth/intro), compliant with the OpenID Connect specification. For more information, refer to the below section [Use of API Auth and Metadata](#use-of-api-auth-and-metadata). -* Auth0.js v8 was rewritten from scratch, improving its cohesion and performance and coming with more tests to be utilized. -* Long term support - As is often the case with new iterations of projects, v8 will be supported for significantly longer than v7. - -### Use of API Auth and Metadata - -There are often situations where your APIs will need to authorize limited access to users, servers, or servers on behalf of users. Managing these types of authorization flows and access to your APIs is much easier with Auth0. If you need to use these [API Auth](/api-auth) features, we recommend that you upgrade to [auth0.js v8](/libraries/auth0js/v8). - -Alternatively, you could also simply request the metadata in a different way, for example with a rule to add custom claims to either the returned ID Token or Access Token as described in the [custom claims](/scopes/current#custom-claims) section of the scopes documentation. - -::: note -You can find detailed information about supported methods in the [Auth0.js v8](/libraries/auth0js) documentation, and generated documentation on all methods [here](http://auth0.github.io/auth0.js/global.html) for further reading. -::: - -## Initialization of auth0.js - -Initialization of auth0.js in your application will now use `auth0.WebAuth` instead of `Auth0` - -```html - - -``` - -## Login - -The `login` method of version 7 was divided into several different methods in version 8, based on the type of auth you need, rather than the old `login` method. - -### webAuth.authorize() - -The `authorize` method can be used for logging in users via [Universal Login](/hosted-pages/login), or via social connections, as exhibited below. - -For hosted login, one must call the authorize endpoint - -```js -webAuth.authorize({ - //Any additional options can go here -}); -``` - -For social logins, the connection will need to be specified - -```js -webAuth.authorize({ - connection: 'twitter' -}); -``` - -### webAuth.popup.authorize() - -For popup authentication, the `popup.authorize` method can be used. - -Hosted login with popup - -```js -webAuth.popup.authorize({ - //Any additional options can go here -}); -``` - -And social login with popup - -```js -webAuth.popup.authorize({ - connection: 'twitter' -}); -``` - -### webAuth.redirect.loginWithCredentials() - -To login with credentials to enterprise connections, the `redirect.loginWithCredentials` method is used. - -With redirect - -```js -webAuth.redirect.loginWithCredentials({ - connection: 'Username-Password-Authentication', - username: 'testuser', - password: 'testpass', - scope: 'openid' -}); -``` - -### webAuth.popup.loginWithCredentials() - -Or, popup authentication can be performed with `popup.loginWithCredentials`. - -```js -webAuth.popup.loginWithCredentials({ - connection: 'Username-Password-Authentication', - username: 'testuser', - password: 'testpass', - scope: 'openid' -}); -``` - -### webAuth.client.login() - -The `client.login` method allows for non redirect auth using custom database connections, using /oauth/token. - -```js -webAuth.client.login({ - realm: 'tests', - username: 'testuser', - password: 'testpass', - scope: 'openid profile', - audience: 'urn:test' -}); -``` - -### Passwordless Login - -Passwordless authentication is no longer available using the v7 methods. Now, passwordless is a simpler process, begun by calling `passwordlessStart` and completed by calling `passwordlessLogin`. See the v8 [documentation on Passwordless Authentication](/libraries/auth0js#passwordless-login) for more details! - -```js -webAuth.passwordlessStart({ - connection: 'Username-Password-Authentication', - send: 'code', // code or link - email: 'foo@bar.com' // either send an email param or a phoneNumber param - }, function (err,res) { - // handle errors or continue - } -); -``` - -```js -webAuth.passwordlessLogin({ - connection: 'Username-Password-Authentication', - email: 'foo@bar.com', - verificationCode: '389945' - }, function (err,res) { - // handle errors or continue - } -); -``` - -## ID Token Validation - -When the ID Token signature method is HS256, auth0.js cannot validate the token, as it does not have the secret key. To populate the `idTokenPayload` property in the `parseHash` callback, it will call the [/userinfo](/api/authentication#get-user-info) endpoint to retrieve user information. - -If the ID Token is signed with RS256, auth0.js will validate the token, decode it, and populate the `idTokenPayload` with the decoded data. - -:::note -We recommend that you use RS256 for signing tokens in Single Page Applications. -::: - -### Switching from HS256 to RS256 - -::: panel-warning Before Changing the Signing Algorithm -Please note that altering the signing algorithm for your application will immediately change the way your user's tokens are signed. This means that if you have already implemented JWT verification for your application somewhere, your tokens will not be verifiable until you update the logic to account for the new signing algorithm. -::: - -To switch from HS256 to RS256 for a specific application, follow these instructions: - -1. Go to [Dashboard > Applications](${manage_url}/#/applications) -1. Select your application -1. Go to _Settings_ -1. Click on __Show Advanced Settings__ -1. Click on the _OAuth_ tab in Advanced Settings -1. Change the __JsonWebToken Signature Algorithm__ to `RS256` - -Remember that if the token is being validated anywhere else, changes might be needed there as well in order to comply. - -## Refreshing Tokens - -When a token is nearing expiration, or is expired, you may wish to simply renew the token rather than requiring a new transaction. - -In [auth0.js v7](/libraries/auth0js/v7#refresh-token), the `renewIdToken()` and `refreshToken()` methods were used to Refresh Tokens. In [auth0.js v8](/libraries/auth0js#using-checksession-to-acquire-new-tokens), refreshing tokens is done via the `checkSession()` method. If a user is already authenticated, `checkSession()` can be used to acquire a new token for that user. - -## Delegation - -Delegation is now done via the `delegation` method, which takes an `options` object containing the following potential parameters: - -* __client_id__ (required): a string; the Auth0 application identifier -* __grant_type__ (required): a string; must be `urn:ietf:params:oauth:grant-type:jwt-bearer` -* __id_token__ (required): a string; either a valid ID Token or a valid Refresh Token is required -* __refresh_token__: a string; either a valid Refresh Token or a valid ID Token is required -* __target__: a string; the target application id of the delegation -* __scope__: a string; either `'openid'` or `'openid profile email'` -* __api_type__: a string; the api to be called - -```js -webAuth.client.delegation({ - client_id: '${account.clientId}', - grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer', - id_token: 'valid ID Token here', - target: 'target client id here', - scope: 'openid' -}); -``` - -## User Management - -Linking accounts and gathering info has also changed. You can now instantiate a Management application object and call the `getUser`, `patchUserMetadata`, and `linkUser` methods on it to get a user's profile, update their metadata, or link two user accounts together. For more information, read about [user management](/libraries/auth0js#user-management) in the auth0.js documentation. diff --git a/articles/libraries/auth0js/v9/index.md b/articles/libraries/auth0js/v9/index.md index 9eca1eef27..4366c9d400 100644 --- a/articles/libraries/auth0js/v9/index.md +++ b/articles/libraries/auth0js/v9/index.md @@ -1,7 +1,7 @@ --- section: libraries toc: true -title: Auth0.js v9 Reference +title: auth0.js v9 Reference description: How to install, initialize and use auth0.js v9 topics: - libraries @@ -11,9 +11,9 @@ contentType: - how-to useCase: add-login --- -# Auth0.js v9 Reference +# auth0.js v9 Reference -Auth0.js is a client-side library for Auth0. It is recommended for use in single page apps, and auth0.js in your SPA makes it easier to do authentication and authorization with Auth0. +auth0.js is a client-side library for Auth0. It is recommended for use in single-page apps, preferably in conjunction with [Universal Login](/universal-login), which should be used whenever possible. Using auth0.js in your SPA makes it easier to do authentication and authorization with Auth0. The full API documentation for the library is [here](https://auth0.github.io/auth0.js/index.html). @@ -76,23 +76,23 @@ There are two required parameters that must be passed in the `options` object wh | `domain` | required | (String) Your Auth0 account domain (ex. myaccount.auth0.com) | | `clientID` | required | (String) Your Auth0 client ID | | `redirectUri` | optional* | (String) The default `redirectUri` used. Defaults to an empty string (none). **If you do not provide a global `redirectUri` value here, you will need to provide a redirectUri value for *each* method you use.** | -| `scope` | optional | (String) The default scope(s) used by the application. Using scopes can allow you to return specific claims for specific fields in your request. You should read our [documentation on scopes](/scopes) for further details. | +| `scope` | optional | (String) The default scope(s) used by the application. Using scopes can allow you to return specific claims for specific fields in your request. You should read our [documentation on scopes](/scopes) for further details. | | `audience` | optional | (String) The default audience to be used for requesting API access. | | `responseType` | optional* | (String) The default `responseType` used. It can be any space separated list of the values `code`, `token`, `id_token`. It defaults to `'token'`, unless a `redirectUri` is provided, then it defaults to `'code'`. **If you do not provide a global `responseType` value, you will need to provide a `responseType` value for *each* method you use.** | | `responseMode` | optional | (String) This option is omitted by default. Can be set to `'form_post'` in order to send the token or code to the `'redirectUri'` via POST. Supported values are `query`, `fragment` and `form_post`. | -| `leeway` | optional | (Integer) A value in seconds; leeway to allow for clock skew with regard to JWT expiration times. | +| `leeway` | optional | (Integer) A value in seconds; leeway to allow for clock skew with regard to ID Token expiration times. | | `_disableDeprecationWarnings` | optional | (Boolean) Disables the deprecation warnings, defaults to `false`. | ::: note -Because of clock skew issues, you may occasionally encounter the error `The token was issued in the future`. The `leeway` parameter can be used to allow a few seconds of leeway to JWT expiration times, to prevent that from occuring. +Because of clock skew issues, you may occasionally encounter the error `The token was issued in the future`. The `leeway` parameter can be used to allow a few seconds of leeway to ID Token expiration times, to prevent that from occurring. ::: ##### Scope -The default `scope` value in Auth0.js v9 is `openid profile email`. +The default `scope` value in auth0.js v9 is `openid profile email`. -::: panel Running Auth0.js Locally -If you don't specify at least the above scope when initializing Auth0.js, and you are running your website from `http://localhost` or `http://127.0.0.1`, calling the `getSSOData()` method will result in the following error in the browser console: +::: panel Running auth0.js Locally +If you don't specify at least the above scope when initializing auth0.js, and you are running your website from `http://localhost` or `http://127.0.0.1`, calling the `getSSOData()` method will result in the following error in the browser console: `Consent required. When using getSSOData, the user has to be authenticated with the following scope: openid profile email` @@ -105,17 +105,17 @@ You can choose a method for login based on the type of auth you need in your app ### webAuth.authorize() -The `authorize()` method can be used for logging in users via [Universal Login](/hosted-pages/login), or via social connections, as exhibited in the examples below. This method invokes the [/authorize endpoint](/api/authentication?javascript#social) of the Authentication API, and can take a variety of parameters via the `options` object. +The `authorize()` method can be used for logging in users via Universal Login, or via social connections, as exhibited in the examples below. This method invokes the [/authorize endpoint](/api/authentication?javascript#social) of the Authentication API, and can take a variety of parameters via the `options` object. | **Parameter** | **Required** | **Description** | | --- | --- | --- | | `audience` | optional | (String) The default audience to be used for requesting API access. | | `connection` | optional | (String) Specifies the connection to use rather than presenting all connections available to the application. | -| `scope` | optional | (String) The scopes which you want to request authorization for. These must be separated by a space. You can request any of the standard OIDC scopes about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/api-auth/tutorials/adoption/scope-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | +| `scope` | optional | (String) The scopes which you want to request authorization for. These must be separated by a space. You can request any of the standard OIDC scopes about users, such as `profile` and `email`, custom claims that must [conform to a namespaced format](/tokens/guides/create-namespaced-custom-claims), or any scopes supported by the target API (for example, `read:contacts`). Include `offline_access` to get a Refresh Token. | | `responseType` | optional | (String) It can be any space separated list of the values `code`, `token`, `id_token`. It defaults to `'token'`, unless a `redirectUri` is provided, then it defaults to `'code'`. | | `clientID` | optional | (String) Your Auth0 client ID. | | `redirectUri` | optional | (String) The URL to which Auth0 will redirect the browser after authorization has been granted for the user. | -| `state` | optional | (String) An arbitrary value that should be maintained across redirects. It is useful to mitigate CSRF attacks and for any contextual information (for example, a return URL) that you might need after the authentication process is finished. For more information, see the [state parameter documentation](/protocols/oauth2/oauth-state). | +| `state` | optional | (String) An arbitrary value that should be maintained across redirects. It is useful to mitigate CSRF attacks and for any contextual information (for example, a return URL) that you might need after the authentication process is finished. For more information, see [State Parameter](/protocols/oauth2/oauth-state). auth0.js, when used in single-page applications, handles the state generation and validation automatically if not specified. | | `prompt` | optional | (String) A value of `login` will force the login page to show regardless of current session. A value of `none` will attempt to bypass the login prompts if a session already exists (see the [silent authentication](/sso/current/single-page-apps#silent-authentication) documentation for more details). | For hosted login, one must call the `authorize()` method. @@ -142,6 +142,7 @@ Hosted login with popup: ```js webAuth.popup.authorize({ + redirectUri: 'https://YOUR_APP/popup_response_handler.html' //Any additional options can go here }, function(err, authResult) { //do something @@ -152,12 +153,36 @@ And for social login with popup using `authorize`: ```js webAuth.popup.authorize({ + redirectUri: 'https://YOUR_APP/popup_response_handler.html', connection: 'twitter' }, function(err, authResult) { //do something }); ``` +#### Handling popup authentication results + +When using popup authentication, you'll have to provide a `redirectUri` where the destination page communicates the authorization results back to the callback by using the `webAuth.popup.callback` method. A simple implementation would be something like this: + +```HTML + + + + + + + +``` + +An ideal handler would contain just this minimal functionality (i.e. avoid reloading the whole application just to handle the response). +You will need to add the `redirectUri` to the application's **Allowed Callback URLs** list in the application configuration page on the Dashboard. + ### webAuth.login() <%= include('../../../_includes/_embedded_login_warning') %> @@ -202,16 +227,16 @@ var url = webAuth.client.buildAuthorizeUrl({ ``` ::: note -The `state` parameter is an opaque value that Auth0 will send back to you. This method helps prevent CSRF attacks, and it needs to be specified if you redirect to the URL yourself instead of calling `webAuth.authorize()`. The [OAuth state documentation](/protocols/oauth2/oauth-state) describes how to do use it correctly. +The `state` parameter is an opaque value that Auth0 will send back to you. This method helps prevent CSRF attacks, and it needs to be specified if you redirect to the URL yourself instead of calling `webAuth.authorize()`. For more information, see [State Parameter](/protocols/oauth2/oauth-state). ::: <%= include('../../_includes/_embedded_sso') %> ## Passwordless login -Passwordless authentication allows users to log in by receiving a one-time password via email or text message. The process will require you to start the Passwordless process, generating and dispatching a code to the user, (or a code within a link), followed by accepting their credentials via the verification method. That could happen in the form of a login screen which asks for their (email or phone number) and the code you just sent them. It could also be implemented in the form of a Passwordless link instead of a code sent to the user. They would simply click the link in their email or text and it would hit your endpoint and verify this data automatically using the same verification method (just without manual entry of a code by the user). +Passwordless authentication allows users to log in by receiving a one-time password via email or text message. The process will require you to start the Passwordless process, generating and dispatching a code to the user, (or a code within a link), followed by accepting their credentials via the verification method. That could happen in the form of a login screen which asks for their (email or phone number) and the code you just sent them. It could also be implemented in the form of a Passwordless link instead of a code sent to the user. They would simply click the link in their email or text and it would hit your endpoint and verify this data automatically using the same verification method (just without manual entry of a code by the user). -In order to use Passwordless, you will want to initialize Auth0.js with a `redirectUri` and to set the `responseType: 'token'`. +In order to use Passwordless, you will want to initialize auth0.js with a `redirectUri` and to set the `responseType: 'token'`. ```js var webAuth = new auth0.WebAuth({ @@ -224,7 +249,7 @@ var webAuth = new auth0.WebAuth({ ### Start passwordless -The first step in Passwordless authentication with Auth0.js is the `passwordlessStart` method, which has several parameters which can be passed within its `options` object: +The first step in Passwordless authentication with auth0.js is the `passwordlessStart` method, which has several parameters which can be passed within its `options` object: | **Parameter** | **Required** | **Description** | | --- | --- | --- | @@ -246,7 +271,7 @@ webAuth.passwordlessStart({ ); ``` -### Verify passwordless +### Passwordless Login If sending a code, you will then need to prompt the user to enter that code. You will process the code, and authenticate the user, with the `passwordlessLogin` method, which has several parameters which can be sent in its `options` object: @@ -283,14 +308,14 @@ The `parseHash` method takes an `options` object that contains the following par | **Parameter** | **Required** | **Description** | | --- | --- | --- | | `state` | optional | (String) An opaque value the application adds to the initial request that Auth0 includes when redirecting back to the application. This value is used by auth0.js to prevent CSRF attacks. | -| `nonce` | optional | (String) Used to verify the ID Token +| `nonce` | optional | (String) Used to verify the ID Token | `hash` | optional | (String) The URL hash (if not provided, `window.location.hash` will be used by default) | The contents of the authResult object returned by `parseHash` depend upon which authentication parameters were used. It can include: | **Item** | **Description** | | --- | --- | -| `accessToken` | An Access Token for the API, specified by the `audience` | +| `accessToken` | An Access Token for the API, specified by the `audience` | | `expiresIn` | A string containing the expiration time (in seconds) of the `accessToken` | | `idToken` | An ID Token JWT containing user profile information | @@ -377,7 +402,7 @@ To sign up a user, use the `signup` method. This method accepts an options objec | `password` | required | (String) User's desired password | | `username` | required\* | (String) User's desired username.
    \*Required if you use a database connection and you have enabled **Requires Username** | | `connection` | required | (String) The database connection name on your application upon which to attempt user account creation | -| `user_metadata` | optional | (JSON object) Additional attributes used for user information. Will be stored in [user_metadata](/metadata) | +| `user_metadata` | optional | (JSON object) Additional attributes used for user information. Will be stored in [user_metadata](/users/concepts/overview-user-metadata) | Signups should be for database connections. Here is an example of the `signup` method and some sample code for a form. @@ -406,7 +431,7 @@ Signups should be for database connections. Here is an example of the `signup` m The `checkSession` method allows you to acquire a new token from Auth0 for a user who is already authenticated against Auth0 for your domain. The method accepts any valid OAuth2 parameters that would normally be sent to `authorize`. If you omit them, it will use the ones provided when initializing Auth0. -The call to `checkSession` can use get a new token for the API that was specified as the audience when `webAuth` was initialized: +The call to `checkSession` can be used to get a new token for the API that was specified as the audience when `webAuth` was initialized: ```js webAuth.checkSession({}, function (err, authResult) { @@ -415,6 +440,8 @@ webAuth.checkSession({}, function (err, authResult) { }); ``` +See [Extract the AuthResult and Get User Info](#extract-the-authresult-and-get-user-info) for the format of `authResult`. + Or, the token can be acquired for a different API than the one used when initializing `webAuth` by specifying an `audience` and `scope`: ```js @@ -469,9 +496,9 @@ The user will then receive an email which will contain a link that they can foll ## User management -The Management API provides functionality that allows you to link and unlink separate user accounts from different providers, tying them to a single profile (Read more about [Linking Accounts](/link-accounts) with Auth0). It also allows you to update user metadata. +The Management API provides functionality that allows you to link and unlink separate user accounts from different providers, tying them to a single profile (See [User Account Linking](/users/concepts/overview-user-account-linking) for details.) It also allows you to update user metadata. -To get started, you first need to obtain a an Access Token that can be used to call the Management API. You can do it by specifying the `https://${account.namespace}/api/v2/` audience when initializing Auth0.js, in which case you will get the Access Token as part of the authentication flow. +To get started, you first need to obtain a an Access Token that can be used to call the Management API. You can do it by specifying the `https://${account.namespace}/api/v2/` audience when initializing auth0.js, in which case you will get the Access Token as part of the authentication flow. ::: note If you use [custom domains](/custom-domains), you will need to instantiate a new copy of `webAuth` using your Auth0 domain rather than your custom one, for use with the Management API calls, as it only works with Auth0 domains. @@ -530,7 +557,7 @@ auth0Manage.getUser(userId, cb); ### Updating the user profile -When updating user metadata, you will need to first create a `userMetadata` object, and then call the `patchUserMetadata` method, passing it the user id and the `userMetadata` object you created. The values in this object will overwrite existing values with the same key, or add new ones for those that don't yet exist in the user metadata. Visit the [User Metadata](/metadata) documentation for more details on user metadata. +When updating user metadata, you will need to first create a `userMetadata` object, and then call the `patchUserMetadata` method, passing it the user id and the `userMetadata` object you created. The values in this object will overwrite existing values with the same key, or add new ones for those that don't yet exist in the user metadata. See the [Metadata](/users/concepts/overview-user-metadata) documentation for more details on user metadata. ```js auth0Manage.patchUserMetadata(userId, userMetadata, cb); @@ -540,7 +567,7 @@ auth0Manage.patchUserMetadata(userId, userMetadata, cb); Linking user accounts will allow a user to authenticate from any of their accounts and no matter which one they use, still pull up the same profile upon login. Auth0 treats all of these accounts as separate profiles by default, so if you wish a user's accounts to be linked, this is the way to go. -The `linkUser` method accepts two parameters, the primary `userId` and the secondary user's ID Token (the token obtained after login with this identity). The user id in question is the unique identifier for this user account. If the id is in the format `facebook|1234567890`, the id required is the portion after the delimiting pipe. Visit the [Linking Accounts](/link-accounts) documentation for more details on linking accounts. +The `linkUser` method accepts two parameters, the primary `userId` and the secondary user's ID Token (the token obtained after login with this identity). The user ID in question is the unique identifier for the primary user account. The ID should be passed with the provider prefix, e.g., `auth0|1234567890` or `facebook|1234567890`, when using this method. See [User Account Linking](/users/concepts/overview-user-account-linking) for details. ```js auth0Manage.linkUser(userId, secondaryUserToken, cb); diff --git a/articles/libraries/auth0js/v9/migration-angular.md b/articles/libraries/auth0js/v9/migration-angular.md index 68e8d77c57..ee64ca6012 100644 --- a/articles/libraries/auth0js/v9/migration-angular.md +++ b/articles/libraries/auth0js/v9/migration-angular.md @@ -2,6 +2,7 @@ section: libraries title: Migrating Angular applications to Auth0.js v9 description: How to migrate Angular applications to Auth0.js v9 +public: false topics: - libraries - auth0js diff --git a/articles/libraries/auth0js/v9/migration-angularjs-v6.md b/articles/libraries/auth0js/v9/migration-angularjs-v6.md index ed04de396a..b87b3568e6 100644 --- a/articles/libraries/auth0js/v9/migration-angularjs-v6.md +++ b/articles/libraries/auth0js/v9/migration-angularjs-v6.md @@ -2,6 +2,7 @@ section: libraries title: Migrating Angular 1.x Applications From auth0.js v6 to v9 description: How to migrate Angular 1.x Applications From auth0.js v6 to v9 +public: false toc: true topics: - libraries diff --git a/articles/libraries/auth0js/v9/migration-angularjs-v7.md b/articles/libraries/auth0js/v9/migration-angularjs-v7.md index b471f09df1..6020f63d6c 100644 --- a/articles/libraries/auth0js/v9/migration-angularjs-v7.md +++ b/articles/libraries/auth0js/v9/migration-angularjs-v7.md @@ -2,6 +2,7 @@ section: libraries title: Migrating Angular 1.x Applications From auth0.js v7 to v9 description: How to migrate Angular 1.x Applications From auth0.js v7 to v9 +public: false toc: true topics: - libraries diff --git a/articles/libraries/auth0js/v9/migration-angularjs-v8.md b/articles/libraries/auth0js/v9/migration-angularjs-v8.md index c0dfef6fb9..edea9b70ee 100644 --- a/articles/libraries/auth0js/v9/migration-angularjs-v8.md +++ b/articles/libraries/auth0js/v9/migration-angularjs-v8.md @@ -2,6 +2,7 @@ section: libraries title: Migrating Angular 1.x Applications From auth0.js v8 to v9 description: How to migrate Angular 1.x Applications From auth0.js v8 to v9 +public: false toc: true topics: - libraries diff --git a/articles/libraries/auth0js/v9/migration-guide.md b/articles/libraries/auth0js/v9/migration-guide.md index 1b3ae883d0..51c3f7a950 100644 --- a/articles/libraries/auth0js/v9/migration-guide.md +++ b/articles/libraries/auth0js/v9/migration-guide.md @@ -2,6 +2,7 @@ section: libraries title: Migrating to Auth0.js v9 description: How to migrate to Auth0.js v9 +public: false toc: true topics: - libraries @@ -26,7 +27,7 @@ Everyone should migrate to v9. All previous versions are deprecated, and the dep The documents below describe all the changes that you should be aware of when migrating from different versions of Auth0.js to v9. Make sure you go through the relevant guide(s) before upgrading. * [Migrating from Auth0.js v8](/libraries/auth0js/v9/migration-v8-v9) - * [Recommendations for migrating from Auth0.js v8 when SSO is required](/guides/login/migration-sso) + * [Recommendations for migrating from Auth0.js v8 when Single Sign-on (SSO) is required](/guides/login/migration-sso) * [Migrating from Auth0.js v7](/libraries/auth0js/v9/migration-v7-v9) * [Migrating from Auth0.js v6](/libraries/auth0js/v9/migration-v6-v9) * [Migrating from Auth0.js v8 in Angular 1.x Applications](/libraries/auth0js/v9/migration-angularjs-v8) @@ -49,6 +50,6 @@ You have already migrated to Auth0.js 9 but you still see this error in your log Legacy Lock API: This feature is being deprecated. Please refer to our documentation to learn how to migrate your application. ``` -These deprecation notices most likely originate from a user visiting the [Universal Login page](/hosted-pages/login) directly without initiating the authentication flow from your app. This can happen if a user bookmarks the login page directly. After August 6, 2018, these users will not be able to log in. +These deprecation notices most likely originate from a user visiting the Universal Login [page](/universal-login) directly without initiating the authentication flow from your app. This can happen if a user bookmarks the login page directly. After August 6, 2018, these users will not be able to log in. -Check out the [Deprecation Error Reference](/errors/deprecation-errors) for more information on deprecation related errors. +See [Check Deprecation Errors](/troubleshoot/guides/check-deprecation-errors) for more information on deprecation-related errors. diff --git a/articles/libraries/auth0js/v9/migration-react.md b/articles/libraries/auth0js/v9/migration-react.md index aa0a5b9ee0..633c543fbb 100644 --- a/articles/libraries/auth0js/v9/migration-react.md +++ b/articles/libraries/auth0js/v9/migration-react.md @@ -2,6 +2,7 @@ section: libraries title: Migrating React Applications to Auth0.js v9 description: How to migrate React applications to Auth0.js v9 +public: false topics: - libraries - auth0js diff --git a/articles/libraries/auth0js/v9/migration-v6-v9.md b/articles/libraries/auth0js/v9/migration-v6-v9.md index b7b6f7d15f..99375af3f5 100644 --- a/articles/libraries/auth0js/v9/migration-v6-v9.md +++ b/articles/libraries/auth0js/v9/migration-v6-v9.md @@ -2,6 +2,7 @@ section: libraries title: Migrating from Auth0.js v6 to v9 description: How to migrate from Auth0.js v6 to v9 +public: false toc: true topics: - libraries diff --git a/articles/libraries/auth0js/v9/migration-v7-v9.md b/articles/libraries/auth0js/v9/migration-v7-v9.md index ab6e762bbf..7a1c5bb666 100644 --- a/articles/libraries/auth0js/v9/migration-v7-v9.md +++ b/articles/libraries/auth0js/v9/migration-v7-v9.md @@ -2,6 +2,7 @@ section: libraries title: Migrating from Auth0.js v7 to v9 description: How to migrate from Auth0.js v7 to v9 +public: false toc: true topics: - libraries diff --git a/articles/libraries/auth0js/v9/migration-v8-v9.md b/articles/libraries/auth0js/v9/migration-v8-v9.md index 190c4b1de2..2a40de08b2 100644 --- a/articles/libraries/auth0js/v9/migration-v8-v9.md +++ b/articles/libraries/auth0js/v9/migration-v8-v9.md @@ -2,6 +2,7 @@ section: libraries title: Migrating to from Auth0.js v8 to v9 description: How to migrate from Auth0.js v8 to v9 +public: false toc: true topics: - libraries diff --git a/articles/libraries/custom-signup.md b/articles/libraries/custom-signup.md index f78cf803ee..fe0c3841bf 100644 --- a/articles/libraries/custom-signup.md +++ b/articles/libraries/custom-signup.md @@ -15,12 +15,12 @@ useCase: --- # Custom Signup -You can customize the user signup form with more fields in addition to email and password when using Lock or the Auth0 API. +You can customize the user signup form with more fields in addition to email and password when using Lock or the Auth0 API. There are many factors to consider before you choose [Lock vs. Custom UI](/libraries/when-to-use-lock). For example, using Lock, you can redirect to another page to capture data or use progressive profiling. When using the Auth0 API, you can capture custom fields and store them in a database. There are certain limitations to the customization that should be considered when choosing the method that best suits your purpose. Some typical customizations include adding a username and verifying password strength. :::panel Universal Login -Auth0 offers a [Universal Login](/hosted-pages/login) option that you can use instead of designing your own custom signup page. If you want to offer signup and login options, and you only need to customize the application name, logo and background color, then Universal Login via an Auth0 login page might be an easier option to implement. +Auth0 offers a Universal Login option that you can use instead of designing your own custom signup page. If you want to offer signup and login options, and you only need to customize the application name, logo and background color, then Universal Login via an Auth0 login page might be an easier option to implement. ::: ## Using Lock @@ -33,17 +33,15 @@ Lock's `additionalSignUpFields` option will only work with database signups. For ### Redirect to another page -One way to use social provider signups with Lock and collect custom fields is to use [redirect rules](/rules/redirect) to redirect the user to another page where you ask for extra information, and then redirect back to finish the authentication transaction. +One way to use social provider signups with Lock and collect custom fields is to use [redirect rules](/rules/guides/redirect) to redirect the user to another page where you ask for extra information, and then redirect back to finish the authentication transaction. ### Progressive profiling -Another way to collect custom field data when signing users up with social providers is via progressive profiling. Progressive profiling is a way by which you can slowly build up user profiles over time. You collect the bare minimum details upon signup, but when a user later interacts with your app, you collect a small amount of data (perhaps one question) each time until their profile is complete. This allows for collecting the desired information, but with less friction at signup, since the goal of using a social IDP for signup is, at least in part, making it more effortless and streamlined for the user. - -For further reference, here is our [documentation on progressive profiling](/user-profile/progressive-profiling) as well as an Auth0 [blog post on progressive profiling](https://auth0.com/blog/progressive-profiling/). +Another way to collect custom field data when signing users up with social providers is via [progressive profiling](/users/concepts/overview-progressive-profiling) whereby you can slowly build up user profile data over time. You collect the bare minimum details upon signup, but when a user later interacts with your app, you collect a small amount of data (perhaps one question) each time until their profile is complete. This allows you to collect the desired information but with less friction, since the goal of using a social IDP for signup is making it more effortless and streamlined for the user. ## Using the API -### 1. Create a signup form to capture custom fields +### Create a signup form to capture custom fields ```html
    @@ -67,13 +65,13 @@ For further reference, here is our [documentation on progressive profiling](/use
    ``` -The `name` and `color` are custom fields. +The `name` is a user profile attribute and `color` is a custom field. ::: note There is currently no way to validate user-supplied custom fields when signing up. Validation must be done from an Auth0 [Rule](/rules) at login, or with custom, **server-side** logic in your application. ::: -### 2. Send the form data +### Send the form data Send a POST request to the [/dbconnections/signup](/api/authentication/reference#signup) endpoint in Auth0. @@ -81,6 +79,7 @@ You will need to send: - Your application's `client_id` - The `email` and `password` of the user being signed up - The name of the database `connection` to store your user's data +- Any user profile attribute you want to update for the user, which can include `given_name`, `family_name`, `name`, `nickname`, and `picture`. - Any custom fields as part of `user_metadata` ```har @@ -93,7 +92,7 @@ You will need to send: }], "postData": { "mimeType": "application/json", - "text": "{\"client_id\": \"${account.clientId}\",\"email\": \"$('#signup-email').val()\",\"password\": \"$('#signup-password').val()\",\"connection\": \"YOUR_CONNECTION_NAME\",\"user_metadata\": {\"name\": \"john\",\"color\": \"red\"}}" + "text": "{\"client_id\": \"${account.clientId}\",\"email\": \"$('#signup-email').val()\",\"password\": \"$('#signup-password').val()\",\"connection\": \"YOUR_CONNECTION_NAME\",\"name\": \"$('#name').val()\",\"user_metadata\": {\"color\": \"red\"}}" } } ``` @@ -110,7 +109,7 @@ When your users sign up, the custom fields are sent as part of `user_metadata`. ## Redirect mode -After a successful login, Auth0 will redirect the user to your configured callback URL with a JWT (`id_token`) in the query string. +After a successful login, Auth0 will redirect the user to your configured callback URL with a JWT (`id_token`) in the query string. ::: note To learn more about the differences between popup and redirect modes, please refer to [this document](/libraries/lock/v10/popup-mode). @@ -165,9 +164,9 @@ var settings = { }, "data": { "client_id": "${account.clientId}", - "email": $('#email').val(), - "password": $('#password').val(), - "connection": "Username-Password-Authentication", + "email": $('#signup-email').val(), + "password": $('#signup-password').val(), + "connection": "YOUR_CONNECTION_NAME", "username": $('#username').val() } } @@ -177,9 +176,8 @@ $.ajax(settings).done(function (response) { }); ``` - -## Optional: Verifying password strength +## Optional: Verify password strength Password policies for database connections can be configured in the dashboard. For more information, see: [Password Strength in Auth0 Database Connections](/connections/database/password-strength). -If required for implementation of custom signup forms, the configured password policies, along with other connection information, can be retrieved from the the [Management v2 API](/api/management/v2#!/Connections/get_connections_by_id). The result can be parsed client-side, and will contain information about the current password policy (or policies) configured in the dashboard for that connection. +If required for implementation of custom signup forms, the configured password policies, along with other connection information, can be retrieved from the [Management v2 API](/api/management/v2#!/Connections/get_connections_by_id). The result can be parsed client-side, and will contain information about the current password policy (or policies) configured in the dashboard for that connection. diff --git a/articles/libraries/error-messages.md b/articles/libraries/error-messages.md index 715f2a2e24..a6c1e29606 100644 --- a/articles/libraries/error-messages.md +++ b/articles/libraries/error-messages.md @@ -1,6 +1,6 @@ --- section: libraries -description: Common errors that you might get when you authenticate users using Auth0 libraries +description: Describes common sign up and login errors that you might see when you authenticate users using Auth0 libraries. topics: - libraries - lock @@ -12,9 +12,9 @@ useCase: - add-login - enable-mobile-auth --- -# Common Authentication Errors +# Common Auth0 Library Authentication Errors -The actions or input data of your users, during the sign up or the log in processes, might trigger errors. This article lists the most common errors that you might get, if you use any of the Auth0 libraries for authentication. +The actions or input data of your users, during the sign up or the log in processes, might trigger errors. Here is a list of the most common errors that you might get if you use any of the Auth0 libraries for authentication. ## Sign up @@ -23,6 +23,7 @@ In the case of a failed signup, the most common errors are: | **Error** | **Description** | |-|-| | **invalid_password** | If the password used doesn't comply with the password policy for the connection | +| **invalid_signup** | The user your are attempting to sign up is invalid | | **password_dictionary_error** | The chosen password is too common | | **password_no_user_info_error** | The chosen password is based on user information | | **password_strength_error** | The chosen [password is too weak](/connections/database/password-strength) | @@ -38,9 +39,9 @@ In the case of a failed login, the most common errors are: |-|-| | **access_denied** | When using web-based authentication, the resource server denies access per OAuth2 specifications | | **invalid_user_password** | The username and/or password used for authentication are invalid | -| **mfa_invalid_code** | The [multi-factor authentication](/multifactor-authentication) code provided by the user is invalid/expired | -| **mfa_registration_required** | The administrator has required [multi-factor authentication](/multifactor-authentication), but the user has not enrolled | -| **mfa_required** | The user must provide the [multi-factor authentication](/multifactor-authentication) code to authenticate | +| **mfa_invalid_code** | The multi-factor authentication (MFA) code provided by the user is invalid/expired | +| **mfa_registration_required** | The administrator has required [multi-factor authentication](/mfa), but the user has not enrolled | +| **mfa_required** | The user must provide the [multi-factor authentication](/mfa) code to authenticate | | **password_leaked** | If the password has been leaked and a different one needs to be used | | **PasswordHistoryError** | The password provided for sign up/update has already been used (reported when [password history](/connections/database/password-options#password-history) feature is enabled) | | **PasswordStrengthError** | The password provided does not match the connection's [strength requirements](/connections/database/password-strength) | diff --git a/articles/libraries/index.md b/articles/libraries/index.md index 31fad8e640..cb41e46b6c 100644 --- a/articles/libraries/index.md +++ b/articles/libraries/index.md @@ -7,7 +7,7 @@ topics: - libraries - lock - auth0js -contentType: +contentType: - index - concept --- @@ -15,18 +15,14 @@ contentType:

    Auth0 Libraries

    -

    - There are several widgets and SDKs available to provide a frictionless simple experience when using Auth0. Take a look below to find documentation for the tools that you need to get started! +

    + Auth0 offers widgets and SDKs to provide a simple and frictionless experience for you when using Auth0. Take a look at the options listed to find documentation and links to repositories for the tools you need to get started.

    -<%= include('../_includes/_lock_auth0js_deprecations_notice') %> - <%= include('../_includes/_embedded_login_warning') %> -## Lock - -### Lock documentation +## Lock
    -In order to get an Access Token that can access the Management API: +To get an Access Token that can access the Management API: - We set the `audience` to `https://${account.namespace}/api/v2/` -- We asked for the scope `${scope}` +- We asked for the scope `${scope}` - We set the `response_type` to `id_token token` so Auth0 will sent us both an ID Token and an Access Token If we decode the Access Token and review its contents we can see the following: diff --git a/articles/migrations/guides/account-linking-id-tokens.md b/articles/migrations/guides/account-linking-id-tokens.md deleted file mode 100644 index abfa85a4b8..0000000000 --- a/articles/migrations/guides/account-linking-id-tokens.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Migration Guide from Account Linking with ID Tokens -description: This article covers the deprecation of the ability to perform account linking with ID Tokens and provides migration options. -toc: true -contentType: - - concept - - how-to -useCase: - - migrate ---- -# Migration Guide from Account Linking with ID Tokens - -We have identified a weakness in a particular account linking flow that could allow it to be misused in specific circumstances. We have found no evidence that this has been used maliciously but have decided to deprecate the flow to prevent that ever happening. - -Therefore, Auth0 requires customers using the affected account linking flow to migrate to a more secure implementation before October 19th, 2018. Migration paths are provided in this guide, which should not result in any lost functionality. - -On October 19th, 2018 or anytime after, the affected account linking flow will be disabled and customers using it will experience run-time errors. - -## Am I impacted? - -You are impacted if you call the [/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities) endpoint using a token (ID or Access Token) with the scope `update:current_user_identities` in the Authorization header and include the secondary account's `user_id` in the payload. - -No other use cases are impacted. - -## What should I do? - -You should review all your calls to the account linking endpoint ([/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities)) and update those that make use of the vulnerable flow described above. You can update your calls to either of the following: - -1. **Client-side / user-initiated linking scenarios** -- For client-side linking scenarios, make the call to the [/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities) using an Access Token with the `update:current_user_identities` scope, and provide the ID Token of the secondary account in the payload (`link_with`). This ID Token must be obtained through an OAuth/OIDC-conformant flow. See the [guide on client-side account linking](/link-accounts/user-initiated-linking) for more details. -2. **Server-side linking scenarios** -- For server-side linking scenarios, make the call to the [/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities) endpoint using an Access Token with the `update:users` scope and provide the `user_id` of the secondary account in the payload. See the [guide on server-side account linking](/link-accounts/suggested-linking) for more details. - -## More questions - -If you have questions, feel free to open a community thread or support ticket. - -## Other considerations - -This migration is specifically targeted to mitigate a security vulnerability and is a subset of the larger [account linking migration guide](/migrations/guides/account-linking). At this point, you are not required to take further action beyond that described in this guide. However, it is strongly recommended that you fully review the account linking migration guide and, if needed, update your code as soon as possible. Auth0 will notify customers in advance, with a prudent time frame to migrate, before that migration is enforced. diff --git a/articles/migrations/guides/account-linking.md b/articles/migrations/guides/account-linking.md index c72c7075a0..c56e1766b1 100644 --- a/articles/migrations/guides/account-linking.md +++ b/articles/migrations/guides/account-linking.md @@ -1,5 +1,4 @@ --- -title: Migration Guide: Account Linking and ID Tokens description: Auth0 is deprecating the usage of ID Tokens in the Account Linking process. This article will help you migrate your solution from the old implementation to the new one. toc: true topics: @@ -12,17 +11,11 @@ useCase: - manage-accounts --- -# Migration Guide: Account Linking and ID Tokens +# Migration Guide: Account Linking with Access Tokens vs. ID Tokens -This guide is part of the [Deprecating the usage of ID Tokens on the Auth0 Management API](/migrations#deprecating-the-usage-of-id-tokens-on-the-auth0-management-api) migration, and focuses on the [account linking process](/link-accounts). +This guide is part of the [Deprecating the usage of ID Tokens on the Auth0 Management API](/migrations#deprecating-the-usage-of-id-tokens-on-the-auth0-management-api) migration, and focuses on the [account linking process](/users/concepts/overview-user-account-linking). -For some use cases you could use [ID Tokens](/tokens/id-token) to [link and unlink user accounts](/link-accounts). This functionality is being deprecated. You will have to use [Access Tokens](/tokens/access-token) in all cases. - -The functionality is available and affected users are encouraged to migrate. However the ability to use ID Tokens will **not** be disabled in the foreseeable future so the mandatory opt-in date for this migration remains open. When this changes, customers will be notified beforehand. - -This article will help you migrate your implementation. First, we will see which use cases are affected. We will continue with reviewing how you can use [scopes](/scopes) to get tokens with different access rights, and how you can use them in the account linking process. - -## Summary of changes +For some use cases you could use [ID Tokens](/tokens/concepts/id-tokens) to link and unlink user accounts. This functionality is being deprecated. You will have to use Access Tokens in all cases. The changes in account linking are: @@ -33,9 +26,13 @@ The changes in account linking are: - The ID Token must be signed using `RS256` (you can set this value at *Dashboard > Clients > Client Settings > Advanced Settings > OAuth*) - The claim `aud` of the ID Token, must identify the client, and be the same value with the `azp` claim of the Access Token -The change in the unlinking of accounts is that you can no longer use an ID Token at the `Authorization` header. An Access Token must be used instead. +The change in the unlinking of accounts is that you can no longer use an ID Token at the `Authorization` header. An Access Token must be used instead. See [#security-considerations] below for details. + +::: warning +This migration is specifically targeted to mitigate a possible security vulnerability. Auth0 strongly recommendeds that you update your code as soon as possible. +::: -## Does this affect me? +## Are you affected? There are several ways you can link and unlink accounts. Some change, some remain the same, and a new variation is introduced. In the following matrix you can see a list of the use cases and their status based on this migration. @@ -84,23 +81,23 @@ There are several ways you can link and unlink accounts. Some change, some remai Link current user accounts with Auth0.js - You unlink user accounts with the Unlink a user identity endpoint of the Management API, and you send the primary account's ID Token in the Authorization header + You unlink user accounts with the Unlink a user identity endpoint of the Management API, and you send the primary account's ID Token in the Authorization header
    Affected
    How to unlink accounts - You unlink user accounts with the Unlink a user identity endpoint of the Management API, and you send an Access Token in the Authorization header + You unlink user accounts with the Unlink a user identity endpoint of the Management API, and you send an Access Token in the Authorization header
    No change
    N/A -## How to link accounts +## Link user accounts In order to link accounts you can either call directly the [Link a user account](/api/management/v2#!/Users/post_identities) endpoint of the Management API, or use the [Auth0.js library](/auth0js#user-management). -### Link current user accounts with the API +### Link current user accounts with the Management API A common use case is to allow the logged-in user to link their various accounts using your app. @@ -111,7 +108,7 @@ With this migration, you must get an Access Token (which must contain the `updat First, you must get an Access Token with the `update:current_user_identities` scope. ::: note -In the example that follows, we use the [Implicit Grant](/api-auth/tutorials/implicit-grant), the recommended OAuth 2.0 flow for client-side apps). You can get Access Tokens though for any application type (see [How to get an Access Token](/tokens/access-token#how-to-get-an-access-token)). +In the example that follows, we use the [Implicit Flow](/flows/guides/implicit/call-api-implicit), the recommended OAuth 2.0 flow for client-side apps). You can get Access Tokens though for any application type (see [Get Access Tokens](/tokens/get-access-tokens). ::: <%= include('./_get-token-authorize.md', { scope: 'update:current_user_identities', idPrevious: 'authZ-id-token', idCurrent: 'authZ-access-token' }) %> @@ -152,7 +149,7 @@ First, you must get an Access Token with the `update:current_user_identities` sc <%= include('./_get-token-auth0js.md', { scope: 'update:current_user_identities' }) %> -### Link any user account with the API +### Link any user account with the Management API If you get an Access Token for account linking, that contains the `update:users` scope, and send the secondary account's `user_id` and `provider` in the request, then you don't have to make any changes. @@ -182,7 +179,7 @@ However, this migration does introduce an alternative to this. You still use an - The secondary account's ID Token must be signed with `RS256` - The `aud` claim in the secondary account's ID Token must identify the client, and hold the same value with the `azp` claim of the Access Token used to make the request. -## How to unlink accounts +## Unlink user accounts If you use ID Tokens in order to unlink accounts, then you must update your implementation to use Access Tokens. @@ -192,7 +189,7 @@ Use the sample script that follows as a guide. On the **Legacy (ID Token)** pane <%= include('./_get-token-authorize.md', { scope: 'update:current_user_identities', idPrevious: 'unlink-id-token', idCurrent: 'unlink-access-token' }) %> -Once you have the Access Token, you can call the [Unlink a user identity](/api/management/v2#!/Users/delete_provider_by_user_id) endpoint of the Management API, using it in the `Authorization` header. +Once you have the Access Token, you can call the [Unlink a user identity](/api/management/v2#!/Users/delete_user_identity_by_user_id) endpoint of the Management API, using it in the `Authorization` header.
    @@ -221,11 +218,29 @@ Authorization: 'Bearer ACCESS_TOKEN'
    +## Security considerations + +We have identified a weakness in a particular account linking flow that could allow it to be misused in specific circumstances. We have found no evidence that this has been used maliciously but have decided to deprecate the flow to prevent that ever happening. + +Therefore, Auth0 requires customers using the affected account linking flow to migrate to a more secure implementation before October 19th, 2018. Migration paths are provided in this guide, which should not result in any lost functionality. + +On October 19th, 2018 or anytime after, the affected account linking flow will be disabled and customers using it will experience run-time errors. + +### What's the impact + +You are impacted if you call the [/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities) endpoint using a token (ID or Access Token) with the scope `update:current_user_identities` in the Authorization header and include the secondary account's `user_id` in the payload. + +No other use cases are impacted. + +## Next steps + +You should review all your calls to the account linking endpoint ([/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities)) and update those that make use of the vulnerable flow described above. You can update your calls to either of the following: + +1. **Client-side / user-initiated linking scenarios** -- For client-side linking scenarios, make the call to the [/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities) using an Access Token with the `update:current_user_identities` scope, and provide the ID Token of the secondary account in the payload (`link_with`). This ID Token must be obtained through an OAuth/OIDC-conformant flow. See [Link User Accounts Initiated by Users Scenario](/users/references/link-accounts-user-initiated-scenario) for more details. +2. **Server-side linking scenarios** -- For server-side linking scenarios, make the call to the [/api/v2/users/{USER_ID}/identities](/api/management/v2#!/Users/post_identities) endpoint using an Access Token with the `update:users` scope and provide the `user_id` of the secondary account in the payload. See [Link User Accounts Server-Side Scenario](/users/references/link-accounts-server-side-scenario) for details. + ## Keep reading -:::next-steps -- [Link User Accounts](/link-accounts) -- [Account Linking Using Server Side Code](/link-accounts/suggested-linking) -- [Account Linking Using Client Side Code](/link-accounts/user-initiated-linking) -- [Migration Guide: Management API and ID Tokens](/migrations/guides/calling-api-with-idtokens) -::: +- [Link User Accounts](/users/guides/link-user-accounts) +* [Suggested Account Linking - Server-Side Implementation](/users/references/link-accounts-server-side-scenario) +* [User Initiated Account Linking - Client-Side Implementation](/users/references/link-accounts-client-side-scenario) diff --git a/articles/migrations/guides/calling-api-with-idtokens.md b/articles/migrations/guides/calling-api-with-idtokens.md index 0693fa3906..471a05cdc5 100644 --- a/articles/migrations/guides/calling-api-with-idtokens.md +++ b/articles/migrations/guides/calling-api-with-idtokens.md @@ -17,15 +17,15 @@ useCase: # Migration Guide: Management API and ID Tokens -For some use cases you could use [ID Tokens](/tokens/id-token) in order to call some of the [Users](/api/management/v2#!/Users/get_users_by_id) and [Device Credentials](/api/management/v2#!/Device_Credentials/get_device_credentials) endpoints of the Management API. +For some use cases you could use [ID Tokens](/tokens/concepts/id-tokens) in order to call some of the [Users](/api/management/v2#!/Users/get_users_by_id) and [Device Credentials](/api/management/v2#!/Device_Credentials/get_device_credentials) endpoints of the Management API. -This functionality is being deprecated. You will have to use proper [Access Tokens](/tokens/access-token) in order to access any of the endpoints of the [Management API](/api/management/v2). Make sure the `Allow ID Tokens for Management API v2 Authentication` toggle is turned off after completing the migration to Access Tokens. +This functionality is being deprecated. You will have to use proper [Access Tokens](/tokens/access-token) in order to access any of the endpoints of the [Management API](/api/management/v2). Make sure the `Allow ID Tokens for Management API v2 Authentication` toggle is turned off after completing the migration to Access Tokens. The grace period for this migration started on **March 31, 2018** and at the moment is open-ended. This means that you will still be able to use ID Tokens to access these endpoints. When a mandatory opt-in date is set for this migration customers will be notified beforehand. Customers are encouraged to migrate to Access Tokens. This guide will help you with that. -First, we will see which use cases are affected. We will continue with reviewing how you can use [scopes](/scopes) to get tokens with different access rights, and then see all the ways you can use to get an Access Token. Finally, we will review the changes introduced in the [Account Linking](/link-accounts) process. +First, we will see which use cases are affected. We will continue with reviewing how you can use [scopes](/scopes) to get tokens with different access rights, and then see all the ways you can use to get an Access Token. Finally, we will review the changes introduced in the [User Account Linking](/users/concepts/overview-user-account-linking) process. ## Does this affect me? @@ -34,13 +34,15 @@ If you use ID Tokens to call any of the following endpoints, then you are affect | **Endpoint** | **Use Case** | |-|-| | [GET /api/v2/users/{id}](/api/management/v2#!/Users/get_users_by_id) | Retrieve a user's information | -| [GET /api/v2/users/{id}/enrollments](/api/management/v2#!/Users/get_enrollments) | Retrieve all [Guardian](/multifactor-authentication/guardian) MFA enrollments for a user | +| [GET /api/v2/users/{id}/enrollments](/api/management/v2#!/Users/get_enrollments) | Retrieve all [Guardian](/mfa/concepts/guardian) MFA enrollments for a user | | [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | Update a user's information | -| [DELETE /api/v2/users/{id}/multifactor/{provider}](/api/management/v2#!/Users/delete_multifactor_by_provider) | Delete the [multi-factor](/multifactor-authentication) provider settings for a user | +| [DELETE /api/v2/users/{id}/multifactor/{provider}](/api/management/v2#!/Users/delete_multifactor_by_provider) | Delete the MFA provider settings for a user | | [POST /api/v2/device-credentials](/api/management/v2#!/Device_Credentials/post_device_credentials) | Create a public key for a device | | [DELETE /api/v2/device-credentials/{id}](/api/management/v2#!/Device_Credentials/delete_device_credentials_by_id) | Delete a device credential | -| [POST/api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities) | [Link user accounts](/link-accounts) from various identity providers | -| [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_provider_by_user_id) | [Unlink user accounts](/link-accounts#unlinking-accounts) | +| [POST/api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities) | [Link user accounts](/users/guides/link-user-accounts) from various identity providers | +| [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_user_identity_by_user_id) | [Unlink user accounts](/users/guides/unlink-user-accounts) | + +These endpoints can now accept regular [Access Tokens](/tokens/concepts/access-tokens). Note that the last two endpoints are used for Account Linking. To review these changes, see [Changes in Account Linking](#changes-in-account-linking). @@ -48,14 +50,14 @@ Note that the last two endpoints are used for Account Linking. To review these c ## Changes in scopes -The actions you can perform with the Management API depend on the [scopes](/scopes#api-scopes) that your Access Token contains. With this migration you can either get a "limited" Access Token that can update only the logged-in user's data, or an Access Token that can update the data of any user. In the following matrix you can see the scopes that your token needs to have per case and per endpoint. +The actions you can perform with the Management API depend on the [scopes](/scopes/current/api-scopes) that your Access Token contains. With this migration you can either get a "limited" Access Token that can update only the logged-in user's data, or an Access Token that can update the data of any user. In the following matrix you can see the scopes that your token needs to have per case and per endpoint. | **Endpoint** | **Scope for current user** | **Scope for any user** | |-|-|-| | [GET /api/v2/users/{id}](/api/management/v2#!/Users/get_users_by_id) | `read:current_user` | `read:users` | | [GET /api/v2/users/{id}/enrollments](/api/management/v2#!/Users/get_enrollments) | `read:current_user` | `read:users` | | [POST/api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities) | `update:current_user_identities` | `update:users` | -| [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_provider_by_user_id) | `update:current_user_identities` | `update:users` | +| [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_user_identity_by_user_id) | `update:current_user_identities` | `update:users` | | [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | `update:current_user_metadata` | `update:users` | | [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | `create:current_user_metadata` | `update:users` | | [DELETE /api/v2/users/{id}/multifactor/{provider}](/api/management/v2#!/Users/delete_multifactor_by_provider) | `delete:current_user_metadata` | `update:users` | @@ -74,7 +76,7 @@ In this section we will see the changes that are introduced in how you get a tok There are several variations on how you authenticate a user and get tokens, depending on the technology and the [OAuth 2.0 flow you use to authenticate](/api-auth/which-oauth-flow-to-use): - Using the [Authorization endpoint](/api/authentication#authorize-application). This is where you redirect your users to login or sign up. You get your tokens from this endpoint if you authenticate users from a [single-page app](/api/authentication#implicit-grant) (running on the browser). -- Using the [Token endpoint](/api/authentication#get-token).You get your tokens from this endpoint if you authenticate users from a [web app](/api/authentication#authorization-code) (running on a server), a [mobile app](/api/authentication#authorization-code-pkce-), a [server process](/api/authentication#client-credentials), or a [highly trusted app](/api/authentication#resource-owner-password). +- Using the [Token endpoint](/api/authentication#get-token). You get your tokens from this endpoint if you authenticate users from a [web app](/api/authentication#authorization-code) (running on a server), a [mobile app](/api/authentication#authorization-code-pkce-), a [server process](/api/authentication#client-credentials), or a [highly trusted app](/api/authentication#resource-owner-password). - Using [Lock](/libraries/lock/v11#cross-origin-authentication) or [auth0.js](/libraries/auth0js/v9#configure-your-auth0-application-for-embedded-login) embedded in your application. In this case you are using [cross-origin authentication](/cross-origin-authentication) (used to authenticate users when the requests come from different domains). ### The Authorization endpoint @@ -120,7 +122,7 @@ On the `Legacy (ID Token)` script you can see an implementation of the old appro
             
     POST https://${account.namespace}/oauth/token
    -Content-Type: application/json
    +Content-Type: application/x-www-form-urlencoded
     {
       "grant_type": "password",
       "username": "USERNAME",
    @@ -136,7 +138,7 @@ Content-Type: application/json
           
             
     POST https://${account.namespace}/oauth/token
    -Content-Type: application/json
    +Content-Type: application/x-www-form-urlencoded
     {
       "grant_type": "password",
       "username": "USERNAME",
    @@ -191,7 +193,5 @@ For a detailed overview of these changes and migration steps per use case, see [
     
     ## Keep reading
     
    -:::next-steps
    -- [How to get an Access Token](/tokens/access-token#how-to-get-an-access-token)
    +- [Get Access Tokens](/tokens/guides/get-access-tokens)
     - [Migration Guide: Account Linking and ID Tokens](/migrations/guides/account-linking)
    -:::
    diff --git a/articles/migrations/guides/clickjacking-protection.md b/articles/migrations/guides/clickjacking-protection.md
    new file mode 100644
    index 0000000000..877e705f0c
    --- /dev/null
    +++ b/articles/migrations/guides/clickjacking-protection.md
    @@ -0,0 +1,27 @@
    +---
    +title: Migration Guide: Enabling Clickjacking Protection for Universal Login
    +description: Auth0 is adding a way to prevent the Universal Login pages to be embedded in an iframe.
    +toc: true
    +topics:
    +  - universal-login
    +  - migrations
    +contentType:
    +  - concept
    +  - how-to
    +---
    +# Migration Guide: Enabling Clickjacking Protection
    +
    +Clickjacking is an attack that tricks a user into clicking a web page element which is invisible or disguised as another element. This is done by loading content in an iframe and rendering elements on top of it. In the context of the Universal Login pages, an attacker could trick the user into clicking a 'Login', or 'Reset Password' button.
    +
    +This can be prevented by setting the following HTTP headers:
    +
    +```
    +X-Frame-Options: deny
    +Content-Security-Policy: frame-ancestors 'none'
    +```
    +
    +Even if the potential attack does not entail significant risk, it's a good security practice to add the headers. It is also detected by security scanners, so reports from penetration testers might mention the lack of these headers.
    +
    +In a case where you are rendering the login page in an iframe, adding these headers could be a breaking change. Instead of adding these headers for all customers, therefore, Auth0 has added an opt-in for these headers which we strongly recommend you to enable.
    +
    +You can do this by navigating to [Tenant Settings > Advanced Settings](${manage_url}/#/tenant/advanced), scrolling to 'Migrations', and turning OFF the 'Disable clickjacking protection for Classic Universal Login' setting. This action is not required if you are using the [New Universal Login Experience](/universal-login/new) as those headers are always set.
    diff --git a/articles/migrations/guides/extensibility-node12.md b/articles/migrations/guides/extensibility-node12.md
    new file mode 100644
    index 0000000000..2ef5c6f878
    --- /dev/null
    +++ b/articles/migrations/guides/extensibility-node12.md
    @@ -0,0 +1,191 @@
    +---
    +title: "Migration Guide: Extensibility and Node 12"
    +description: Learn about the Auth0 features affected by the Node.js v8 to Node.js v12 migration and review our recommendations for ensuring a smooth migration process.
    +toc: true
    +topics:
    +  - migrations
    +  - extensibility
    +  - nodejs
    +  - rules
    +  - hooks
    +  - custom-db
    +  - custom-social-connections
    +  - extensions
    +contentType:
    +  - concept
    +  - how-to
    +useCase:
    +  - manage-accounts
    +  - migrate
    +---
    +# Migration Guide: Extensibility and Node 12
    +
    +On December 31, 2019, [Node.js v8 went out of long-term support (LTS)](https://github.com/nodejs/Release#release-schedule), which means that the Node.js development team no longer back-ports critical security fixes to this version. This _could_ expose your extensibility code to security vulnerabilities.
    +
    +As such, Auth0 is migrating from Node 8 to Node 12.
    +
    +In this document, we:
    +
    +* Provide recommendations on how you can ensure a smooth migration for your environment
    +* Detail the specific modules affected
    +
    +## Summary of the migration
    +
    +The Webtask runtime powering the following Auth0 features use Node 8:
    +
    +* Rules
    +* Hooks
    +* Custom database connections
    +* Custom social connections
    +* Extensions
    +
    +If you do not use any of the extensibility features mentioned above, you are not affected by this migration.
    +
    +## Verified extensions
    +
    +As part of this migration, the Auth0 development team has performed extensive testing to proactively detect any breaking changes.
    +
    +Verified extensions for Node 12 include:
    +
    +* Realtime Webtask Logs
    +* Deploy extensions (Github, Gitlab, etc.)
    +* Deploy CLI
    +
    +Still, there may be behavioral changes as a result of this migration, so we have provided a migration switch that allows you to control the migration of your environment to the new Webtask runtime using Node 12.
    +
    +## Enable the Node 12 runtime
    +
    +Node 12 can be enabled through the new Extensibility panel on the [Advanced Tenant Settings](${manage_url}/#/tenant/advanced) page of the Dashboard.
    +
    +![Runtime toggle](/media/articles/migrations/node-runtime1.png)
    +
    +![Runtime toggle options](/media/articles/migrations/node-runtime2.png)
    +
    +::: warning
    +Changing the runtime may break your existing Rules, Hooks, and Custom Database/Social Connections. We recommend that you first switch your development tenant to the Node 12 runtime, test your setup, and switch your production tenant only when you have identified there are no breaking changes.
    +:::
    +
    +## Whitelist the new URLs
    +
    +The [Delegated Administration Extension](/extensions/delegated-admin) and the [Single Sign-on (SSO) Dashboard Extension](/extensions/sso-dashboard) require whitelisting the URLs used to access extensions and custom webtasks. When you upgrade to Node 12, the URLs you use to access extensions and custom webtasks will change. This is a breaking change for these extensions.
    +
    +If you use any of these extensions, **you must whitelist the new URLs** both as Allowed Callback and as Allowed Logout URLs.
    +
    +The region portion of the URL will change from 8 to 12. If you access an extension using the URL `https://${account.tenant}.us8.webtask.io/dummy-extension-url`, when you upgrade to Node 12 the URL will be `https://${account.tenant}.us12.webtask.io/dummy-extension-url`.
    +
    +To do so, go to [Dashboard > Applications > Settings](${manage_url}/#/applications/${account.clientId}/settings), and add the URL to the fields **Allowed Callback URLs** and **Allowed Logout URLs**.
    +
    +The execution URLs will also change for custom webtasks in your Auth0 container. You must update any external applications that call those webtasks.
    +
    +### Authorization Extension Changes
    +
    +If you use the Authorization Extension, it generates an `auth0-authorization-extension` rule. Republishing this rule from within the Authorization Extension will update the URLs automatically.
    +
    +To ensure a clean upgrade:
    +
    +1. Ensure you have upgraded to the latest version of the Authorization Extension from the "Installed Extensions" tab. If the upgrade button is present, click to upgrade. If the button is not present, you are already on the latest version of the extension.
    +2. Open the Authorization Extension configuration page.
    +3. To update the URL in the rule, publish the rule again by clicking the "Publish Rule" button.
    +4. Test to make sure everything is still working.
    +5. If you see an "Invalid API Key" error after updating, use the "Rotate" button to generate a new API key.
    +
    +![Authorization Extension Configuration](/media/articles/migrations/node-auth-ext-config.png)
    +
    +![Authorization Extension Buttons](/media/articles/migrations/node-auth-ext-buttons.png)
    +
    +### Delegated Administration URLs
    +
    +If you use the Delegated Administration Extension, the matrix that follows contains the updated URLs you must configure after you migrate to Node 12. The URL varies based on your location.
    +
    +| Location | Allowed Callback URL for Node 12 | Allowed Logout URL for Node 12 |
    +| --- | --- | --- |
    +| USA | `https://${account.tenant}.us12.webtask.io/auth0-delegated-admin/login` | `https://${account.tenant}.us12.webtask.io/auth0-delegated-admin` |
    +| Europe | `https://${account.tenant}.eu12.webtask.io/auth0-delegated-admin/login` | `https://${account.tenant}.eu12.webtask.io/auth0-delegated-admin` |
    +| Australia | `https://${account.tenant}.au12.webtask.io/auth0-delegated-admin/login` | `https://${account.tenant}.au12.webtask.io/auth0-delegated-admin` |
    +
    +For example, if you are located in the USA and you use the Delegated Administration, you should update the following fields in your application's settings:
    +- **Allowed Callback URLs**: `https://${account.tenant}.us12.webtask.io/auth0-delegated-admin/login`
    +- **Allowed Logout URLs**: `https://${account.tenant}.us12.webtask.io/auth0-delegated-admin`
    +
    +### SSO Dashboard URLs
    +
    +The matrix that follows contains the updated URLs you must configure after you migrate to Node 12. The URL varies based on your location.
    +
    +The login URL for **Admins**:
    +
    +| Location | Allowed Callback URL |
    +| --- | --- |
    +| USA | `https://${account.tenant}.us12.webtask.io/auth0-sso-dashboard/admins/login` |
    +| Europe | `https://${account.tenant}.eu12.webtask.io/auth0-sso-dashboard/admins/login` |
    +| Australia | `https://${account.tenant}.au12.webtask.io/auth0-sso-dashboard/admins/login` |
    +
    +The login URL for **Users**:
    +
    +| Location | Allowed Callback URL |
    +| --- | --- |
    +| USA | `https://${account.tenant}.us12.webtask.io/auth0-sso-dashboard/login` |
    +| Europe | `https://${account.tenant}.eu12.webtask.io/auth0-sso-dashboard/login` |
    +| Australia | `https://${account.tenant}.au12.webtask.io/auth0-sso-dashboard/login` |
    +
    +### All Extensions
    +
    +Most extensions use the `PUBLIC_WT_URL` hidden secret for authorization. This secret depends on the runtime version and does not update automatically.
    +
    +To update it, you need to save the extension's settings (no changes are necessary). To do so, after switching the runtime to `Node 12`, you need to open the extension's settings in the extensions dashboard (gear icon) and hit `Save`. After that, the extensions gallery will update the `PUBLIC_WT_URL` secret accordingly based on the selected runtime.
    +
    +If you do not update the `PUBLIC_WT_URL` hidden secret, you will receive the following error:
    +
    +![Misconfiguration or Service Outage Error](/media/articles/migrations/node-hidden-secret-error.png)
    +
    +## How to ensure a stable migration
    +
    +As part of the process of introducing Node 12 in our Webtask runtime, we ran a number of tests to determine which modules are not forward-compatible from Node 8 to 12. Most customers _should_ be able to upgrade to Node 12 without any issues.
    +
    +With that said, before you migrate, we highly recommend testing all of your:
    +
    +* Rules
    +* Hooks
    +* Custom Database Connections/Scripts
    +* Custom Social Connections
    +* Extensions
    +
    +Furthermore, we recommend that the testing be done in your development tenant and migrating your production tenant only if you see no issues in development.
    +
    +You can query the Management API for your Rules, Hooks, Custom Database scripts, and Custom Social Connections. This will make it easier for you to move items from your production tenant to development tenant for testing purposes.
    +
    +Please see our documentation on the [Connections](/api/management/v2#!/Connections), [Rules](/api/management/v2#!/Rules/get_rules), and [Hooks](/api/management/v2/#!/Hooks/get_hooks) endpoints for additional information on this process.
    +
    +When using the [Connections](/api/management/v2#!/Connections) endpoints in the Management API, Custom Database Scripts can be retrieved or updated using `options.customScripts`.
    +
    +Similarly, you can find Custom Social Connections in `options.scripts.fetchUserProfile`.
    +
    +## Affected modules
    +
    +If you are using the following built-in modules (that is, modules that you did not explicitly require), please be aware that some versions were updated to work with Node 12. The following table summarizes the changes.
    +
    +| Module name | Old version | New version |
    +| - | - | - |
    +| couchbase | ~2.5.1 | 2.6.10 |
    +| bcrypt | 1.0.3 | 3.0.8 |
    +
    +These new versions should remain backwards compatible with their previous versions.
    +
    +### Pinned modules
    +
    +If you have manually pinned modules, you may need to manually update them so that your code runs with Node 12.
    +
    +For example, you must change
    +
    +`var bcrypt = require(‘bcrypt@1.0.3’);`
    +
    +to
    +
    +`var bcrypt = require(‘bcrypt’);`
    +
    +or, if the module must be pinned to a specific version:
    +
    +`var bcrypt = require(‘bcrypt@3.0.8’);`
    +
    +### Notes for Node 10 and Node 12 changes
    +
    +For additional information, please consult Node.js's [Node 10 release notes](https://nodejs.org/fr/blog/release/v10.0.0/) and [Introducing Node.js 12](https://medium.com/@nodejs/introducing-node-js-12-76c41a1b3f3f).
    diff --git a/articles/migrations/guides/extensibility-node8.md b/articles/migrations/guides/extensibility-node8.md
    deleted file mode 100644
    index 1f32bbfdf1..0000000000
    --- a/articles/migrations/guides/extensibility-node8.md
    +++ /dev/null
    @@ -1,198 +0,0 @@
    ----
    -title: "Migration Guide: Extensibility and Node 8"
    -description: This article covers the Auth0 features/modules affected, as well as our recommendations to ensure a smooth migration process.
    -toc: true
    -topics:
    -  - migrations
    -  - extensibility
    -  - nodejs
    -  - rules
    -  - hooks
    -  - custom-db
    -  - custom-social-connections
    -  - extensions
    -contentType:
    -  - concept
    -  - how-to
    -useCase:
    -  - manage-accounts
    -  - migrate
    ----
    -# Migration Guide: Extensibility and Node 8
    -
    -Beginning April 30, 2018, [Node.js v4 will be going out of long-term support (LTS)](https://github.com/nodejs/Release#release-schedule), which means that the Node.js development team will no longer be back-porting critical security fixes to this version and this _could_ expose your extensibility code to security vulnerabilities.
    -
    -As such, Auth0 will be migrating from Node 4 to Node 8.
    -
    -We will **NOT** be shutting down the Node 4 runtime after the April 30 LTS deadline. Your extensibility code will continue to run on Node 4, if you choose not to upgrade to Node 8 at this time. After April 30, you will assume the risk of potential security issues if you choose to continue with Node 4.
    -
    -In this document, we:
    -
    -* Provide recommendations on how you can ensure a smooth migration for your environment
    -* Detail the specific modules effected
    -
    -## Summary of the migration
    -
    -The Webtask runtime powering the following Auth0 features utilize Node 4:
    -
    -* Rules
    -* Hooks
    -* Custom database connections
    -* Custom social connections
    -* Extensions
    -
    -If you do not use any of the extensibility features mentioned above, you are not affected by this migration. **Additionally, your tenant will automatically be upgraded to use the Node 8 runtime on April 30, 2018.** This will ensure that any future extensibility code you author will be running on a secure runtime.
    -
    -Due to the end of long-term support (LTS) for Node 4, we will be migrating the Webtask runtime to use Node 8. As part of this migration, the Auth0 development team has performed extensive testing to detect any breaking changes proactively.
    -
    -However, there may be behavioral changes as a result of this migration. As such, we have provided a migration switch that allows you to control the migration of your environment to the new Webtask runtime using Node 8.
    -
    -### Important Dates
    -
    -* **2018 April 17**: The Webtask runtime using Node 8 becomes available to Auth0 customers
    -* **2018 April 23**: All official Auth0 Extensions will be updated to run on Node 8 and available for you to upgrade in the **Installed Extensions** tab of the [Extensions page](${manage_url}/#/extensions)
    -* **2018 April 30**: [Node 4 is no longer under long-term support (LTS)](https://github.com/nodejs/Release#release-schedule)
    -* **2018 April 30**: Tenants with NO Extensibility code will be automatically be upgraded to use Node 8
    -
    -## How to enable the Node 8 runtime
    -
    -Node 8 can be enabled through the new Extensibility panel on the [Advanced Tenant Settings](${manage_url}/#/tenant/advanced) page of the Dashboard.
    -
    -![Runtime toggle](/media/articles/migrations/node-runtime1.png)
    -
    -![Runtime toggle options](/media/articles/migrations/node-runtime2.png)
    -
    -::: warning
    -Changing the runtime may break your existing Rules, Hooks, and Custom Database/Social Connections. We recommend that you first switch your development tenant to the Node 8 runtime, test your setup, and switch your production tenant only when you have identified there are no breaking changes.
    -:::
    -
    -## Whitelist the new URLs
    -
    -When you upgrade to Node 8, the URLs you use to access extensions and custom webtasks will change. The change is an `8` that is appended before the `webtask.io` part. So if you accessed an extension using the URL `https://${account.tenant}.us.webtask.io/dummy-extension-url`, when you upgrade to Node 8 the URL will be `https://${account.tenant}.us8.webtask.io/dummy-extension-url`.
    -
    -The execution URLs will also change for custom webtasks in your Auth0 container. You must update any external applications that call those webtasks.
    -
    -This is a breaking change for some extensions, that require whitelisting the URLs in order to properly work.
    -
    -The affected extensions are the [Delegated Administration Extension](/extensions/delegated-admin) and the [Single Sign-On (SSO) Dashboard](/extensions/sso-dashboard). If you use either, **you must whitelist the new URLs** both as Allowed Callback and as Allowed Logout URLs.
    -
    -To do so, go to [Dashboard > Applications > Settings](${manage_url}/#/applications/${account.clientId}/settings), and add the URL to the fields **Allowed Callback URLs** and **Allowed Logout URLs**.
    -
    -### Delegated Administration URLs
    -
    -The matrix that follows contains the updated URLs you must configure after you migrate to Node 8. The URL varies based on your location.
    -
    -| Location | Allowed Callback URL for Node 8 | Allowed Logout URL for Node 8 |
    -| --- | --- | --- |
    -| USA | `https://${account.tenant}.us8.webtask.io/auth0-delegated-admin/login` | `https://${account.tenant}.us8.webtask.io/auth0-delegated-admin` |
    -| Europe | `https://${account.tenant}.eu8.webtask.io/auth0-delegated-admin/login` | `https://${account.tenant}.eu8.webtask.io/auth0-delegated-admin` |
    -| Australia | `https://${account.tenant}.au8.webtask.io/auth0-delegated-admin/login` | `https://${account.tenant}.au8.webtask.io/auth0-delegated-admin` |
    -
    -For example, if you are located in the USA and you use the Delegated Administration, you should update the following fields in your application's settings: 
    -- **Allowed Callback URLs**: `https://${account.tenant}.us8.webtask.io/auth0-delegated-admin/login`
    -- **Allowed Logout URLs**: `https://${account.tenant}.us8.webtask.io/auth0-delegated-admin`
    -
    -### SSO Dashboard URLs
    -
    -The matrix that follows contains the updated URLs you must configure after you migrate to Node 8. The URL varies based on your location.
    -
    -The login URL for **Admins**:
    -
    -| Location | Allowed Callback URL |
    -| --- | --- |
    -| USA | `https://${account.tenant}.us8.webtask.io/auth0-sso-dashboard/admins/login` |
    -| Europe | `https://${account.tenant}.eu8.webtask.io/auth0-sso-dashboard/admins/login` |
    -| Australia | `https://${account.tenant}.au8.webtask.io/auth0-sso-dashboard/admins/login` |
    -
    -The login URL for **Users**:
    -
    -| Location | Allowed Callback URL |
    -| --- | --- |
    -| USA | `https://${account.tenant}.us8.webtask.io/auth0-sso-dashboard/login` |
    -| Europe | `https://${account.tenant}.eu8.webtask.io/auth0-sso-dashboard/login` |
    -| Australia | `https://${account.tenant}.au8.webtask.io/auth0-sso-dashboard/login` |
    -
    -## How to ensure a stable migration
    -
    -As part of the process of introducing Node 8 in our Webtask runtime, we ran a number of tests to determine which modules are not forward-compatible from Node 4 to 8. Most customers _should_ be able to upgrade to Node 8 without any issues.
    -
    -With that said, before you migrate, we highly recommend testing all of your:
    -
    -* Rules
    -* Hooks
    -* Custom Database Connections/Scripts
    -* Custom Social Connections
    -* Extensions
    -
    -Furthermore, we recommend that the testing be done in your development tenant and migrating your production tenant only if you see no issues in development. 
    -
    -You can query the Management API for your Rules, Custom Database scripts, and Custom Social Connections. This will make it easier for you to move items from your production tenant to development tenant for testing purposes.
    -
    -Please see our documentation on the [Connections](/api/management/v2#!/Connections) and [Rules](/api/management/v2#!/Rules/get_rules) endpoints for additional information on this process.
    -
    -When using the [Connections](/api/management/v2#!/Connections) endpoints in the Management API, Custom Database Scripts can be retrieved or updated using `options.customScripts`.
    -
    -Similarly, you can find Custom Social Connections in `options.scripts.fetchUserProfile`.
    -
    -You will need to manually copy over any Hooks-related code that you use since they cannot be accessed via the Management API.
    -
    -### Migration assistance
    -
    -We have created a [migration assistant](https://github.com/auth0/webtask-migration-assistant) to help ease the copying of code between production and development tenants.
    -
    -Please be sure to test each script *individually* with its associated **Try** button. You may, however, test all rules simultaneously with the **Try All Rules With** button.
    -
    -In addition, test _logging in_ using the development tenant to ensure that all of the following items that you have set up work as expected:
    -
    -* Rules
    -* Hooks
    -* Database Connections
    -* Custom Social Connections
    -* Extensions
    -
    -## Affected modules
    -
    -If you are using the following built-in modules (that is, modules that you did not explicitly require), please be aware that some versions were updated to work with Node 8. The following table summarizes the changes.
    -
    -| Module name | Old version | New version |
    -| - | - | - |
    -| azure-storage | ~0.4.1 | ~2.2.1 |
    -| couchbase | ~1.2.1 | ~2.3.5 |
    -| jsonwebtoken | ~0.4.1^* | ~7.4.1 (w/ compatibility shim) |
    -| knex | ~0.6.3 | ~0.13.0 |
    -| mongo-getdb | ~1.2.0^* | ^2.2.0 |
    -| mongodb | ~1.3.15^* | ^2.2.0 |
    -| mysql | 2.0.0-alpha8^* | ^2.0.0 |
    -| node-cassandra-cql | ^0.4.4 | ^0.5.0 |
    -| request | ~2.27.0 | ~2.81.0 |
    -| pg | ^4.3.0^* | ^4.5.7 |
    -| bcrypt | ~0.8.5^* | ~0.8.7 |
    -| xml2json | ~0.10.0^* | ~0.11.2 |
    -
    -^* These versions are no longer supported due to incompatibility with Node 8.
    -
    -### Pinned modules
    -
    -If you have manually pinned modules, you may need to manually update them so that your code runs with Node 8.
    -
    -For example, you must change
    -
    -`var mysql = require(‘mysql@2.0.0-alpha8’);`
    -
    -to
    -
    -`var mysql = require(‘mysql’);`
    -
    -or, if the module must be pinned to a specific version:
    -
    -`var mysql = require(‘mysql@2.0.0’);`
    -
    -### Behavioral and syntactic changes
    -
    -Some of the behavioral and syntactic changes in modules were not forward-compatible with Node 8.
    -
    -For example, the default encoding of the `crypto` module was changed from `binary` to `utf8`, and the use of `new Buffer()` has been deprecated in favor of `Buffer.from()`.
    -
    -Please consult Node.js' migration nodes for [v4 to v6](https://github.com/nodejs/wiki-archive/blob/master/Breaking-changes-between-v4-LTS-and-v6-LTS.md) and [v6 to v8](https://github.com/nodejs/wiki-archive/blob/master/Breaking-changes-between-v6-LTS-and-v8-LTS.md) for additional information.
    -
    -**To ensure that your Auth0 implementation functions as intended, please be sure to migrate to the Node 8 runtime before April 30 2018.**
    diff --git a/articles/migrations/guides/facebook-graph-api-deprecation.md b/articles/migrations/guides/facebook-graph-api-deprecation.md
    new file mode 100644
    index 0000000000..39159f0b6e
    --- /dev/null
    +++ b/articles/migrations/guides/facebook-graph-api-deprecation.md
    @@ -0,0 +1,120 @@
    +---
    +title: Changes to Facebook Graph API
    +description: The latest version of the Facebook Graph API changes what permissions and fields can be requested.
    +toc: true
    +contentType:
    +  - how-to
    +useCase:
    +  - add-login
    +  - migrate
    +---
    +
    +# Changes to Facebook Login and Graph API
    + 
    +The latest version of the Facebook Graph API changes what permissions and fields can be requested. We've updated Facebook Connections to reflect these changes and tweaked the connection interface for clarity.
    +
    +::: note
    +[Facebook Login Changelog: Recent Changes to Facebook Login](https://developers.facebook.com/docs/facebook-login/changelog#2018-07-02)
    +:::
    +
    +This update may not require changes to your code or configuration, but your application might receive additional profile data if the existing permissions allow it. But keep in mind that:
    +
    +* If your Facebook connection is configured to request one of the removed permissions, your Access Token will not get them in scope.
    +* If your Facebook application is marked as "development" then you may still see an error temporarily while trying the connection.
    +* If you add new permissions to the connection, end users will be prompted for consent next time they log in. See the Facebook documentation for how to handle actions for users that don't have a specific permission.
    + 
    +## Facebook Login Permissions
    + 
    +[Facebook Login permissions](https://developers.facebook.com/docs/facebook-login/permissions) are requested by your application when a user logs in using Facebook. If the user is logging in for the first time or if the permissions have changed, they will be shown a consent window in Facebook showing the new permissions requested. Once those permissions are granted, your application can then act on behalf of that user with a Facebook access token.
    + 
    +The Facebook Connection interface has been updated to show both the regular name as well as the machine name for all permissions displayed. This makes it easier to find the permissions you need and map that to any code you might be running using these permission names.
    +
    +![Facebook Connection Permissions](/media/articles/connections/social/facebook/facebook-connection-permissions.png)
    + 
    +### Permissions added
    + 
    +The following permissions were added to the Facebook connection interface:
    +
    +- business_management
    +- groups_access_member_info
    +- leads_retrieval
    +- pages_manage_instant_articles
    +- publish_to_groups
    +- publish_to_groups
    +- user_age_range
    +- user_gender
    +- user_link
    + 
    +### Permissions removed
    + 
    +The following permissions were removed from the Facebook connection interface:
    + 
    +- read_custom_friendlists
    +- rsvp_event
    +- user_about_me
    +- user_actions-books
    +- user_actions-fitness
    +- user_actions-music
    +- user_actions-news
    +- user_actions-video
    +- user_education_history
    +- user_games_activity
    +- user_relationship_details
    +- user_relationships
    +- user_religion_politics
    +- user_website
    +- user_work_history
    + 
    +### Permissions moved to deprecated
    + 
    +The following permissions were moved to the **Deprecated** section and should not be used with the latest version of the Graph API:
    + 
    +- publish_actions
    +- user_managed_groups
    + 
    +## Facebook Graph API Fields
    + 
    +The [Facebook Graph API](https://developers.facebook.com/docs/graph-api/reference/v3.2/user) is used after a user logs in to retrieve profile data for the Auth0 user. The user data permissions requested determine what information is retrieved from the Graph API. The fields that are returned depend on the permissions requested and the existence of those fields in the Facebook user profile.
    + 
    +This change upgraded the Graph API from v2.8 to v3.2 and will ask for the following user data fields on login:
    + 
    +- address (added)
    +- age_range
    +- birthday
    +- context
    +- cover
    +- currency (added)
    +- devices
    +- email
    +- favorite_athletes
    +- favorite_teams
    +- first_name
    +- gender
    +- hometown
    +- id
    +- inspirational_people
    +- install_type (added)
    +- installed
    +- is_verified
    +- languages
    +- last_name
    +- link
    +- locale
    +- location
    +- meeting_for (added)
    +- middle_name
    +- name
    +- name_format
    +- picture
    +- public_key (added)
    +- quotes
    +- security_settings (added)
    +- short_name (added)
    +- significant_other
    +- sports (added)
    +- third_party_id
    +- timezone
    +- updated_time
    +- verified
    +- video_upload_limits (added)
    +- viewer_can_send_gift (added)
    diff --git a/articles/migrations/guides/facebook-social-context.md b/articles/migrations/guides/facebook-social-context.md
    new file mode 100644
    index 0000000000..d3a06f3de5
    --- /dev/null
    +++ b/articles/migrations/guides/facebook-social-context.md
    @@ -0,0 +1,32 @@
    +---
    +title: 'Context' Facebook Field Deprecation
    +public: false
    +description: Facebook is removing access to the 'social context' field from their profile
    +contentType:
    +  - how-to
    +useCase:
    +  - add-login
    +  - migrate
    +---
    +# 'Context' Facebook Field Deprecation
    +
    +On **July 30th 00:00 UTC**, Facebook connections that request the `context` field will fail, so Auth0 will stop requesting it for all connections at that time.
    +
    +On April 30th [Facebook deprecated]( https://developers.facebook.com/docs/graph-api/changelog/4-30-2019-endpoint-deprecations) the use of the ‘Social Context’ field for new applications. Auth0 continued to request that field by default for Facebook connections created before April 30th 2019. You can make sure the field is not requested before July 30th by unchecking the ‘Social context’ field in the User Data connection section:
    + 
    +![facebook context](/media/articles/migrations/facebook-context.png)
    + 
    +Once you uncheck ‘Social context’, the profile data will not include the context field. The field has the following content:
    + 
    +```
    +"context": {
    +  "mutual_likes": {"data": [],"summary": {"total_count": 0}},
    +  "id": "dXNlcl9...UZD"
    +}
    +```
    + 
    +**Do I need to take any action?**
    + 
    +If you are not using the ‘context’ field in the Facebook profile returned by Auth0 in your application, then your application will keep working without changes. Otherwise, you will need to adjust your application code so it does not rely on it.
    + 
    +If you want to make sure your application is not affected on July 30th we recommend you to uncheck the ‘Social context’ field in the Facebook connection properties.
    diff --git a/articles/migrations/guides/google_cloud_messaging.md b/articles/migrations/guides/google_cloud_messaging.md
    new file mode 100644
    index 0000000000..3b8e862174
    --- /dev/null
    +++ b/articles/migrations/guides/google_cloud_messaging.md
    @@ -0,0 +1,27 @@
    +---
    +title: Google Cloud Messaging Deprecation
    +description: This article describes how you can migrate your applications based on the Android Guardian SDK to Firebase Cloud Messaging
    +public: false
    +contentType:
    +  - concept
    +  - how-to
    +useCase:
    +  - customize-mfa
    +  - migrate
    +---
    +# Migration to Firebase Cloud Messaging
    +
    +Auth0’s Guardian SDKs for iOS and Android helps you create custom Mobile apps with Guardian functionality, providing secure access to multi-factor authentication (MFA) with push notifications. 
    +
    +The Android SDK library was built to send Push Notifications using Google Cloud Messaging, which [Google deprecated](https://firebase.googleblog.com/2018/04/time-to-upgrade-from-gcm-to-fcm.html) and replaced with Firebase Cloud Messaging. Google Cloud Messaging will stop working on April 11th 2019. **Note that existing applications should [keep working as-is](https://aws.amazon.com/blogs/messaging-and-targeting/the-end-of-google-cloud-messaging-and-what-it-means-for-your-apps/)**.
    +
    +You can learn more about how to migrate from GCM to FCM check [Google’s documentation](https://developers.google.com/cloud-messaging/android/android-migrate-fcm).
    +
    +The main difference between how you send notifications to GCM and FCM is in the payload received in the notification. While it was possible for existing customers using the Android SDK to adapt the payload received before calling the SDK method, we have upgraded the library so it accepts the new payload, making it simpler to adopt FCM. More details [here](https://github.com/auth0/Guardian.Android/pull/84).
    +
    +The Guardian Android SDK 0.4.0 version is already available in Maven Central and includes this change. The sample application was also upgraded, so it can be tested by providing the google-services.json file and a guardian-url. 
    +
    +You can check the updated documentation for the [Guardian Android SDK](/mfa/guides/guardian/guardian-android-sdk).
    +
    +
    +
    diff --git a/articles/migrations/guides/instagram-deprecation.md b/articles/migrations/guides/instagram-deprecation.md
    new file mode 100644
    index 0000000000..d801742b37
    --- /dev/null
    +++ b/articles/migrations/guides/instagram-deprecation.md
    @@ -0,0 +1,40 @@
    +---
    +title: Instagram Connection Deprecation
    +description: Instagram is deprecating their Authentication API
    +toc: true
    +contentType:
    +  - how-to
    +useCase:
    +  - add-login
    +  - migrate
    +---
    +# Instagram Connection Deprecation
    +
    +Facebook [announced](https://developers.facebook.com/blog/post/2019/10/15/launch-instagram-basic-display-api/) that on March 31th, 2020, they will turn off the Instagram legacy APIs in favor of a new set of APIs:
    +
    +- The [Instagram Graph API](https://developers.facebook.com/docs/instagram-api) which is designed for Instagram Professional Accounts, not for end-user authentication.
    +- The [The Instagram Basic Display API](https://developers.facebook.com/docs/instagram-basic-display-api), which is an OAuth2 API, and enables you to grant access to your basic Instagram account data to a third-party app.
    +
    +Even if it is a common industry practice to use OAuth2 as an authentication API, Facebook is explicitly forbidding using it as such, requiring applications to implement Facebook Login for authentication. Facebook will not approve applications that use the Instagram Basic Display API for authentication.
    +
    +In order to let existing users continue to access your application, you will need to ask users that are authenticating using Instagram to authenticate in a different way, and use [Account Linking](/link-accounts) to link the new identity with the old one. 
    +
    +An example flow would be:
    +
    +- The user authenticates with Instagram.
    +- The application tells the user that they won't be able to authenticate with Instagram anymore, and that they should do it in a different way.
    +- The application lists the options the user has for authentication, for example:
    +    - Facebook
    +    - Username and Password
    +- After the user authenticates in a different way, you link the accounts using [Account Linking](/link-accounts).
    +
    +## Why can't Auth0 use the Instagram Basic Display OAuth endpoint
    +
    +While we could replace our current implementation and use the [Instagram Basic Display OAuth flow](https://developers.facebook.com/docs/instagram-basic-display-api/guides/getting-access-tokens-and-permissions), this would not be accepted by Facebook's policies. You would need to create an Instagram application in Facebook and, in that app, there's a notification saying:
    +
    +> Note that Basic Display is not an authentication tool. Data returned by the API cannot be used to authenticate your app users or log them into your app. If your app uses API data to authenticate users, it will be rejected during App Review. If you need an authentication solution, use Facebook Login instead.
    +
    +This means that even if Auth0 implemented this flow, your Instagram application would not be approved by Facebook.
    +
    +If you need to access Instagram data, you will need to authenticate your user in other way (for example, using Facebook Login or username/password), and implement the Instagram OAuth flow in your application.
    +
    diff --git a/articles/migrations/guides/legacy-lock-api-deprecation.md b/articles/migrations/guides/legacy-lock-api-deprecation.md
    index 2f31658a32..5398d83618 100644
    --- a/articles/migrations/guides/legacy-lock-api-deprecation.md
    +++ b/articles/migrations/guides/legacy-lock-api-deprecation.md
    @@ -2,6 +2,7 @@
     title: Legacy Lock API Deprecation
     description: This article covers the Legacy Lock API deprecation and gives direction as to migration paths and changes required.
     toc: true
    +public: false
     contentType:
       - concept
       - how-to
    @@ -11,7 +12,7 @@ useCase:
     ---
     # Legacy Lock API Deprecation
     
    -On April 4, 2018, Auth0 [publicly disclosed a vulnerability](https://auth0.com/blog/managing-and-mitigating-security-vulnerabilities-at-auth0/). That vulnerability resulted in the deprecation of two endpoints in the Auth0 API, and the libraries and SDKs which used those endpoints. These endpoints were disabled on **July 16, 2018**, beginning a [brief grace period](https://community.auth0.com/t/soft-removal-of-legacy-lock-api/12949) in which usage of the endpoints could be re-enabled on a per-tenant basis until a migration could be completed. The endpoints have been removed from service as of **August 6, 2018**.
    +On April 4, 2018, Auth0 publicly disclosed a vulnerability. That vulnerability resulted in the deprecation of two endpoints in the Auth0 API, and the libraries and SDKs which used those endpoints. These endpoints were disabled on **July 16, 2018**, beginning a [brief grace period](https://community.auth0.com/t/soft-removal-of-legacy-lock-api/12949) in which usage of the endpoints could be re-enabled on a per-tenant basis until a migration could be completed. The endpoints have been removed from service as of **August 6, 2018**.
     
     The purpose of this guide is to help you to select the best migration path for your application(s) if you are impacted by the deprecation. 
     
    @@ -27,7 +28,7 @@ If you do not use the above libraries and do not specifically call the above end
     
     ### If you already use Universal Login / Hosted Login Page
     
    -Applications which log users in via Universal Login through an Auth0 hosted page are not _required_ to update the version of Lock or Auth0.js that they use _inside_ that login page (if you have customized your login page in the [Dashboard](${manage_url}/#/login_page). However, the use of the newest library versions is strongly recommended, even in the Universal Login Page. For those who have not customized their login page, the Lock v11 widget is already in use and no further action is required.
    +Applications which log users in via Universal Login through an Auth0-hosted page are not _required_ to update the version of Lock or Auth0.js that they use _inside_ that login page (if you have customized your login page in the [Dashboard](${manage_url}/#/login_page). However, the use of the newest library versions is strongly recommended, even in the Universal Login Page. For those who have not customized their login page, the Lock v11 widget is already in use and no further action is required.
     
     ### If you use embedded login
     
    @@ -35,7 +36,7 @@ Embedded login with Lock v11 and Auth0.js v9 now rely entirely on [cross-origin
     
     This cross-origin authentication protocol relies on cookies, which will be considered third-party cookies if the domain of the application and Auth0 tenant do not match. Unfortunately, some browsers block third-party cookies, and even if supported, many users may have manually disabled third-party cookies in their browsers. 
     
    -Because of these [cross-origin authentication issues](/cross-origin-authentication#limitations-of-cross-origin-authentication), there are only two general implementations that can be recommended. 
    +Because of these [cross-origin authentication issues](/cross-origin-authentication#limitations), there are only two general implementations that can be recommended. 
     
     1. [Migrate to Universal Login](#1-migrate-to-universal-login). Universal Login will work with or without [custom domains](/custom-domains), and will work from most application types as well. It requires the least application code to implement and is the most secure option. 
     
    @@ -58,11 +59,11 @@ Universal Login is **strongly** recommended for most use cases because it [offer
     * Developed, hosted and maintained by Auth0 (less maintenance required by your team).
     * Provides a single place to make changes.
     * More secure because credentials are collected and verified within the same domain. This reduces exposure of static credentials to multiple applications as well as the possibility of CSRF and man-in-the-middle attacks.
    -* Provides reliable Single Sign On functionality without relying on third-party cookies or restricting the domain of applications.
    +* Provides reliable Single Sign-on (SSO) functionality without relying on third-party cookies or restricting the domain of applications.
     * Fully customizable in terms of colors, text, logos, buttons as well as [custom domain](/custom-domains).
     * Provides proper cache control to avoid browsers caching old versions.
     * Can leverage either the [Lock Widget](/libraries/lock) or [Auth0.js SDK](/libraries/auth0js) for flexibility in appearance and function.
    -* Works with any type of Auth0 connection as well as [multi-factor authentication](/multifactor-authentication).
    +* Works with any type of Auth0 connection as well as multi-factor authentication (MFA).
     
     #### Universal Login migration guides
     
    @@ -74,9 +75,9 @@ Universal Login is **strongly** recommended for most use cases because it [offer
         

  • - Migrate Single Page Apps with Embedded Lock to Universal Login + Migrate Single-Page Apps with Embedded Lock to Universal Login

    - This document provides instruction for single page apps which have embedded login (via the Lock widget) to migrate to Universal Login. + This document provides instruction for single-page apps which have embedded login (via the Lock widget) to migrate to Universal Login.

  • @@ -94,12 +95,6 @@ Embedded login (embedding Lock or a custom authentication UI) should be used onl #### Embedded login migration guides -Continued use of embedded login will require the use of [custom domains](/custom-domains) in order to prevent cross-origin authentication issues. The custom domains documentation includes important information on the use of custom domains, how to set them up, and what configuration is required for more intricate use cases, such as custom domains with SAML. +Continued use of embedded login will require the use of [custom domains](/custom-domains) in order to prevent cross-origin authentication issues. The custom domains documentation includes important information on the use of custom domains, how to set them up, and what configuration is required for more intricate use cases, such as custom domains with SAML. ## Other considerations @@ -124,18 +119,18 @@ Once a user has been authenticated, an application may wish to retrieve informat For customers who are using the [/tokeninfo](/api/authentication#get-token-info) endpoint, this endpoint is being replaced with the /userinfo endpoint. Customers should migrate to use the /userinfo endpoint instead of /tokeninfo. The /userinfo endpoint is the only one that will be maintained going forward and is the only endpoint for user information that is supported with the [custom domains](/custom-domains) feature. -As explained in the /userinfo endpoint docs entry, /userinfo obtains information using the Management API and therefore requires an [Access Token](/tokens/access-token#how-to-get-an-access-token) (obtained during login) instead of the [ID Token](/tokens/id-token) used by /tokeninfo. +As explained in the /userinfo endpoint docs entry, /userinfo obtains information using the Management API and therefore requires an Access Token (obtained during login) instead of the [ID Token](/tokens/concepts/id-tokens) used by /tokeninfo. -Note also that the [/userinfo response](/api-auth/tutorials/adoption/scope-custom-claims) may vary based on scopes requested and the value of the [OIDC Conformant](/api-auth/tutorials/adoption/oidc-conformant) setting in the [Dashboard](${manage_url}) under **Applications > (Your Application) > Settings > Advanced Settings**. In that case, application code might need adjusted to handle the slightly altered response format. +Note also that the [/userinfo response](/api-auth/tutorials/adoption/scope-custom-claims) may vary based on scopes requested and the value of the [OIDC Conformant](/api-auth/tutorials/adoption/oidc-conformant) setting in the [Dashboard](${manage_url}) under **Applications > (Your Application) > Settings > Advanced Settings**. In that case, application code might need adjusted to handle the slightly altered response format. ### Session management -#### Single Page Applications +#### Single-Page Applications -If a user navigates to a new page in a Single Page Application, your application may wish to check if a user already has an existing session. In order to do this, you may have directly called the /ssodata endpoint or utilized the `getSSOData()` function in Auth0.js v8 or prior. The /ssodata endpoint is deprecated and was removed from service on **August 6, 2018**. The `getSSOData()` function will continue to work, but will behave differently, and in most cases, can be replaced with use of `checkSession()`. +If a user navigates to a new page in a Single-Page Application, your application may wish to check if a user already has an existing session. In order to do this, you may have directly called the /ssodata endpoint or utilized the `getSSOData()` function in Auth0.js v8 or prior. The /ssodata endpoint is deprecated and was removed from service on **August 6, 2018**. The `getSSOData()` function will continue to work, but will behave differently, and in most cases, can be replaced with use of `checkSession()`. ::: note -The `getSSOData()` and `checkSession()` functions should only be used from a Single Page Application +The `getSSOData()` and `checkSession()` functions should only be used from a Single-Page Application ::: ##### checkSession() @@ -146,7 +141,7 @@ The `getSSOData()` and `checkSession()` functions should only be used from a Sin ##### getSSOData() -* The Auth0.js v9 `getSSOData()` function will continue to work, but it now [behaves differently than in the past](/libraries/auth0js/v9/migration-v8-v9#review-calls-to-getssodata-). +* The Auth0.js v9 `getSSOData()` function will continue to work, but it now behaves differently than in the past. * In Auth0.js v9, `getSSOData()` will check if a user has an existing session and perform a further check to determine if the user is the same one as in the last interactive authentication transaction. This supports Lock’s feature of showing the last logged-in user to facilitate subsequent logins. * Invoking the `getSSOData()` function will now trigger a call to the [/authorize](/api/authentication#authorize-application) endpoint, which will in turn result in the execution of [rules](/rules). @@ -160,7 +155,7 @@ This was previously done with `getSSOData()`. The `getSSOData()` function perfor In "web applications", the backend typically has a session for the user. Over time, the application session may expire, in which case the application should renew the session. The application backend should invoke a call to the [/authorize](/api/authentication#authorize-application) endpoint to get a new token. If the Authorization Server (Auth0 in this case) still has a session for the user, the user will not have to re-enter their credentials to log in again. If Auth0 no longer has a session for the user, the user has to log in again. -Customers with web applications which call the API from their backend should use this approach. Specifically, they should [call /oauth/token](/tokens/refresh-token/current#use-a-refresh-token) to renew their token. +Customers with web applications which call the API from their backend should use this approach. Specifically, they should [call /oauth/token](/tokens/guides/use-refresh-tokens) to renew their token. ### How to log users out @@ -177,10 +172,4 @@ The solution for the Kerberos case is to [migrate to Universal Login](#1-migrate ## Troubleshooting -### How to tell if you have deprecated usage - -Please take a look at the [Deprecation Error Reference](/errors/deprecation-errors) to assist with verifying that your application does, or does not, use deprecated features. - -### Bookmarking the login page - -Bookmarking the Universal Login page is not supported. If a user bookmarks the login page and attempts to initiate authentication by going directly to the bookmarked URL instead of starting from the application, the following error message will be shown: `Password login is disabled for clients using externally hosted login pages with oidc_conformant flag set`. +See [Check Deprecation Errors](/troubleshoot/guides/check-deprecation-errors) for more information on deprecation-related errors. diff --git a/articles/migrations/guides/linkedin-api-deprecation.md b/articles/migrations/guides/linkedin-api-deprecation.md new file mode 100644 index 0000000000..011ba33906 --- /dev/null +++ b/articles/migrations/guides/linkedin-api-deprecation.md @@ -0,0 +1,54 @@ +--- +title: Migration to LinkedIn API V2 +description: This article covers the LinkedIn API deprecation and how to update your Auth0 LinkedIn Connection. +toc: true +public: false +contentType: + - how-to +useCase: + - add-login + - migrate +--- + +# Migration to LinkedIn API V2 + +In December 2018, LinkedIn [deprecated version 1.0 of their sign-in API](https://engineering.linkedin.com/blog/2018/12/developer-program-updates). The final shutdown date we set for March 1st, 2019 then moved to May 1st, 2019. In June 2019, the current status is that "Applications requesting Version 1.0 APIs may experience issues as we begin to remove services." + +LinkedIn replaced the sign-in API with [version 2.0, which has some key differences](https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context). + +We've added the option to set the LinkedIn API version for LinkedIn Connections. You can change the API version for a LinkedIn Connection through the Auth0 Dashboard by selecting a **Strategy Version** under the connection's settings. + +![New LinkedIn Connection Settings](/media/articles/connections/social/linkedin/linkedin-connection-new.png) + +Auth0 will not automatically migrate all connections to Version 2 until Version 1 stops working completely. We strongly recommend that you update your connection settings to Version 2. You may need to update your application code to accommodate these API changes. + +## What's changed? + +There are changes in the user attributes you can request. + +For version 1.0 we exposed these attributes: + +| **Auth0 Attribute**| **Linkedin Scope**| +|----------------|---------------| +| Profile| r_basicprofile| +| Full Profile | r_fullprofile| +| Network | r_network| +| Email | r_emailaddress| + +For version 2.0 we expose these options: + +| **Auth0 Attribute**| **Linkedin Scope**| +|----------------|---------------| +|Profile| r_liteprofile| +|Basic Profile| r_basicprofile| +|Email| r_emailaddress| + +As you can see version 2.0: + +* Adds support for the `r_liteprofile` scope +* Removes support for the `r_fullprofile` and `r_network` scopes +* Supports the `r_basicprofile` scope only for clients that are part of [LinkedIn’s Developer Enterprise](https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq#what-are-the-main-differences-with-the-new-sign-in-with-linkedin) services. + +::: note +Not all applications registered with LinkedIn can access their new API. For more details, check [Microsoft’s documentation](https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq#does-my-developer-application-have-access-to-the-linkedin-v2-api). +::: diff --git a/articles/migrations/guides/liveid-api-deprecation.md b/articles/migrations/guides/liveid-api-deprecation.md new file mode 100644 index 0000000000..bdf60569cf --- /dev/null +++ b/articles/migrations/guides/liveid-api-deprecation.md @@ -0,0 +1,118 @@ +--- +title: Microsoft Account Migration +description: This article covers the Live Connect + SDK deprecation and how to update your Auth0 Microsoft Account Connection. +toc: true +public: false +contentType: + - how-to +useCase: + - add-login + - migrate +--- + +# Microsoft Account Migration to Azure AD (personal accounts) + Microsoft Graph + +In October 2017, Microsoft announced the [deprecation of the Live Connect API and Live SDK](https://developer.microsoft.com/en-us/office/blogs/outlook-rest-api-v1-0-office-365-discovery-and-live-connect-api-deprecation). This is a Microsoft deprecation that will affect Auth0 users using the Microsoft social connection. The change implies switching how Auth0 interacts with the Microsoft authentication APIs, and it might imply changes in customers application's code. + +The change implies switching: + +- From the Live Connect API to the Azure Active Directory v2 and OIDC protocol for Microsoft Account authentication +- From the Live SDK to Microsoft Graph to be able to get other resources including user profiles, contacts, files, etc + +Note that even though Azure AD is used, this connection type will only accept personal accounts. For work or school accounts you should use the enterprise Azure AD connection type. + +You can decide if Auth0 uses Live Connect + Live SDK or Azure AD + Microsoft Graph using the 'Strategy Version' field in the Microsoft Account connection settings page. + +![New Microsoft Connection Settings](/media/articles/connections/social/microsoft-account/microsoft-account-azureid.png) + +You need to switch to 'Azure AD (personal accounts)' to ensure your applications will keep working after Microsoft decommissions the API. + +**Microsoft Application Registration** + +Depending on when you created your Live SDK application, it might or not support Azure Active Directory v2. If it's not supported, you will need to create a different application and update your Client ID and Client Secret in the Auth0 Microsoft connection settings. As a rule, if your Client ID looks like `00000000400FFF55`, you'll need to create a new application. + +For more information, check [Microsoft's documentation](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-registration-portal). + + +**User Profile** + +Microsoft Graph provides different user profile information compared to the Live Connect and Live SDK user profile. In particular, some of the user profile fields that were previously available are not available anymore: + + +***OIDC Profile*** + +| Field | Live SDK | Microsoft Graph | +|--------|---------------|------------------| +| picture | Returned a URL for the user picture | Auth0 will build a URL that will return a default picture for the user based on their initials | +| locale | Returned a string in the format en_US | Not available | + +***Raw Profile*** + +The raw user profile that can be obtained calling the [Get User By Id Endpoint](https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id) has several differences when using Live SDK or Microsoft Graph. + +The JSON below shows the fields that are in the Live SDK profile but are not present, or are different, in the Microsoft Graph one: + +```js +{ + "locale": "en_ZA", + "work": [], + "emails": [ + "john.doe@windowslive.com" + ], + "addresses": { + "personal": { + "street": null, + "street_2": null, + "city": null, + "state": null, + "postal_code": null, + "region": null + }, + "business": { + "street": null, + "street_2": null, + "city": null, + "state": null, + "postal_code": null, + "region": null + } + }, + "phones": { + "personal": null, + "business": null, + "mobile": null + }, + "nickname": "john.doe@windowslive.com", + ] +} +``` + +This other one shows the fields that are in the Microsoft Graph profile but are not present, or are different, in the Live SDK one one: + +```js +{ + "strategy_version": 2, + "displayName": "John Doe", + "userPrincipalName": "john.doe@windowslive.com", + "businessPhones": [], + "nickname": "john.doe", +} +``` + +Key differences are: + +- `strategy_version` has the value `1` when the user last logged-in with Live Connect, or `2` when they last logged in with Azure AD. +- `nickname` has a different format. +- `locale`, `work`, `emails` array, `addresses`, `phones` are present in Live SDK but not in Microsoft Graph. +- `displayName`, `userPrincipalName`, `businessPhones` array are present in Microsoft Graph but not in Live SDK. + +If a user that has previously logged in with Live Connect logs in with AzureAD, the profiles will be merged. The new profile will have both the content of the Live ID profile plus the fields from the Microsoft Graph profile. + +The `strategy_version` will be set to '2' for users that last logged in with Azure AD, to '1' for users that logged in with Live Connect recently, and will not be present for users that did not login recently. You can use this field to better interpret the profile content. + +Note that the `user_id` field will be the same regardless of the API used to connect with Microsoft, even if you had to create another application to use Azure Active Directory v2. + +**Permissions** + +Auth0 lets you select which permissions you want to ask from the Microsoft Graph APIs. The ones that Live SDK and Microsoft Graph support might provide similar functionality, but the data returned by them and their format may be completely different. See [Migrating from Live SDK - Permissions](https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/migrating-from-live-sdk?view=odsp-graph-online#permissions) to understand what changes are required in your code. + diff --git a/articles/migrations/guides/management-api-v1-v2.md b/articles/migrations/guides/management-api-v1-v2.md new file mode 100644 index 0000000000..65ea5d6bfb --- /dev/null +++ b/articles/migrations/guides/management-api-v1-v2.md @@ -0,0 +1,108 @@ +--- +title: Migrate from Management API v1 to v2 +description: Learn how to migrate from Auth0 Management API v1 to v2. +topics: + - management api +contentType: + - concept + - how-to +useCase: + - management api +--- +# Migrate from Management API v1 to v2 + +Auth0’s Management API v1 was deprecated in 2016 and replaced with the [Auth0 Management API v2](/api/management/v2/). Management API v1 will reach its End Of Life in the Public Cloud on **July 13th, 2020**. Requests will begin failing with a `410` HTTP status code on or after that date. Management API v1 will be included in the Private Cloud until the November 2020 monthly release, which is the first release that will not include Management API v1. + +## Key Dates + +The following are key dates for this migration: + +| Date | Public Cloud | Private Cloud | +|------|--------------|---------------| +| Jan 13, 2020 | Initial Public Announcement | N/A | +| May 21, 2020 | N/A | Initial Public Announcement | +| July 13, 2020 | End of Life for Management API v1 | N/A | +| November 2020 | N/A | Support removed from release for Mgmt API V1 | + +## Am I affected by the migration? + +Affected tenants are those who meet all of the following criteria: + +* Created before January 2, 2020 +* Actively making requests to Auth0 endpoints directly under the `/api/` path from your application. + +The following tenants are NOT affected: + +* Created after January 2, 2020 +* Exclusively using the Auth0 Management API v2 endpoints +* Using the Authentication API exclusively, the Authentication API is not affected by this deprecation. + +## How can I check to see if I've migrated all my requests? + +Deprecation Notices will be recorded in your Tenant Logs for requests that will fail at API v1’s End of Life. You can search for relevant Deprecation Notices in your tenant logs with the following query: + +``` +type:depnote AND description:*APIv1* +``` + +::: note +**Private Cloud Customers** + +- You must be running release [2003](https://auth0.com/releases/2003) or later to see Deprecation Notices. + +- If searching tenant logs from the Dashboard, search for `type:depnote`. Searching by `description` is not currently supported in the tenant logs search available in the Dashboard. If you [export your logs to an external service](/extensions#logs-export), you can leverage it to query for APIv1 Deprecation Notices using a combination of `type` and `description`. +::: + +![Management API Version 1 Log Query](/media/articles/migrations/apiv1-log-query.png) + +To help identify the Application making requests, logs will include the `client_id` used to make the request. You can also find the endpoint being used in the logs `details.path` field. + +Note that our current SDKs all use Management API v2. If you're seeing API v1 activity from an Application that is leveraging an older SDK, you should upgrade to the latest version. + +![Management API Versiion 1 Log Example](/media/articles/migrations/apiv1-log-example.png) + +::: note +Auth0 generates only one log for each `client_id` and `details.path` combination every 60 minutes. No matter how many calls you make to the deprecated endpoints, you will still see a single log per hour for *each* deprecated endpoint an application calls. + +If you implement changes to your requests, you'll need to allow 60 minutes to elapse before you can conclusively determine that the lack of new `depnote` logs means the deprecated endpoints have been removed from your code. +::: + +## What’s changing? + +For a complete list of breaking changes associated with this deprecation, see [Management API v2 Changes](/api/management/v2/changes). + +## How do I migrate? + +After replacing all calls to the Management API v1 with their [Management API v2 replacements](/api/management/v2/changes), you should confirm you are no longer seeing Deprecation Notices in your Tenant Logs and **disable the Management API v1 for your tenant.** + +You can disable API v1 by going **Tenant Settings** > **Advanced** > **Migration** in the [Auth0 Dashboard](http://manage.auth0.com/). This will simulate the expected behavior after the End of Life date, causing calls to API v1 to fail with a `410` HTTP status code. You will be able to re-enable API v1 any time before the End of Life date. + +By migrating your requests to API v2 and disabling API v1 as soon as possible, you will ensure that your systems will continue to operate uninterrupted after the **July 13th, 2020** End of Life date, at which time the option to enable API v1 will be removed. + +![Toggle Management API Version](/media/articles/migrations/apiv1-toggle.png) + +::: note +Note that tenants created after January 2, 2020 will not have access to API v1. If you need API v1 enabled on a tenant for testing your migration, please open a ticket in our [Support Center](https://support.auth0.com/tickets). +::: + +If you need help with the migration, contact us using the [Support Center](https://support.auth0.com/) or our [Community Site](https://community.auth0.com/c/auth0-community/Migrations). + +## Auth0 AD/LDAP Connector Health Monitor extension + +The [Auth0 AD/LDAP Connector Health Monitor](/extensions/adldap-connector) extension v1 uses the API v1 `GET /api/connections/{connection-name}` and `GET /api/connections/{connection-name}/socket` endpoints. + +Please upgrade to the latest version of the extension before disabling API v1 support. + +## SharePoint Integration Custom Claims Provider + +The Custom Claims Provider of the [Auth0 SharePoint Integration](https://auth0.com/docs/integrations/sharepoint) leverages three API v1 endpoints : `/api/enterpriseconnections/users`, `/api/socialconnections/users`, and `/api/connections`. + +If you are calling these endpoints from the SharePoint integration, they will continue to work after the API v1 End of Life date. You may continue see `depnote` tenant logs for this activity. If the `client_id` in the tenant log is a SharePoint application, you can disregard this warning. + +If you are calling these endpoints directly from your code, you will need to migrate those calls off of API v1. + +## Keep reading + +* [Complete list of changes](/api/management/v2/changes) +* [Management APIv1 documentation](/api/management/v1) +* [Management APIv2 documentation](/api/management/v2) diff --git a/articles/migrations/guides/migration-oauthro-oauthtoken-pwdless.md b/articles/migrations/guides/migration-oauthro-oauthtoken-pwdless.md new file mode 100644 index 0000000000..2af6b0ea4e --- /dev/null +++ b/articles/migrations/guides/migration-oauthro-oauthtoken-pwdless.md @@ -0,0 +1,121 @@ +--- +title: Migration Guide for Resource Owner Passwordless Authentication +description: Learn how to migrate your Passwordless API calls and responses from /oauth/ro to /oauth/token +toc: true +contentType: + - concept +useCase: + - secure-an-api + - migrate +--- +# Migration Guide for Resource Owner Passwordless Credentials Exchange + +Support for Resource Owner Password was added to [/oauth/token](/api/authentication#authorization-code). Usage of the [/oauth/ro](/api/authentication#resource-owner) endpoint was deprecated on July 08, 2017. This endpoint was used to exchange an OTP received by the end-user by email or SMS with for an `id_token` and an `access_token`. + +We have implemented a new API that replaces `oauth/ro` for this use case, and we recommend customers to migrate to the new implementation. + +## Does this affect me ? + +This change affects you if you use the resource owner passwordless credentials exchange and call `/oauth/ro` directly without the use of any Auth0 libraries or SDKs. + +<%= include('./_forced-logouts.md') %> + +## Changes to requests + +Previously, the payload of a request to `/oauth/ro` looked similar to this: + +```json +{ + "grant_type": "password", + "client_id": "123", + "username": "alice", + "password": "A3ddj3w", + "connection": "my-database-connection", + "scope": "openid email favorite_color offline_access", + "device": "my-device-name" +} +``` + +These are the changes for the new implementation: + +* The endpoint to execute token exchanges is now `/oauth/token` +* [Auth0's own grant type](/api-auth/tutorials/password-grant#realm-support) is used to authenticate users from a specific connection (or `realm`). +* Auth0 supports the [standard OIDC scopes](/scopes/current/oidc-scopes), along with the scopes which you have defined in your [custom API](/api-auth/apis). +* A scope that does not fit in one of these categories, such as the above `favorite_color`, is no longer a valid scope. +* The `device` parameter is removed. +* The `audience` parameter is optional. + +Here is an example of the payload of a request to `/oauth/token`: + +```json +{ + "grant_type" : "http://auth0.com/oauth/grant-type/passwordless/otp", + "client_id": "YOUR_CLIENT_ID", + "client_secret": "YOUR_CLIENT_SECRET", // only for web apps, native apps don’t have a client secret + "username": "", // or "" + "otp": "CODE", + "realm": "email", // or "sms" + "audience" : "your-api-audience", // in case you need an access token for a specific API + "scopes": "openid profile email" // whatever scopes you need +} +``` + +* The grant type is specified here as `http://auth0.com/oauth/grant-type/passwordless/otp` +* The parameters `client_id` and `username` are unchanged. +* The `client_secret` needs to be specified for confidential clients (e.g. regular web apps). +* The one-time password needs to be sent in the `otp` parameter instead of the `password` parameter. +* The `realm` is used to identify the connection, and replaces the `connection` parameter from previous calls. +* The `scope` parameter is mostly the same, but does not accept non-OIDC values. +* The `audience` parameter can be added, indicating the API audience the token will be intended for. + +## Changes to responses + +Responses from `/oauth/ro` were similar in format to the following: + +```json +{ + "access_token": "SlAV32hkKG", + "token_type": "Bearer", + "refresh_token": "8xLOxBtZp8", + "expires_in": 3600, + "id_token": "eyJ..." +} +``` + +* The returned Access Token is valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) (provided that the API specified by the `audience` param uses RS256 as [signing algorithm](/tokens/concepts/signing-algorithms)) and optionally the [custom API](/api-auth/apis) if one was specified. +* The ID Token will be forcibly signed using RS256 if requested by a [public client](/clients/client-types#public-clients). +* A Refresh Token will be returned only if the `offline_access` scope was granted and the API has **Allow offline access** set. + +Here is an example of the response from `/oauth/token`: + +```json +{ + "access_token": "eyJ...", + "token_type": "Bearer", + "refresh_token": "8xLOxBtZp8", + "expires_in": 3600, + "id_token": "eyJ..." +} +``` + +## Code changes when using the SDKs + +If your application uses the Auth0 native libraries for Android or iOS, be sure that the version of the library you are including is at least the minimum listed below (or higher). Also, be sure to set the 'OIDC Conformant' flag to `true` when configuring the libraries. + +|Library|Minimum Version| +|---|---| +|[Android SDK](/libraries/auth0-android/passwordless)|1.2| +|[Lock Android](/libraries/lock-android/passwordless)|2.17| +|[Swift SDK](/libraries/auth0-swift/passwordless)|1.20.0| +|[Lock iOS](/libraries/lock-ios/passwordless)|2.14.0| + +## Verifying your migration + +Once you have migrated your codebase, if you would like to be sure that your applications are no longer calling the legacy endpoint. + +You can verify whether you are still using the deprecated endpoint by checking the [tenant logs](${manage_url}/#/logs), filtering by "Deprecation Notice" and check for logs saying "oauth/ro passwordless: This feature is being deprecated". You can also perform this search directly with the following query: `type:depnote AND description:*passwordless*`. + +Once you made sure your applications are not calling the endpoint, you can go to the [Dashboard](${manage_url}/#/tenant/advanced) under **Tenant Settings > Advanced** then scroll down to **Migrations** and toggle off the Legacy `/oauth/ro` Endpoint switch. Turning off this switch will disable the deprecated endpoint for your tenant, preventing it from being used at all. + +![Legacy Migration Toggles](/media/articles/libraries/lock/migration-toggles.png) + diff --git a/articles/migrations/guides/migration-oauthro-oauthtoken.md b/articles/migrations/guides/migration-oauthro-oauthtoken.md index 75d93c14de..cf4d290c1f 100644 --- a/articles/migrations/guides/migration-oauthro-oauthtoken.md +++ b/articles/migrations/guides/migration-oauthro-oauthtoken.md @@ -10,11 +10,13 @@ useCase: --- # Migration Guide for Resource Owner Password Credentials Exchange -Support for Resource Owner Password was added to [oauth/token](/api/authentication#authorization-code) and usage of the [oauth/ro](/api/authentication#resource-owner) endpoint will be deprecated at some point in the future. +Support for Resource Owner Password was added to [oauth/token](/api/authentication#authorization-code). Usage of the [oauth/ro](/api/authentication#resource-owner) endpoint was deprecated on July 08, 2017. ## Does this affect me ? -This guide is for users who use the resource owner password credentials exchange, and call /oauth/ro directly, without the use of any Auth0 libraries or SDKs. The major Auth0 libraries such as [Lock](/libraries/lock) or [Auth0.js](/libraries/auth0js) have already been updated to stop using /oauth/ro internally. If you use the `lock-passwordless` library, you can now use [Passwordless Mode](/libraries/lock/v11#passwordless) in Lock v11 instead. +This change affects you if you use the resource owner password credentials exchange, and call `/oauth/ro` directly, without the use of any Auth0 libraries or SDKs. The major Auth0 libraries such as [Lock](/libraries/lock) or [Auth0.js](/libraries/auth0js) have already been updated to stop using /oauth/ro internally. If you use the `lock-passwordless` library, you can now use [Passwordless Mode](/libraries/lock/v11#passwordless) in Lock v11 instead. + +<%= include('./_forced-logouts.md') %> ## Changes to requests @@ -34,10 +36,10 @@ Previously, the payload of a request to /oauth/ro looked similar to this: * The endpoint to execute token exchanges is now /oauth/token * [Auth0's own grant type](/api-auth/tutorials/password-grant#realm-support) is used to authenticate users from a specific connection (or `realm`). -* Auth0 supports the [standard OIDC scopes](/scopes/current#openid-connect-scopes), along with the scopes which you have defined in your [custom API](/api-auth/apis). +* Auth0 supports the [standard OIDC scopes](/scopes/current/oidc-scopes), along with the scopes which you have defined in your [custom API](/api-auth/apis). * A scope that doesn't fit in one of these categories, such as the above `favorite_color`, is no longer a valid scope. * The `device` parameter is removed. -* The `audience` parameter is optional. +* The `audience` parameter is optional. Here is an example of the payload of a request to /oauth/token: @@ -73,9 +75,9 @@ Responses from `oauth/ro` were similar in format to the following: } ``` -* The returned Access Token is valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) (provided that the API specified by the `audience` param uses RS256 as signing algorithm) and optionally the [custom API](/api-auth/apis) if one was specified. +* The returned Access Token is valid for calling the [/userinfo endpoint](/api/authentication#get-user-info) (provided that the API specified by the `audience` param uses RS256 as [signing algorithm](/tokens/concepts/signing-algorithms)) and optionally the [custom API](/api-auth/apis) if one was specified. * The ID Token will be forcibly signed using RS256 if requested by a [public client](/clients/client-types#public-clients). -* A Refresh Token will be returned only if the `offline_access` scope was granted and the API has **Allow offline access** set. +* A Refresh Token will be returned only if the `offline_access` scope was granted and the API has **Allow offline access** set. Here is an example of the OIDC conformant response from `oauth/token`: diff --git a/articles/migrations/guides/passwordless-start.md b/articles/migrations/guides/passwordless-start.md new file mode 100644 index 0000000000..690d1f5786 --- /dev/null +++ b/articles/migrations/guides/passwordless-start.md @@ -0,0 +1,100 @@ +--- +title: Migration Guide for the Use of /passwordless/start from Confidential Applications +description: Auth0 is deprecating the usage of the /passwordless/start endpoint from confidential applications without a client secret in the request. +topics: + - passwordless + - migrations +contentType: + - concept + - how-to +useCase: + - customize-connections +--- +# Migration Guide: Use of /passwordless/start from Confidential Applications + +Auth0 is deprecating the use of the `/passwordless/start` endpoint from confidential applications when Auth0 cannot authenticate that the call is made on behalf of the application. + +OAuth uses the term 'confidential' for applications that can store secrets. In Auth0, those are 'Regular Web Applications', which serve web pages from a backend app. Single Page Applications and Native Applications are considered 'public' applications, and are not affected by this change. + +Auth0 can authenticate calls to `/passwordless/start` when they include a `client_secret` as a parameter, or when the calls are made from the custom login page in Universal Login and forward the `state` parameter. + +## Does this affect me? + +If any of your applications currently call the `/passwordless/start` endpoint directly to begin passwordless authentication from a Web Application, and you are not sending the `client_secret` as a parameter, this deprecation does affect you. + +If you are implementing passwordless authentication through the Universal Login page and you changed the default way Auth0 libraries are initialized, it might also affect you too. + +You can verify whether you are affected by checking the [tenant logs](${manage_url}/#/logs), filtering by "Deprecation Notice" and check for logs saying "Enforce client authentication for passwordless connections". You can also perform this search directly with the following query: `type:depnote AND description:*passwordless*`. Note that this specific query will only work for public cloud tenants, as private cloud logs cannot be searched on the description field. + +## What do I need to do? + +If you are calling the `/passwordless/start` endpoint without proper application authentication you should: + +- Follow the instructions described below to adjust the code to properly call `/passwordless/start`. +- Check your [tenant logs](${manage_url}/#/logs) to verify the change was made correctly and no deprecation logs are being generated for "Enforce client authentication for passwordless connections". +- In the **Migrations** section of Advanced Tenant Settings, turn on the **Enforce client authentication for passwordless connections** toggle. + +## How I need to change my code? + +There are a few use cases that might be affected, but for each, the migration path is fairly straightforward: + +### 1. API calls from your backend + +For any calls from your backend to the `/passwordless/start` endpoint, your call must include the client secret as a parameter. + +If making a POST request directly to `/passwordless/start`, include the `client_secret` as part of the payload: + +```json +POST https://YOUR_AUTH0_DOMAIN/passwordless/start +Content-Type: application/json +{ + "client_id": "YOUR_CLIENT_ID", + "client_secret": "YOUR_CLIENT_SECRET", + "connection": "email|sms", + "email": "EMAIL", //set for connection=email + "phone_number": "PHONE_NUMBER", //set for connection=sms + "send": "link|code", + "authParams": { + "scope": "openid", + "state": "YOUR_STATE" + } +} +``` + +If you are using an SDK, add the parameter to the method that initiates the passwordless flow. This is different for each SDK, and not all SDKs have been updated yet. If you are using an SDK that was not updated, you can make the HTTP call directly until that work is completed. + +### 2. Using Auth0.js or Lock.js in the Universal Login page + +If the Universal Login page is used for Passwordless Authentication for a Web Application, it will be making calls to the `/passwordless/start` endpoint, by either using Lock.js or Auth0.js. + +Given you can't store a client secret in a web page, the way to authenticate the call is by forwarding the `state` parameter that is received in the Universal Login page to the `/passwordless/start` endpoint. That parameter is stored in the `config.internalOptions` field in the custom login page. + +The default templates for customizing the login page use it in the following way when initializing Lock.js or auth0.js: + +```js +var lock = new Auth0Lock(config.clientID, config.auth0Domain, { + auth: { + // .. other fields set + params: config.internalOptions + }) +``` + +```js +var params = Object.assign({ + // .. some fields set +}, config.internalOptions); + +var webAuth = new auth0.WebAuth(params); +``` + +Please check in your custom page implementation to verify that you have not removed that code. + +### 3. Calling /passwordless/start from the client in a web application + +We found that some customers are calling the `/passwordless/start` endpoint from a page using JavaScript (for example, they might be using auth0.js on the page) from Regular Web Applications. This will not be possible, as you cannot specify a client secret in a call made using JavaScript. If this is currently the case for your application, you will need to change your applications so that `/passwordless/start` is called from the backend of your web application, rather than from the frontend. + +## Rate Limits + +A consequence of adding client authentication to `/passwordless/start` is that Auth0 can trust the headers sent with the request. Auth0 takes into account the `auth0-forwarded-for` header when enforcing rate limits. If you set that header with the end user's IP address when making the call from the server, Auth0 will rate limit the endpoint based on the end user's IP, instead of the server IP. + +You can read more about this in the [passwordless endpoints](/connections/passwordless/relevant-api-endpoints#rate-limiting-in-passwordless-endpoints) documentation. diff --git a/articles/migrations/guides/unpaginated-requests.md b/articles/migrations/guides/unpaginated-requests.md new file mode 100644 index 0000000000..6ee5a263c8 --- /dev/null +++ b/articles/migrations/guides/unpaginated-requests.md @@ -0,0 +1,67 @@ +--- +title: Migrate to Management API v2 Endpoint Paginated Queries +description: Query requests to specific Management API endpoints will return up to 50 results instead of all available items. You must now specify `page` and `per_page` parameters. +topics: + - pagination + - migrations +contentType: + - concept + - how-to +useCase: + - paginated-results +--- +# Migrate to Management API v2 Endpoint Paginated Queries + +After **26 January 2021**, requests to Management API v2 endpoints will return a maximum of 50 items for tenants in the Public Cloud. To retrieve more items, you must include the `page` and `per_page` parameters. Beginning on **21 July 2020**, Auth0 will display tenant logs and a migration toggle to help you prepare for this change. + +Affected tenants are those that meet the following criteria: + +* Auth0 Public Cloud (currently) +* Created **before 21 July 2020** +* Actively making calls to the affected endpoints without passing the `per_page` parameter for queries that can return more than 1 result. + +The following tenants are not affected: + +* Created **on or after 21 July 2020** +* Not using any of the affected endpoints +* Using the affected endpoints and passing the `per_page` parameter, or making queries that will always return a single result. + +## Endpoints affected + +Calls to the following Management API v2 endpoints are affected: + +* [`GET /api/v2/clients`](/api/management/v2#!/Clients/get_clients) +* [`GET /api/v2/client_grants`](/api/management/v2#!/Clients/client_grants) +* [`GET /api/v2/grants`](/api/management/v2#!/Clients/grants) +* [`GET /api/v2/connections`](/api/management/v2#!/Clients/connections) +* [`GET /api/v2/device-credentials`](/api/management/v2#!/Clients/device_credentials) (when `type` query parameter is provided) +* [`GET /api/v2/resource-servers`](/api/management/v2#!/Clients/resource_servers) +* [`GET /api/v2/rules`](/api/management/v2#!/Clients/rules) + +Deprecation notices will be recorded in your tenant logs for all requests without pagination options that are currently returning more than 1 item, once per hour, for each different client and endpoint. + +## Actions + +1. Replace all calls to the affected endpoints by providing the `page` and `per_page` parameters. + +| Parameter | Type | Description | +| -- | -- | -- | +| `page` | Integer | Page index of the results to return. First page is 0. If `page` is not specified, it will default to 0. | +| `per_page` | Integer | Number of results per page. Paging is disabled if the parameter is not sent. `per_page` has a maximum value of 100. | + +2. Confirm that you are no longer seeing deprecation notices in your tenant logs. Check if a request returned more than 50 items. Look at the `details.size_exceeded` field and check if it’s `true`. + - Use the following log query to return all calls without pagination options with more than 1 result: `type:depnote AND description:*Unpaginated*` + - Use the following log query to return all calls without pagination options with more than 50 results: `type:depnote AND description:*Unpaginated* AND details.size_exceeded:true` + + To identify the application making request, logs will include the `client_id` used to make the request. You can also find the endpoint being used in the logs `details.path` field. + +3. Disable Management API unpaginated requests for your tenant. Go to [**Dashboard > Tenant Settings > Advanced > Migration**](${manage_url}/#/tenant/advanced). This will simulate the expected behavior after the migration window closes, causing calls to affected endpoints to return up to 50 results. + + You will be able to re-enable unpaginated requests any time before that date. + +### Update extensions + +You may need to update from previous versions of [Auth0 Extensions](/extensions) and custom extensions may need to be updated to their latest versions to make sure they are only performing paginated queries. + +1. Check your tenant logs for deprecation notices for clients with an ID matching an extension URL. It means you will need to update that extension. +2. Go to [**Dashboard > Extensions**](${manage_url}/#/extensions), select **Installed Extensions**, and click on the extension's **Update** link if present. diff --git a/articles/migrations/guides/yahoo-userinfo-updates.md b/articles/migrations/guides/yahoo-userinfo-updates.md new file mode 100644 index 0000000000..33bd6ea68a --- /dev/null +++ b/articles/migrations/guides/yahoo-userinfo-updates.md @@ -0,0 +1,58 @@ +--- +title: Changes to Yahoo Profile +description: The latest version of the Yahoo API changes the structure of the user profile +toc: true +contentType: + - how-to +useCase: + - add-login + - migrate +--- + +# Changes to Yahoo Profile + +Yahoo changed the API that applications need to use to retrieve the User Profile from their [Social Directory API](https://developer.yahoo.com/oauth/social-directory-eol/) to a Yahoo `/userinfo` endpoint. This change implies that the structure of the user profile for Yahoo users in Auth0 will change. + +Auth0 previously loaded all the profile data that Yahoo returned, and added these additional fields that were mapped from the Yahoo profile: + +|Auth0 field|Yahoo field| +|---|---| +|user_id|guid| +|sub|guid| +|name|nickname| +|time_zone|timeZone| +|uri|uri| +|url|profileUrl| +|isConnected|isConnected| +|email_verified|verified| +|email|email| + +Yahoo stopped returning `url`, `profileUrl`, `isConnected`, and a set of other fields listed in [Yahoo’s documentation](https://developer.yahoo.com/oauth/social-directory-eol/) (see ‘List Of Attributes Deprecated in Social Directory Profile Api’). Those other fields will also not be part of the profile. + +The Yahoo `/userinfo` endpoint will return different fields depending on the API Permissions you configure in the [Yahoo Application](https://developer.yahoo.com/apps/) definition. + +Yahoo lets you grant one of four permissions in the **Profile (Social Directory)** permissions section: + +- Read Public Basic +- Read Public Extended +- Read Write Public +- Read Write Public and Private + +When configuring the Yahoo Connection in your Auth0 Dashboard, you need to select the attribute that corresponds to the permissions you granted in your Yahoo setup. If you choose an attribute that does not match what you specified on Yahoo, the login transaction will fail. + +|Yahoo Connection Attributes|Profile Fields| +|--|--| +|Basic Profile| sub, name, given_name, family_name, locale| +|Basic Profile Write| sub, name, given_name, family_name, locale| +|Extended Profile |sub, name, given_name, family_name, locale, email, email_verified, birthdate, profile_images, picture, preferred_username, phone_number, nickname | +|Extended Write | sub, name, given_name, family_name, locale, email, email_verified, birthdate, profile_images, picture, preferred_username, phone_number, nickname | + +If you do not select any permissions in the Auth0 connection settings, Auth0 will by default ask for the `openid` scope, which will return the profile fields that correspond to whatever API Permission you specified in the Yahoo Application. For example, if your Yahoo application is configured with `Read Public Extended`, it will return the `sub, name, given_name, family_name, locale, email, email_verified, birthdate, profile_images, picture, preferred_username, phone_number and nickname` fields. + +**Do I need to take any action?** + +Auth0 will default to send the `openid` scope when authenticating with Yahoo. + +If you are using the Yahoo connection to authenticate users and get their basic information, your application will continue to work without changes. + +If your application is accessing fields in the user profile that are no longer available, then you will need to make sure you enable the right Connection Attribute in the Auth0 dashboard and adjust your application code to use the proper field names. diff --git a/articles/migrations/index.md b/articles/migrations/index.md deleted file mode 100644 index e75f5f36cb..0000000000 --- a/articles/migrations/index.md +++ /dev/null @@ -1,144 +0,0 @@ ---- -toc: true -title: Auth0 Migrations -description: List of all the changes made on Auth0 platform that might affect customers -topics: - - migrations -contentType: - - concept - - reference -useCase: - - migrate ---- - -# Migrations - -Occasionally, Auth0 engineers must make breaking changes to the Auth0 platform, primarily for security reasons. If a vulnerability or other problem in the platform is not up to our high standards of security, we work to correct the issue. - -Sometimes a correction will cause a breaking change to customer's applications. Depending on the severity of the issue, we may have to make the change immediately. - -For changes that do not require immediate changes, we often allow a grace period to allow you time to update your applications. - -## Migration process - -The migration process is outlined below: - -1. We update the platform and add a new migration option for existing customers, allowing a grace period for opt-in. New customers are always automatically enrolled in all migrations. -2. After a certain period, the migration is enabled for all customers. This grace period varies based on the severity and impact of the breaking change, typically 30 or 90 days. - -During the grace period, customers are informed via dashboard notifications and emails to tenant administrators. You will continue to receive emails until the migration has been enabled on each tenant you administer. - -If you need help with the migration, create a ticket in our [Support Center](${env.DOMAIN_URL_SUPPORT}). - -## Active migrations - -Current migrations are listed below, newest first. - -For migrations that have already been enabled for all customers, see [Past Migrations](/migrations/past-migrations). - -### Node.js v8 for Webtask Runtime - -| Severity | Grace Period Start | Mandatory Opt-In| -| --- | --- | --- | -| High | 2018-04-17 | 2018-04-30 | - -The Webtask engine powering Auth0 extensibility points currently utilizes Node 4. Beginning **30 April 2018**, [Node.js v4 will no longer be under long-term support (LTS)](https://github.com/nodejs/Release#release-schedule). This means that critical security fixes will no longer be back-ported to this version. As such, Auth0 will be migrating the Webtask runtime from Node.js v4 to Node.js v8. - -On **17 April 2018** we will make the Node 8 runtime available for extensibility to all public cloud customers. You will be provided a migration switch that allows you to control your environment's migration to the new runtime environment. - -For more information on this migration and the steps you should follow to upgrade your implementation, see [Migration Guide: Extensibility and Node.js v8](/migrations/guides/extensibility-node8). - -### Introducing Lock v11 and Auth0.js v9 - -| Severity | Grace Period Start | Mandatory Opt-In| -| --- | --- | --- | -| Medium | 2017-12-21 | 2018-08-06 | - -We are continually improving the security of our service. As part of this effort, we have deprecated the Legacy Lock API, which consists of the /usernamepassword/login and /ssodata endpoints. These endpoints are used by Lock.js v8, v9, and v10 and Auth0.js, v6, v7, and v8, and can also be called directly from applications. - -As of August 6, 2018, Auth0 has permanently disabled the Legacy Lock API. This removal of service fully mitigates the CSRF vulnerability [disclosed in April 2018](https://auth0.com/blog/managing-and-mitigating-security-vulnerabilities-at-auth0/). This also ends the soft removal grace period that was [first announced on July 16, 2018](https://community.auth0.com/t/auth0-legacy-lock-api-disabled-grace-period-available/12949), meaning the Legacy Lock API can no longer be re-enabled. - -If your Legacy Lock API migration has not yet been completed, your users may experience an outage, failed logins, or other adverse effects. You will need to complete your migration in order to restore normal functionality. Refer to the [Legacy Lock API Deprecation Guide](/migrations/guides/legacy-lock-api-deprecation) to determine the correct path for your needs; you may also wish to consult the [Deprecation Error Reference](/errors/deprecation-errors) to identify the source(s) of any errors in your tenant logs. - -#### Am I affected by the change? - -If you are currently implementing login in your application with Lock v8, v9, or v10, or Auth0.js v6, v7, or v8, you are affected by these changes. Additionally, you are affected if your application calls the /usernamepassword/login or /ssodata endpoints directly via the API. - -We **recommend** that applications using [Universal Login](/hosted-pages/login) update the library versions they use inside of the login page. - -However, those who are using Lock or Auth0.js embedded within their applications, or are calling the affected API endpoints directly, are **required** to update, and applications which still use deprecated endpoints will cease to function properly after the removal of service date. - -Libraries and SDKs not explicitly named here are not affected by this migration. - -If you have any questions, reach out in our [Support Center](${env.DOMAIN_URL_SUPPORT}). - -### Deprecating the usage of ID Tokens on the Auth0 Management API - -| Severity | Grace Period Start | Mandatory Opt-In| -| --- | --- | --- | -| Medium | 2018-03-31 | - | - -For some use cases you can use [ID Tokens](/tokens/id-token) as credentials in order to call the [Management API](/api/management/v2). This functionality is being deprecated. - -This is used by the [Users](/api/management/v2#!/Users/get_users_by_id) and [Device Credentials](/api/management/v2#!/Device_Credentials/get_device_credentials) endpoints. - -List of affected endpoints: - -| **Endpoint** | **Use Case** | -|-|-| -| [GET /api/v2/users/{id}](/api/management/v2#!/Users/get_users_by_id) | Retrieve a user's information | -| [GET /api/v2/users/{id}/enrollments](/api/management/v2#!/Users/get_enrollments) | Retrieve all [Guardian](/multifactor-authentication/guardian) MFA enrollments for a user | -| [PATCH /api/v2/users/{id}](/api/management/v2#!/Users/patch_users_by_id) | Update a user's information | -| [DELETE /api/v2/users/{id}/multifactor/{provider}](/api/management/v2#!/Users/delete_multifactor_by_provider) | Delete the [multifactor](/multifactor-authentication) provider settings for a user | -| [POST /api/v2/device-credentials](/api/management/v2#!/Device_Credentials/post_device_credentials) | Create a public key for a device | -| [DELETE /api/v2/device-credentials/{id}](/api/management/v2#!/Device_Credentials/delete_device_credentials_by_id) | Delete a device credential | -| [POST/api/v2/users/{id}/identities](/api/management/v2#!/Users/post_identities) | [Link user accounts](/link-accounts) from various identity providers | -| [DELETE /api/v2/users/{id}/identities/{provider}/{user_id}](/api/management/v2#!/Users/delete_provider_by_user_id) | [Unlink user accounts](/link-accounts#unlinking-accounts) | - -These endpoints can now accept regular [Access Tokens](/access-token). - -The functionality is available and affected users are encouraged to migrate. However the ability to use ID Tokens will not be disabled in the foreseeable future so the mandatory opt-in date for this migration remains open. When this changes, customers will be notified beforehand. - -For more information on this migration and the steps you should follow to upgrade your implementation, see the [Migration Guide: Management API and ID Tokens](/migrations/guides/calling-api-with-idtokens). - -#### Am I affected by the change? - -If you are currently using [ID Tokens](/tokens/id-token) to access any part of the Management API, your application will need to be updated. - -If you have any questions, create a ticket in our [Support Center](${env.DOMAIN_URL_SUPPORT}). - -## Upcoming migrations - -Based on customer feedback, we have adjusted our plans and will continue to maintain and support the below listed endpoints and features. - -We will publish guidance for each of the below scenarios on how to transition your applications to standards-based protocols. If we need to make security enhancements to any of these legacy endpoints which would require more urgency, we will promptly announce timeframes and guidelines for any required changes. - -### Resource Owner support for oauth/token endpoint - -Support was introduced for [Resource Owner Password](/api/authentication#resource-owner-password) to the [/oauth/token](/api/authentication#authorization-code) endpoint earlier this year. - -#### Am I affected by the change? - -If you are currently implementing the [/oauth/ro](/api/authentication#resource-owner) endpoint your application can be updated to use the [/oauth/token](/api/authentication#authorization-code) endpoint. For details on how to make this transition, see the [Migration Guide for Resource Owner Password Credentials Exchange](/migrations/guides/migration-oauthro-oauthtoken). - -If you have any questions, create a ticket in our [Support Center](${env.DOMAIN_URL_SUPPORT}). - -### API authorization with third-party vendor APIs - -The mechanism by which you get tokens for third-party / vendor APIs (for example AWS, Firebase, and others) is being changed. It will work the same as any custom API, providing better consistency. This new architecture will be available in 2018 and once it becomes available, the [/delegation](/api/authentication#delegation) endpoint will be officially deprecated. - -#### Am I affected by the change? - -If you are currently using [/delegation](/api/authentication#delegation) to provide third party authorization, your application will need to be updated once migration guides are available. - -If you have any questions, create a ticket in our [Support Center](${env.DOMAIN_URL_SUPPORT}). - -### Improved OpenID Connect interoperability in Auth0 - -The [userinfo](/api/authentication#get-user-info) endpoint is being updated to return [OIDC conformant user profile attributes](/user-profile/normalized/oidc). The most notable change is that `user_id` becomes `sub`. This will deprecate the [legacy Auth0 user profile](/user-profile/normalized/auth0) (in [userinfo](/api/authentication#get-user-info) and in [ID Tokens](/tokens/id-token)). - -#### Am I affected by the change? - -If you are currently using the [/userinfo](/api/authentication#get-user-info) endpoint or receiving ID Tokens, you are affected by this change and need to update your implementation so that it expects normalized OIDC conformant user profile attributes once migration guides are available. - -If you have any questions, create a ticket in our [Support Center](${env.DOMAIN_URL_SUPPORT}). diff --git a/articles/migrations/past-migrations.md b/articles/migrations/past-migrations.md index 4de191406b..5956128735 100644 --- a/articles/migrations/past-migrations.md +++ b/articles/migrations/past-migrations.md @@ -12,6 +12,28 @@ useCase: These are migrations that have already been enabled for all customers. +## Introducing Lock v11 and Auth0.js v9 + +| Severity | Grace Period Start | Mandatory Opt-In| +| --- | --- | --- | +| Medium | 2017-12-21 | 2018-08-06 | + +We are continually improving the security of our service. As part of this effort, we have deprecated the Legacy Lock API, which consists of the /usernamepassword/login and /ssodata endpoints. These endpoints are used by Lock.js v8, v9, and v10 and Auth0.js, v6, v7, and v8, and can also be called directly from applications. + +As of August 6, 2018, Auth0 has permanently disabled the Legacy Lock API. This removal of service fully mitigates the CSRF vulnerability disclosed in April 2018. This also ends the soft removal grace period that was [first announced on July 16, 2018](https://community.auth0.com/t/auth0-legacy-lock-api-disabled-grace-period-available/12949), meaning the Legacy Lock API can no longer be re-enabled. + +If your Legacy Lock API migration has not yet been completed, your users may experience an outage, failed logins, or other adverse effects. You will need to complete your migration in order to restore normal functionality. See [Check Deprecation Errors](/troubleshoot/guides/check-deprecation-errors) to identify the source(s) of any errors in your tenant logs related to deprecations. + +### Am I affected by the change? + +If you are currently implementing login in your application with Lock v8, v9, or v10, or Auth0.js v6, v7, or v8, you are affected by these changes. Additionally, you are affected if your application calls the /usernamepassword/login or /ssodata endpoints directly via the API. + +We **recommend** that applications using [Universal Login](/universal-login) update the library versions they use inside of the login page. + +However, those who are using Lock or Auth0.js embedded within their applications, or are calling the affected API endpoints directly, are **required** to update, and applications which still use deprecated endpoints will cease to function properly after the removal of service date. + +Libraries and SDKs not explicitly named here are not affected by this migration. + ## New IP Addresses for Whitelisting in Australia | Severity | Grace Period Start | Mandatory Opt-In| @@ -58,7 +80,7 @@ The existing Auth0 CDN service is one of our older services. It was been built a ### Am I using the CDN? -If you use Lock (hosted by our CDN) in Europe or Australia, yes. +If you use Lock (hosted by our CDN) in Europe or Australia, yes. ### Do I need to do something? @@ -109,11 +131,11 @@ Even if you are not using Lock, the vulnerable reset flow can be accessed direct | --- | --- | --- | | Medium | 2017-01-03 | 2017-03-01 | -As part of Auth0's efforts to improve security and standards compliance, we will stop supporting account linking as part of the authorization callback (that is, accepting an [Access Token](/tokens/access-token) as part of the [authorize](/api/authentication#authorization-code-grant) call as stated [in the account linking section](/api/authentication?http#account-linking). +As part of Auth0's efforts to improve security and standards compliance, we will stop supporting account linking as part of the authorization callback (that is, accepting an Access Token as part of the [authorize](/api/authentication#authorization-code-grant) call as stated [in the account linking section](/api/authentication?http#account-linking). ### Am I affected by the change? -If you received an email notification about it, then you are impacted by this change. As you work to update your applications to [use the Management API to link accounts](/api/management/v2#!/Users/post_identities), you can check if you are still impacted, by checking your tenant logs for warnings indicating _"Account linking via /authorize is being deprecated. Please refer to https://auth0.com/docs/link-accounts for supported ways to link an account."_. These entries will be logged if you are sending an Access Token in your [authorize](/api/authentication#authorization-code-grant) calls. +If you received an email notification about it, then you are impacted by this change. As you work to update your applications to [use the Management API to link accounts](/api/management/v2#!/Users/post_identities), you can check if you are still impacted, by checking your tenant logs for warnings indicating _"Account linking via /authorize is being deprecated. See [User Account Linking](/users/concepts/overview-user-account-linking) for supported ways to link an account."_. These entries will be logged if you are sending an Access Token in your [authorize](/api/authentication#authorization-code-grant) calls. If you need help with the migration, create a ticket in our [Support Center](${env.DOMAIN_URL_SUPPORT}) @@ -123,7 +145,7 @@ If you need help with the migration, create a ticket in our [Support Center](${e | --- | --- | --- | | Medium | 2017-02-23 | 2017-05-31 | -As part of Auth0's efforts to improve security, we recently added the ability to execute rules during the OAuth 2.0 Resource Owner Password Grant exchange (the password exchange) and the Refresh Token exchange. +As part of Auth0's efforts to improve security, we recently added the ability to execute rules during the OAuth 2.0 Resource Owner Password Grant exchange (the password exchange) and the Refresh Token exchange. You are using this feature if you are calling the [/oauth/token](/api/authentication#authorization-code) endpoint of our Authentication API with `grant_type = "password"` , `grant_type = "http://auth0.com/oauth/grant-type/password-realm"`, or `grant_type = "refresh_token"`. @@ -177,7 +199,7 @@ You can use [jwt.io](https://jwt.io/) to decode the token to confirm the `iss` a The format of the user profile JSON object (ID Token) that is returned by Auth0 Authentication APIs has been changed to remove the Identity Provider's Access Token, which had been included in the user profile `identities` array. -Now, to obtain a user's IdP Access Token, you will need to make an HTTP GET call to the `/api/v2/users/{user-id}` endpoint containing an API token generated with `read:user_idp_tokens` scope. +Now, to obtain a user's IdP Access Token, you will need to make an HTTP GET call to the `/api/v2/users/{user-id}` endpoint containing an API token generated with `read:user_idp_tokens` scope. ::: note You will still have access to the Identity Provider Access Token in the `user` argument in Auth0 [rules](/rules). @@ -187,7 +209,7 @@ You will still have access to the Identity Provider Access Token in the `user` a You are affected by the change only if you are using the Identity Provider Access Token (`identities[0].access_token` in the user profile) outside of rules to call other services from the Identity Provider (such as Facebook Graph API, Google APIs, and so on). -For more information on how to obtain an Access Token, see: [Call an Identity Provider API](/what-to-do-once-the-user-is-logged-in/calling-an-external-idp-api) and [Identity Provider Access Token](/tokens/idp). +For more information on how to obtain an Access Token, see: [Call an Identity Provider API](/what-to-do-once-the-user-is-logged-in/calling-an-external-idp-api) and [Identity Provider Access Tokens](/tokens/overview-idp-access-tokens). ::: note If your tenant was created after the change, this update will be applied automatically. diff --git a/articles/monitoring/_includes/_monitor-private-cloud.md b/articles/monitoring/_includes/_monitor-private-cloud.md new file mode 100644 index 0000000000..a0dc01777f --- /dev/null +++ b/articles/monitoring/_includes/_monitor-private-cloud.md @@ -0,0 +1,3 @@ +::: panel Monitor a dedicated deployment +See the [Private Cloud](/private-cloud) documentation for information on [monitoring](/appliance/monitoring) a dedicated deployment. +::: \ No newline at end of file diff --git a/articles/monitoring/guides/check-external-services.md b/articles/monitoring/guides/check-external-services.md new file mode 100644 index 0000000000..3dfbf87d5f --- /dev/null +++ b/articles/monitoring/guides/check-external-services.md @@ -0,0 +1,46 @@ +--- +title: Check External Services Status +description: Learn how to check the status of services external to Auth0. +topics: + - monitoring +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - integrate-analytics +--- + +# Check External Services Status + +You may want to monitor any remote identity providers you use with your Auth0 connections to quickly isolate the source of the problem. + +If you see potential issues with your Auth0 service, but [Auth0 Status](https://status.auth0.com) doesn't indicate any problems, check the status of any external services that you use with Auth0, such as: + +* [Amazon Web Services](https://status.aws.amazon.com/) +* [Azure Active Directory](https://azure.microsoft.com/en-us/status/) +* [Citrix](https://status.cloud.com/) +* [Facebook](https://developers.facebook.com/status/) +* [GitHub](https://status.github.com/) +* [Google Cloud](https://status.cloud.google.com/) +* [Google's G Suite](https://www.google.com/appsstatus#hl=en&v=status) +* [Heroku](https://status.heroku.com/) +* [IBM](https://console.bluemix.net/status) +* [Mandrill](http://status.mandrillapp.com/) +* [Microsoft Azure](https://azure.microsoft.com/en-gb/status/) +* [SAP](https://www.sap.com/about/cloud-trust-center/cloud-service-status.html) +* [SendGrid](http://status.sendgrid.com/) +* [SFDC](https://status.salesforce.com/) +* [Slack](https://status.slack.com/) +* [Twilio](https://status.twilio.com/) +* [VM Ware](https://status.vmware-services.io/) + +::: note +Your customers may have some of the same concerns, so you may want to document any monitoring pages or endpoints that they can view to help them troubleshoot and narrow down the location of an issue. +::: + +## Keep reading + +* [Check Auth0 Status](/monitoring/guides/check-status) +* [Monitor Auth0 Using System Center Operations Manager](/monitoring/guides/monitor-using-SCOM) +* [Monitor Applications](/monitoring/guides/monitor-applications) diff --git a/articles/monitoring/guides/check-status.md b/articles/monitoring/guides/check-status.md new file mode 100644 index 0000000000..98f4181a57 --- /dev/null +++ b/articles/monitoring/guides/check-status.md @@ -0,0 +1,44 @@ +--- +title: Check Auth0 Status +description: Learn how to check Auth0 public cloud service availability, incident reports, and historical uptime reports. +topics: + - monitoring +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - integrate-analytics +--- + +# Check Auth0 Status + +Auth0 makes every effort to minimize outages, but if there is any disruption to service, it will appear on the [Auth0 Status](https://status.auth0.com) page. To support requirements for root cause analysis documentation after a disruption, Auth0 conducts internal analysis and publishes the results of the disruption notice. If there's an outage listed on the status page, you do not need to file a ticket. Auth0 is already working on the issue. + +## Check status + +Go to [Auth0 Status](https://status.auth0.com) to check the service availability of the cloud version of Auth0. + +You can see the status of a region or expand a region and see the status of individual services supporting functionality such as the authentication API or execution of custom code (used within custom DB connections and rules). + +## Subscribe to status updates + +On the [Auth0 Status](https://status.auth0.com) page, choose your region and environment and click **Subscribe to Updates** to get updates. You can choose from two options to view status: + +* Follow [@auth0status](https://twitter.com/auth0status) on Twitter to get the latest status updates. + +* Subscribe to the Auth0 Atom feed to get status updates that affect your tenant. Using an RSS feed aggregator of your choice (such as https://feeder.co/reader), use the following RSS feed URL to view the status of your tenant. Replace `YOUR-TENANT` with your tenant name. + + `status.auth0.com/feed?domain={YOUR-TENANT}.auth0.com` + +## Historical uptime reports + +Current and historical Auth0 uptime reports are available at [Auth0 Uptime](http://uptime.auth0.com). + +## Keep reading + +* [Check External Services Status](/monitoring/guides/check-external-services) +* [Monitor Auth0 Using System Center Operations Manager](/monitoring/guides/monitor-using-SCOM) +* [Monitor Applications](/monitoring/guides/monitor-applications) +* [Troubleshooting](/troubleshoot) +* [Support Options](/support) diff --git a/articles/monitoring/guides/monitor-applications.md b/articles/monitoring/guides/monitor-applications.md new file mode 100644 index 0000000000..f84e4eb665 --- /dev/null +++ b/articles/monitoring/guides/monitor-applications.md @@ -0,0 +1,32 @@ +--- +title: Monitor Applications +description: Learn how to monitor your own applications and perform end-to-end testing using your own tests. +topics: + - monitoring +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - integrate-analytics + - synthetic-authentication + - synthetic-transactions +--- +# Monitor Applications + +If you would like to monitor your own [application](/applications) or conduct end-to-end testing, you’ll need to set up your own tests. + +If you've extended Auth0 through [rules](/rules) or a [custom database connection](/connections/database/custom-db), you can build a synthetic transaction that exercises these capabilities using the [Resource Owner Password Grant](/api-auth/tutorials/password-grant). One way of doing this is to [Monitor Auth0 Using SCOM](/monitoring/guides/monitor-using-SCOM). + +Auth0 recommends using an authentication flow that doesn't require a user interface such as the **Resource Owner Password Grant**. That way, you can use a monitoring tool that doesn't have to mimick the actions of a user. Many monitoring services exist with this capability including: + +* [New Relic](http://newrelic.com) +* [Pingdom](http://pingdom.com) + +Use one of these services to execute synthetic authentication requests. + +## Keep reading + +* [Check Auth0 Status](/monitoring/guides/check-status) +* [Check External Services Status](/monitoring/guides/check-external-services) +* [Monitor Auth0 Using System Center Operations Manager](/monitoring/guides/monitor-using-SCOM) diff --git a/articles/monitoring/guides/monitor-using-SCOM.md b/articles/monitoring/guides/monitor-using-SCOM.md new file mode 100644 index 0000000000..97918bb43f --- /dev/null +++ b/articles/monitoring/guides/monitor-using-SCOM.md @@ -0,0 +1,80 @@ +--- +title: Monitor Auth0 Using System Center Operations Manager +description: Learn how to monitor Auth0 as a standard web application using System Center Operations Manager (SCOM) or any tool that supports synthetic transactions. +toc: true +topics: + - monitoring +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - integrate-analytics + - synthetic-authentication + - synthetic-transactions +--- +# Monitor Auth0 Using System Center Operations Manager + +You can monitor Auth0 as a standard web application using System Center Operations Manager (SCOM) or any tool that supports synthetic transactions. + +We recommend monitoring a synthetic login transaction that includes the extensions your applications rely on (such as rules that execute custom code for integration with your company's other services). + +## Set up SCOM + +1. Add a new SCOM instance using the **Add Monitoring Wizard**: + + | **Field** | **Description** | + | ---| ---| + | **Name** | Description name for the SCOM instance. | + | **Description** | Description of what this SCOM instance monitors. | + | **Select destination management pack** | Default Management Pack | + + When finished, click **Next** to continue. + + ![ss-2014-11-21T15-44-34.png](/media/articles/monitoring/ss-2014-11-21T15-44-34.png) + +2. Click **Add** to enter the URLs you want SCOM to monitor. When finished, click **Next** to continue. + + ![ss-2014-11-21T16-31-15.png](/media/articles/monitoring/ss-2014-11-21T16-31-15.png) + +3. Click **Add** to set up a location from which you want to monitor. + + In the pop-up dialog, search for **Internal location - Agent**. Select the appropriate address, and click **Add**. Then click **Ok** to finish selecting the location. When finished, click **Next** to continue. + + ![ss-2014-11-21T16-32-25.png](/media/articles/monitoring/ss-2014-11-21T16-32-25.png) + +4. Set the frequency with which SCOM collects data from each endpoint: + + | **Data** | **Frequency** | + | --- | --- | + | **Test frequency** | 60 seconds | + | **Performance data collection interval** | 60 seconds | + | **Test time-out** | 30 seconds | + | **HTTP status code** | Greater than or equals 400 | + + When finished, click **Next** to continue. + + ![ss-2014-11-21T16-33-51.png](/media/articles/monitoring/ss-2014-11-21T16-33-51.png) + +## Run SCOM tests + +1. Click **Run Test** to test each endpoint and ensure that the connection settings provided are correct. + + ![ss-2014-11-21T16-34-25.png](/media/articles/monitoring/ss-2014-11-21T16-34-25.png) + +2. Once you have finished configuring your SCOM instance, you can view activity through the **Monitoring** tab: + + ![ss-2014-11-25T17-20-47.png](/media/articles/monitoring/ss-2014-11-25T17-20-47.png) + +## Review test results + +Click **Web Application Status** to bring up the information SCOM has gathered. + +![ss-2014-11-25T17-22-10.png](/media/articles/monitoring/ss-2014-11-25T17-22-10.png) + +## Keep reading + +* [Monitoring the AD/LDAP Connector with System Center Operations Manager](/connector/scom-monitoring) +* [Check Auth0 Status](/monitoring/guides/check-status) +* [Check External Services Status](/monitoring/guides/check-external-services) +* [Monitor Applications](/monitoring/guides/monitor-applications) diff --git a/articles/monitoring/guides/send-events-to-keenio.md b/articles/monitoring/guides/send-events-to-keenio.md new file mode 100644 index 0000000000..22fc43d835 --- /dev/null +++ b/articles/monitoring/guides/send-events-to-keenio.md @@ -0,0 +1,77 @@ +--- +title: Send Logging Events to Keen +description: Learn how to send logging events to Keen from Auth0. +topics: + - monitoring + - keenio +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - analyze-external-analytics + - integrate-analytics +--- +# Send Logging Events to Keen + +[Keen](http://keen.io) provides a service to capture and analyze events generated in your apps. In their words: + +> Analytics transforms data into answers – the kind of answers every company deserves. Unfortunately, a lot of companies a) can't find an analytics service that's right for their specific needs, and b) don't have the resources to develop their own analytics infrastructure. That's why we started Keen IO. Basically, we built it, so you don't have to. And we made it powerful, flexible, and scalable enough that you can use it however you need to – even if those needs change over time. + +In this example, you will learn how to connect Auth0 to Keen and stream `signup` events. To implement this with Auth0, you just need to create one [Rule](/rule) in your pipeline. + +![Keen IO Dataflow](/media/articles/tutorials/keen-io-dataflow.png) + +## Record a sign-up event in Keen + +Create a rule that will record user `signup` events for your apps in Keen. Please note: + +* In this example, we expect your Keen credentials to be stored in the [global `configuration` object](/rules/current#use-the-configuration-object). Be sure to add your **Write Key** here before running your rule. Doing this allows you to use your key in multiple rules and prevents you from having to store it directly in the code. + +* For this rule, we send contextual information, such as IP address (can be used to deduce location), user ID, and username. However, you can send any number of properties. + +* For this rule, we track the event type using a __persistent__ property called `user.signedUp`. When the property is set to `true`, we return immediately. Otherwise, we assume the event is a new `signup`, and if everything goes well, we set the property to `true`. The next time the user signs in, this rule will be skipped. + + +```js +function(user, context, callback) { + + var request = require('request'); + + if(user.signedUp){ + return callback(null, user, context); + } + + var writeKey = configuration.KEENIO_WRITE_KEY; + var projectId = configuration.KEENIO_PROJECT_ID; + var eventCollection = 'signups'; + + var keenEvent = { + userId: user.user_id, + name: user.name, + ip: context.request.ip //Potentially any other properties in the user profile/context + }; + + request.post({ + method: 'POST', + url: 'https://api.keen.io/3.0/projects/' + projectId + '/events/' + eventCollection, + headers: { + "Authorization: " + writeKey, + 'Content-type': 'application/json' + }, + body: JSON.stringify(keenEvent), + }, + function (e, r, body) { + if( e ) return callback(e,user,context); + //We assume everything went well + user.persistent.signedUp = true; + return callback(null, user, context); + }); +} +``` + +## Keep reading +Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: + +* Rules for access control +* Integration with other services: [MixPanel](http://mixpanel.com), [Firebase](http://firebase.com), [TowerData](https://www.towerdata.com/email-intelligence/email-enhancement), [Parse](http://parse.com), [Splunk](https://www.splunk.com), [Segment](https://segment.com/) diff --git a/articles/monitoring/guides/send-events-to-segmentio.md b/articles/monitoring/guides/send-events-to-segmentio.md new file mode 100644 index 0000000000..51f8030308 --- /dev/null +++ b/articles/monitoring/guides/send-events-to-segmentio.md @@ -0,0 +1,90 @@ +--- +title: Send Logging Events to Segment +description: Learn how to send logging events to Segment from Auth0. +topics: + - monitoring + - segmentio +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - analyze-external-analytics + - integrate-analytics +--- +# Send Logging Events to Segment + +[Segment](https://segment.com/) provides a large number of analytics-related functionality with a single, simple to use API. + +In this example, you will learn how to connect Auth0 to Segment and stream `signup` and `login` events. To implement this with Auth0, you just need to create one [Rule](/rule) in your pipeline. + +![Segment Flow](/media/articles/monitoring/segment/segment-io-dataflow.png) + +You'll be using [Segment's Node.js library](https://github.com/segmentio/analytics-node) to record Auth0 data. + +## 1. Find your Segment Write Key + +To configure this integration, you'll need your Segment **Write Key**. You can find this under Segment's **Settings** > **API**. + +![Segment API Keys](/media/articles/monitoring/segment/segment-3.png) + +## 2. Record sign-up and log-in events in Segment + +Create a rule to record user `signup` and `login` events for your apps and send the information to Segment using Segment's Node.js library. + +In this example, we expect your Segment credentials to be stored in the [global `configuration` object](/rules/current#use-the-configuration-object). Be sure to add your **Write Key** here before running your rule. Doing this allows you to use your key in multiple rules and prevents you from having to store it directly in the code. + + +```js +function(user, context, callback) { + var Analytics = require('analytics-node'); + var analytics = new Analytics(configuration.WRITE_KEY, { flushAt: 1 }); + + // Note: Set { flushAt: 1 } and use analytics.flush to ensure + // the data is sent to Segment before the rule/Webtask terminates + + // Identify your user + analytics.identify({ + userId: user.user_id, + traits: { + email: user.email, + signed_up: user.created_at, + login_count: user.logins_count + }, + "context": { + "userAgent": context.request.UserAgent, + "ip": context.request.ip + } + }); + analytics.track({ + userId: user.user_id, + event: 'Logged In', + properties: { + clientName: context.clientName, + clientID: context.clientID, + connection: context.connection + }, + "context": { + "userAgent": context.request.UserAgent, + "ip": context.request.ip + } + }); + analytics.flush(function(err, batch){ + callback(null, user, context); + }); +} +``` + +## 3. Check your integration + +See if your integration works by checking the Segment Debugger to see if your Auth0 events are appearing. + +![Segment Debugger](/media/articles/monitoring/segment/segment-14.png) + + +## Keep reading + +Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: + +* Rules for access control +* Integration with other services: [MixPanel](http://mixpanel.com), [Firebase](http://firebase.com), [TowerData](https://www.towerdata.com/email-intelligence/email-enhancement), [Parse](http://parse.com), [Splunk](https://www.splunk.com), [Keen](https://keen.io/) diff --git a/articles/monitoring/guides/send-events-to-splunk.md b/articles/monitoring/guides/send-events-to-splunk.md new file mode 100644 index 0000000000..a805b82ebe --- /dev/null +++ b/articles/monitoring/guides/send-events-to-splunk.md @@ -0,0 +1,88 @@ +--- +title: Export Logs to Splunk Using Rules +description: Learn how to send logging events to Splunk from Auth0 using rules. +topics: + - monitoring + - splunk +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - analyze-external-analytics + - integrate-analytics +--- +# Export Logs to Splunk Using Rules + +[Splunk](http://splunk.com) provides a platform that allows you to easily get insights into all the information generated by your IT infrastructure. + +In this example, you will learn how to connect Auth0 to Splunk and stream `signup` and `login` events with user contextual information. To implement this with Auth0, you just need to create one [Rule](/rule) in your pipeline. + +![](/media/articles/tutorials/splunk-dataflow.png) + +## Record sign-up or log-in event in Splunk + +Create a rule that will record user `signup` and `login` events for your apps using the [Splunk REST API](http://dev.splunk.com/view/rest-api-overview/SP-CAAADP8). When enabled, this rule will send events that will then show on Splunk's dashboard: + +![](/media/articles/scenarios/splunk/splunk-dashbaord.png) + + +Please note: + +* Splunk's API supports basic & token-based auth. In this example, we use token-based auth and expect your Splunk credentials to be stored in the [global `configuration` object](/rules/current#use-the-configuration-object). Be sure to add your token here before running your rule. Doing this allows you to use your token in multiple rules and prevents you from having to store it directly in the code. + +* For this rule, we send contextual information, such as IP address (can be used to deduce location), application name, and username. However, you can send any number of properties. + +* For this rule, we track the event type using a property called `user.app_metadata.signedUp`. When the property is set to `true`, we assume the event is a `login`. Otherwise, we assume the event is a new `signup`, and if everything goes well, we set it to `true`. Thus, the next time the user logs in, the event will be recorded as a `login`. + + +```js +function (user, context, callback) { + const request = require('request'); + + user.app_metadata = user.app_metadata || {}; + const endpoint = 'https://http-inputs-mysplunkcloud.example.com:443/services/collector'; // replace with your Splunk HEC endpoint; + + //Add any interesting info to the event + const hec_event = { + event: { + message: user.app_metadata.signedUp ? 'Login' : 'Signup', + application: context.clientName, + clientIP: context.request.ip, + protocol: context.protocol, + userName: user.name, + userId: user.user_id + }, + source: 'auth0', + sourcetype: 'auth0_activity' + }; + + request.post({ + url: endpoint, + headers: { + 'Authorization': 'Splunk ' + configuration.SPLUNK_HEC_TOKEN + }, + strictSSL: true, // set to false if using a self-signed cert + json: hec_event + }, function(error, response, body) { + if (error) return callback(error); + if (response.statusCode !== 200) return callback(new Error('Invalid operation')); + user.app_metadata.signedUp = true; + auth0.users.updateAppMetadata(user.user_id, user.app_metadata) + .then(function () { + callback(null, user, context); + }) + .catch(function (err) { + callback(err); + }); + }); + +} +``` + +## Keep reading + +Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: + +* Rules for access control +* Integration with other services: [MixPanel](http://mixpanel.com), [Firebase](http://firebase.com), [TowerData](https://www.towerdata.com/email-intelligence/email-enhancement), [Parse](http://parse.com), [Segment](https://segment.com/), [Keen](https://keen.io/) diff --git a/articles/monitoring/guides/test-testall-endpoints.md b/articles/monitoring/guides/test-testall-endpoints.md new file mode 100644 index 0000000000..df71f9c74d --- /dev/null +++ b/articles/monitoring/guides/test-testall-endpoints.md @@ -0,0 +1,69 @@ +--- +title: Check Auth0 Authentication and Supporting Services +description: Learn how check the status of the Auth0 authentication service as well as supporting services such as the Dashboard and documentation using the test and testall endpoints. +public: false +topics: + - monitoring +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - integrate-analytics + - synthetic-authentication + - synthetic-transactions +--- +# Check Auth0 Authentication and Supporting Services + +::: warning +The `/test` and `/testall` endpoints are best for determining if everything is functioning but *not* for determining if something is down. They do not provide a complete status picture. +::: + +Use the `/test` and `/testall` endpoints as a supplement to your other monitoring. You should use synthetic transactions against a test account to ensure that everything is functional. You should also track your own logs and other metrics to calls to Auth0 from servers and/or clients. + +## Test endpoint + +The `/test` endpoint checks the status of the core Auth0 authentication service. + +Here is an example of a call to the `/test` endpoint: + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/test" +} +``` + +If the service is up, the endpoint returns a `200` HTTP response code; if it is not, it returns a `5xx` response code. + +Additionally, this endpoint returns a JSON object: + +```json +{ + "clock": 1417220191640 +} +``` + +## Testall endpoint + +The `/testall` endpoint checks the status of the core Auth0 authentication service, as well as supporting services such as those for the [Dashboard](${manage_url}) and documentation. + +Here is an example call to the `/testall` endpoint: + +```har +{ + "method": "GET", + "url": "https://${account.namespace}/testall" +} +``` + +If all services are up, the endpoint returns the `200` HTTP response code and a simple text message of `OK`. If any service is down, it returns a `5xx` response code. + +<%= include('../_includes/_monitor-private-cloud.md') %> + +## Keep reading + +* [Check Auth0 Status](/monitoring/guides/check-status) +* [Check External Services Status](/monitoring/guides/check-external-services) +* [Monitor Auth0 Using System Center Operations Manager](/monitoring/guides/monitor-using-SCOM) +* [Monitor Applications](/monitoring/guides/monitor-applications) diff --git a/articles/monitoring/guides/track-leads-salesforce.md b/articles/monitoring/guides/track-leads-salesforce.md new file mode 100644 index 0000000000..0c277f7219 --- /dev/null +++ b/articles/monitoring/guides/track-leads-salesforce.md @@ -0,0 +1,186 @@ +--- +title: Track New Leads in Salesforce +description: Learn how to track new leads in Salesforce and augment user profiles with public information gathered from TowerData. +topics: + - monitoring + - marketing + - salesforce + - towerdata +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - analyze-external-analytics + - integrate-analytics +--- + +# Track New Leads in Salesforce + +You can track new leads in Salesforce with TowerData-Enriched User Profiles. + +Whenever a new user signs up with a website using any social credential we want to: + +1. __Augment the user profile__ with additional public information obtained through [TowerData](https://www.towerdata.com/email-intelligence/email-enhancement). + +2. __Record the sign-up as a New Lead__ on [Salesforce](http://www.salesforce.com/), so a sales professional can follow up. + +To implement this with Auth0, you just need to create two [Rules](/rules) in your pipeline: + +![](/media/articles/tutorials/rapleaf-salesforce.png) + +## 1. Enrich User Profile with TowerData + +Create a rule that will obtain more information about the user by retrieving public information from TowerData's API using the user's email address as input. + +Once the call to TowerData completes, we store this additional information in a property called `towerdata`: + +:::note +We ignore certain conditions that exist in the API and only do this when there's a successful call (`statusCode=200`). This rule will also be skipped if the user has already signed up, which is signaled by the `user.app_metadata.recordedAsLead` property being set to true (see step 2). +::: + +```js +function (user, context, callback) { + + //Filter by app + //if(context.clientName !== 'AN APP') return callback(null, user, context); + + var request = require('request'); + + if (!user.email || !user.email_verified) { + return callback(null, user, context); + } + + request.get('https://api.towerdata.com/v5/td', { + qs: { + email: user.email, + api_key: configuration.TOWERDATA_API_KEY + }, + json: true + }, + (err, response, body) => { + if (err) return callback(err); + + if (response.statusCode === 200) { + context.idToken['https://example.com/towerdata'] = body; + } + + return callback(null, user, context); + }); +} +``` + +## 2. Create New Lead in Salesforce + +Create a rule that will record the information as a __New Lead__ in Salesforce, so the sales department can follow up. Please note: + +* The Salesforce REST API uses an OAuth Access Token. So for this rule, we use the OAuth2 `Resource Owner Password Credential Grant` to obtain this token, and use the `getToken` function, which uses credentials as input, as opposed to an `API-KEY` as was used in the rule in the previous step. + +* In this example, we expect your Salesforce credentials to be stored in the [global `configuration` object](/rules/current#use-the-configuration-object). Be sure to add your credentials here before running your rule. Doing this allows you to use your credentials in multiple rules and prevents you from having to store them directly in the code. + +* For this rule, we record only the username and a fixed company name. However, we could use anything available in the enriched user profile we obtained in step 1 to record more information and provide additional context for the sales representative. + +* For this rule, we use a property called `user.app_metadata.recordedAsLead`, and if everything goes well, we set it to `true`. The next time the user signs in, this rule will be skipped. + +```js +function (user, context, callback) { + + const request = require('request'); + + user.app_metadata = user.app_metadata || {}; + if (user.app_metadata.recordedAsLead) { + return callback(null,user,context); + } + + const MY_SLACK_WEBHOOK_URL = 'YOUR SLACK WEBHOOK URL'; + const slack = require('slack-notify')(MY_SLACK_WEBHOOK_URL); + + //Populate the variables below with appropriate values + const SFCOM_CLIENT_ID = configuration.SALESFORCE_CLIENT_ID; + const SFCOM_CLIENT_SECRET = configuration.SALESFORCE_CLIENT_SECRET; + const USERNAME = configuration.SALESFORCE_USERNAME; + const PASSWORD = configuration.SALESFORCE_PASSWORD; + getAccessToken( + SFCOM_CLIENT_ID, + SFCOM_CLIENT_SECRET, + USERNAME, + PASSWORD, + (response) => { + if (!response.instance_url || !response.access_token) { + slack.alert({ + channel: '#some_channel', + text: 'Error Getting SALESFORCE Access Token', + fields: { + error: response + } + }); + + return; + } + + createLead( + response.instance_url, + response.access_token, + (err, result) => { + if (err || !result || !result.id) { + slack.alert({ + channel: '#some_channel', + text: 'Error Creating SALESFORCE Lead', + fields: { + error: err || result + } + }); + + return; + } + + user.app_metadata.recordedAsLead = true; + auth0.users.updateAppMetadata(user.user_id, user.app_metadata); + }); + }); + + //See http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_lead.htm + function createLead(url, access_token, callback){ + //Can use many more fields + const data = { + LastName: user.name, + Company: 'Web channel signups' + }; + + request.post({ + url: url + "/services/data/v20.0/sobjects/Lead", + headers: { + "Authorization": "OAuth " + access_token + }, + json: data + }, (err, response, body) => { + return callback(err, body); + }); + } + + //Obtains a SFCOM access_token with user credentials + function getAccessToken(client_id, client_secret, username, password, callback) { + request.post({ + url: 'https://login.salesforce.com/services/oauth2/token', + form: { + grant_type: 'password', + client_id: client_id, + client_secret: client_secret, + username: username, + password: password + }}, (err, respose, body) => { + return callback(JSON.parse(body)); + }); + } + + // don’t wait for the SF API call to finish, return right away (the request will continue on the sandbox)` + callback(null, user, context); +} +``` + +## Keep reading + +Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: + +* Rules for access control +* Integration with other services: [MixPanel](http://mixpanel.com), [Firebase](http://firebase.com), [Parse](http://parse.com), [Splunk](https://www.splunk.com/), [Segment](https://segment.com/), [Keen](https://keen.io/) diff --git a/articles/monitoring/guides/track-signups-salesforce.md b/articles/monitoring/guides/track-signups-salesforce.md new file mode 100644 index 0000000000..6120985e99 --- /dev/null +++ b/articles/monitoring/guides/track-signups-salesforce.md @@ -0,0 +1,238 @@ +--- +title: Track New Sign-Ups in Salesforce +description: Learn how to track your sign-ups in Salesforce MixPanel, enrich your user profiles with public information gathered from FullContact, and generate new sales leads. +topics: + - monitoring + - marketing +contentType: + - how-to +useCase: + - analyze-auth0-analytics + - analyze-logs + - analyze-external-analytics + - integrate-analytics +--- + +# Track New Sign-Ups in Salesforce + +You can track new sign-ups in Salesforce with FullContact-Enriched User Profiles, and Send Auth0 Events to MixPanel. + +Whenever a new user signs up with a website using a social credential, you want to: + +1. __Record a `signup` event__ in [MixPanel](https://mixpanel.com). +2. __Augment the user profile__ with additional public information through [FullContact](http://www.fullcontact.com/). +3. __Record the sign-up as a New Lead__ in [Salesforce](http://www.salesforce.com/), so a sales professional can follow up. + +To implement this with Auth0, you need to create three [Rules](/rules) in your pipeline: + +![](/media/articles/tutorials/signups.png) + +## 1. Record sign-up event in MixPanel + +Create a rule to record the event by calling MixPanel. In the example below, we record the application name in the `application` property to help you filter information in MixPanel. However, the full `context` and `user` properties are available as sources of additional information (e.g., IP addresses, agent). + +::: note +This rule will be skipped if the user has already signed up, which is signaled by the `user.app_metadata.recordedAsLead` property being set to true (see step 3). +::: + +```js +function (user, context, callback) { + + const request = require('request'); + + const mpEvent = { + "event": "Sign up", + "properties": { + "distinct_id": user.user_id, + "token": configuration.MIXPANEL_API_TOKEN, + "application": context.clientName + } + }; + + const base64Event = Buffer.from(JSON.stringify(mpEvent)).toString('base64'); + + request.get({ + url: 'http://api.mixpanel.com/track/', + qs: { + data: base64Event + } + }, (err, res, body) => { + // don’t wait for the MixPanel API call to finish, return right away (the request will continue on the sandbox)` + callback(null, user, context); + }); +} +``` + +## 2. Enrich user profile with FullContact + +Create a rule to obtain more information about the user by retrieving public information from FullContact's API using the user's email address as input. + +Once the call to FullContact completes, we store this additional information in a property called `fullContactInfo`: + +:::note +We ignore certain conditions that exist in the API and only do this when there's a successful call (`statusCode=200`). This rule will also be skipped if the user has already signed up, which is signaled by the `user.app_metadata.recordedAsLead` property being set to true (see step 3). +::: + +```js +function (user, context, callback) { + + const request = require('request'); + + const FULLCONTACT_KEY = configuration.FULLCONTACT_KEY; + const SLACK_HOOK = configuration.SLACK_HOOK_URL; + + const slack = require('slack-notify')(SLACK_HOOK); + + // skip if no email + if (!user.email) return callback(null, user, context); + + // skip if fullcontact metadata is already there + if (user.user_metadata && user.user_metadata.fullcontact) return callback(null, user, context); + + request.get('https://api.fullcontact.com/v2/person.json', { + qs: { + email: user.email, + apiKey: FULLCONTACT_KEY + }, + json: true + }, (error, response, body) => { + if (error || (response && response.statusCode !== 200)) { + + slack.alert({ + channel: '#slack_channel', + text: 'Fullcontact API Error', + fields: { + error: error ? error.toString() : (response ? response.statusCode + ' ' + body : '') + } + }); + + // swallow fullcontact api errors and just continue login + return callback(null, user, context); + } + + // if we reach here, it means fullcontact returned info and we'll add it to the metadata + user.user_metadata = user.user_metadata || {}; + user.user_metadata.fullcontact = body; + + auth0.users.updateUserMetadata(user.user_id, user.user_metadata); + context.idToken['https://example.com/fullcontact'] = user.user_metadata.fullcontact; + return callback(null, user, context); + }); +} +``` + +## 3. Create New Lead in Salesforce + +Create a rule to record the information as a New Lead in Salesforce, so the sales department can follow up. Please note: + +* The Salesforce REST API uses an OAuth Access Token. So for this rule, we use the OAuth2 `Resource Owner Password Credential Grant` to obtain this token, and use the `getToken` function, which uses credentials as input, as opposed to an `API-KEY` as was used in the rules in the previous steps. + +* In this example, we expect your Salesforce credentials to be stored in the [global `configuration` object](/rules/current#use-the-configuration-object). Be sure to add your credentials here before running your rule. Doing this allows you to use your credentials in multiple rules and prevents you from having to store them directly in the code. + +* For this rule, we record only the username and a fixed company name. However, we could use anything available in the enriched user profile we obtained in step 2 to record more information and provide additional context for the sales representative. + +* For this rule, we use a property called `user.app_metadata.recordedAsLead`, and if everything goes well, set it to true. The next time the user signs in, all of these rules will be skipped. + + +```js +function (user, context, callback) { + + const request = require('request'); + + user.app_metadata = user.app_metadata || {}; + if (user.app_metadata.recordedAsLead) { + return callback(null,user,context); + } + + const MY_SLACK_WEBHOOK_URL = 'YOUR SLACK WEBHOOK URL'; + const slack = require('slack-notify')(MY_SLACK_WEBHOOK_URL); + + //Populate the variables below with appropriate values + const SFCOM_CLIENT_ID = configuration.SALESFORCE_CLIENT_ID; + const SFCOM_CLIENT_SECRET = configuration.SALESFORCE_CLIENT_SECRET; + const USERNAME = configuration.SALESFORCE_USERNAME; + const PASSWORD = configuration.SALESFORCE_PASSWORD; + getAccessToken( + SFCOM_CLIENT_ID, + SFCOM_CLIENT_SECRET, + USERNAME, + PASSWORD, + (response) => { + if (!response.instance_url || !response.access_token) { + slack.alert({ + channel: '#some_channel', + text: 'Error Getting SALESFORCE Access Token', + fields: { + error: response + } + }); + + return; + } + + createLead( + response.instance_url, + response.access_token, + (err, result) => { + if (err || !result || !result.id) { + slack.alert({ + channel: '#some_channel', + text: 'Error Creating SALESFORCE Lead', + fields: { + error: err || result + } + }); + + return; + } + + user.app_metadata.recordedAsLead = true; + auth0.users.updateAppMetadata(user.user_id, user.app_metadata); + }); + }); + + //See http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_lead.htm + function createLead(url, access_token, callback){ + //Can use many more fields + const data = { + LastName: user.name, + Company: 'Web channel signups' + }; + + request.post({ + url: url + "/services/data/v20.0/sobjects/Lead", + headers: { + "Authorization": "OAuth " + access_token + }, + json: data + }, (err, response, body) => { + return callback(err, body); + }); + } + + //Obtains a SFCOM access_token with user credentials + function getAccessToken(client_id, client_secret, username, password, callback) { + request.post({ + url: 'https://login.salesforce.com/services/oauth2/token', + form: { + grant_type: 'password', + client_id: client_id, + client_secret: client_secret, + username: username, + password: password + }}, (err, respose, body) => { + return callback(JSON.parse(body)); + }); + } + + // don’t wait for the SF API call to finish, return right away (the request will continue on the sandbox)` + callback(null, user, context); +} +``` + +## Keep reading + +Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: + +* Rules for access control +* Integration with other services: [Firebase](http://firebase.com), [TowerData](https://www.towerdata.com/email-intelligence/email-enhancement), [Parse](http://parse.com), [Splunk](https://www.splunk.com/), [Segment](https://segment.com/), [Keen](https://keen.io/) diff --git a/articles/monitoring/how-to-monitor-auth0.md b/articles/monitoring/how-to-monitor-auth0.md deleted file mode 100644 index ac6ce7680d..0000000000 --- a/articles/monitoring/how-to-monitor-auth0.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -description: How to use monitoring with an Auth0 account. -toc: true -topics: - - monitoring -contentType: - - concept - - how-to -useCase: - - analyze-auth0-analytics - - analyze-logs - - integrate-analytics ---- - -# Monitor Auth0 - -If you are using the public cloud version of Auth0, we recommend subscribing to [Auth0 Status](http://status.auth0.com) for notifications regarding Auth0 service availability. The Auth0 DevOps team uses [Auth0 Status](http://status.auth0.com) for reports on current incidents. - -Current and historical uptime is available at [Auth0 Uptime](http://uptime.auth0.com). - -## Monitor your Auth0 account - -You can add Auth0 health probes to your monitoring infrastructure with the following endpoints: - -### The test endpoint - -The `test` endpoint checks the status of the core Auth0 authentication service. If the status is up, the endpoint returns a `200` status code; if is is not, it will return a `5xx` status code. - -```har -{ - "method": "GET", - "url": "https://${account.namespace}/test" -} -``` - -Additionally, this endpoint returns a JSON object: - -```json -{ - "clock": 1417220191640 -} -``` - -### The testall endpoint - -The `/testall` endpoint checks the status of the core Auth0 authentication service, as well as supporting services such as those for the [Dashboard](${manage_url}) and documentation. - -```har -{ - "method": "GET", - "url": "https://${account.namespace}/testall" -} -``` - -If all services are up, the endpoint returns the `200` HTTP response code and a simple text message saying, `OK`. If any service is down, the response code from `/testall` will be `5xx`. - -If you've extended Auth0 through [rules](/rules) or [a custom database connection](/connections/database/mysql), you can build a synthetic transaction that exercises these capabilities using the [Resource Owner Password Grant](/api-auth/tutorials/password-grant). - -We recommend using an authentication flow that doesn't require a user interface (such as the **Resource Owner Password Grant**) so that you don't have to use a monitoring tool that is capable of mimicking the actions of a user. Many monitoring tools exist using this approach, including: - -* [New Relic](http://newrelic.com) -* [Pingdom](http://pingdom.com) - -## Monitor external services - -If you are seeing potential issues with your Auth0 service, but the monitoring endpoints and the [Auth0 Status page](https://status.auth0.com) aren't indicating any problems, check the status of any external services that you use alongside Auth0. - -* [Amazon Web Services](https://status.aws.amazon.com/) -* [Azure Active Directory](https://azure.microsoft.com/en-us/status/) -* [Citrix](https://status.cloud.com/) -* [Facebook](https://developers.facebook.com/status/) -* [GitHub](https://status.github.com/) -* [Google Cloud](https://status.cloud.google.com/) -* [Google's G Suite](https://www.google.com/appsstatus#hl=en&v=status) -* [Heroku](https://status.heroku.com/) -* [IBM](https://console.bluemix.net/status) -* [Mandrill](http://status.mandrillapp.com/) -* [Microsoft Azure](https://azure.microsoft.com/en-gb/status/) -* [SAP](https://www.sap.com/about/cloud-trust-center/cloud-service-status.html) -* [SendGrid](http://status.sendgrid.com/) -* [SFDC](https://status.salesforce.com/) -* [Slack](https://status.slack.com/) -* [Twilio](https://status.twilio.com/) -* [VM Ware](https://status.vmware-services.io/) - -## Monitor a dedicated deployment - -Please see the [PSaaS Appliance](/appliance) pages for [information on monitoring a dedicated deployment](/appliance/monitoring). - -## Configure SCOM - -Auth0 can be monitored as a standard web application using System Center Operations Manager (SCOM) or any tool that supports synthetic transactions. - -We recommend adding SCOM probes for the `test` and `testall` endpoints, in addition to one for a synthetic login transaction that includes the extensions your applications rely on (such as rules that execute custom code for integration with your company's other services). - -To set up SCOM: - -1. Add a new SCOM instance using the **Add Monitoring Wizard**: - - * **Name**: a descriptive name for the SCOM instance - * **Description**: a description of what this SCOM instances monitors - * **Select destination management pack**: Default Management Pack - - ![ss-2014-11-21T15-44-34.png](/media/articles/monitoring/ss-2014-11-21T15-44-34.png) - - Click **Next** to continue. - -2. Click **Add** to enter the URLs you want SCOM to monitor. - - ![ss-2014-11-21T16-31-15.png](/media/articles/monitoring/ss-2014-11-21T16-31-15.png) - - Click **Next** to continue. - -3. You will be asked where you want to monitor from. Click **Add** to set up a location. In the pop-up dialog, search for **Internal location - Agent**. Select the appropriate address and click **Add**. Click **Ok** to finish selecting the location. - - ![ss-2014-11-21T16-32-25.png](/media/articles/monitoring/ss-2014-11-21T16-32-25.png) - - Click **Next** to continue. - -4. Set the frequency with which SCOM collects data from each endpoint: - - * **Test frequency**: 60 seconds - * **Performance data collection interval**: 60 seconds - * **Test time-out**: 30 seconds - - Additionally, under the *Alerts* section, **check** the box next to *HTTP status code* and set that to **Great than or equals 400**. - - ![ss-2014-11-21T16-33-51.png](/media/articles/monitoring/ss-2014-11-21T16-33-51.png) - - Click **Next** to continue. - -5. Click **Run Test** to test each endpoint and ensure that the connection settings provided are correct. - -![ss-2014-11-21T16-34-25.png](/media/articles/monitoring/ss-2014-11-21T16-34-25.png) - -Once you have finished configuring your SCOM instance, you can activity through the **Monitoring** tab: - -![ss-2014-11-25T17-20-47.png](/media/articles/monitoring/ss-2014-11-25T17-20-47.png) - -Click **Web Application Status** to bring up the information SCOM has gathered. - -![ss-2014-11-25T17-22-10.png](/media/articles/monitoring/ss-2014-11-25T17-22-10.png) diff --git a/articles/monitoring/index.md b/articles/monitoring/index.md index a409d831fe..7fd1ac6b73 100644 --- a/articles/monitoring/index.md +++ b/articles/monitoring/index.md @@ -1,48 +1,46 @@ --- -title: Monitoring Auth0 -description: Monitoring Your Auth0 Implementation -classes: topic-page +title: Monitor Auth0 Implementations +description: Understand how to monitor your Auth0 implementation and track your Auth0 usage, as well as how to send events and logs to external tools. topics: - monitoring contentType: + - concept - index useCase: - analyze-auth0-analytics - analyze-logs - integrate-analytics --- +# Monitor Auth0 Implementations -
    -
    -

    Monitor Your Auth0 Implementation

    -

    - Learn how to monitor your Auth0 implementation and track your Auth0 usage, as well as how to send logs to your choice of logging suite. -

    -
    - - \ No newline at end of file +You can monitor your Auth0 implementation and Auth0 status and services, as well as send logging event data to third-party tools. + +<%= include('./_includes/_monitor-private-cloud.md') %> + +## Check availability and status + +* [Check Auth0 Status](/monitoring/guides/check-status) +* [Check External Services Status](/monitoring/guides/check-external-services) +* [Monitor Auth0 Using System Center Operations Manager](/monitoring/guides/monitor-using-SCOM) +* [Monitor Applications](/monitoring/guides/monitor-applications) + +## Log events + +Need to analyze logs or store them long-term? Auth0 provides extensions to [export logs to external tools](/logs) for analysis and retention. You can also retrieve log data with the Management API. Auth0 only retains logs for a limited period of time, governed by the type of subscription purchased. If your required data retention period is longer than the retention period for your subscription,export logs so you can keep them as long as you wish. + +* [Administrator and Developer Log Usage Examples](/logs/concepts/logs-admins-devs) +* [Log Data Retention](/logs/references/log-data-retention) +* [View Log Data in the Dashboard](/logs/guides/view-log-data-dashboard) +* [Retrieve Logs Using the Management API](/logs/guides/retrieve-logs-mgmt-api) +* [Log Event Type Codes](/logs/references/log-event-type-codes) +* [Log Search Query Syntax](/logs/references/query-syntax) +* [Send Logging Events to Keen](/monitoring/guides/send-events-to-keenio) +* [Send Logging Events to Segment](/monitoring/guides/send-events-to-segmentio) +* [Send Logging Events to Splunk](/monitoring/guides/send-events-to-splunk) +* [Send Logging Events to Loggly](/extensions/loggly) +* [Send Logging Events to Mixpanel](/extensions/mixpanel) + +## Track new signups and leads + +* [Track New Sign-Ups in Salesforce](/monitoring/guides/track-signups-salesforce) +* [Track New Leads in Salesforce](/monitoring/guides/track-leads-salesforce) diff --git a/articles/monitoring/sending-events-to-keenio.md b/articles/monitoring/sending-events-to-keenio.md deleted file mode 100644 index e2922d9271..0000000000 --- a/articles/monitoring/sending-events-to-keenio.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -description: How to send events to Keen IO from Auth0. -topics: - - monitoring - - keenio -contentType: - - how-to -useCase: - - analyze-auth0-analytics - - analyze-logs - - analyze-external-analytics - - integrate-analytics ---- -# Sending events to Keen IO from Auth0 - -[Keen IO](http://keen.io) provides a service to capture and analyze events generated in your apps. In their words: - -> Analytics transforms data into answers – the kind of answers every company deserves. Unfortunately, a lot of companies a) can't find an analytics service that's right for their specific needs, and b) don't have the resources to develop their own analytics infrastructure. That's why we started Keen IO. Basically, we built it, so you don't have to. And we made it powerful, flexible, and scalable enough that you can use it however you need to – even if those needs change over time. - -This example shows how you can very easily connect Auth0 to __Keen IO__ and stream `signup` events. - -Implementing this with Auth0 is very easy, only taking a few lines of code. - -![Keen IO Dataflow](/media/articles/tutorials/keen-io-dataflow.png) - -## Recording a SignUp event in Keen IO - -This rule checks whether the user has already signed up before or not. This is tracked by the `user.signedUp` property. If the property is present then we assume return immediately, otherwise we assume a new `signup`. - -```js -function(user, context, callback) { - - if(user.signedUp){ - return callback(null, user, context); - } - - var writeKey = 'YOUR KEEN IO WRITE KEY'; - var projectId = 'YOUR KEEN IO PROJECT ID'; - var eventCollection = 'signups'; - - var keenEvent = { - userId: user.user_id, - name: user.name, - ip: context.request.ip //Potentially any other properties in the user profile/context - }; - - request.post({ - method: 'POST', - url: 'https://api.keen.io/3.0/projects/' + projectId + '/events/' + eventCollection + '?api_key=' + writeKey, - headers: { - 'Content-type': 'application/json', - }, - body: JSON.stringify(keenEvent), - }, - function (e, r, body) { - if( e ) return callback(e,user,context); - //We assume everything went well - user.persistent.signedUp = true; - return callback(null, user, context); - }); -} -``` - -::: note -Notice that if all calls are successful, we signal the user as signed up. So next time we skip the entire rule. -::: - -Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: - -* Rules for access control -* Integration with other services: [MixPanel](http://mixpanel.com), [Firebase](http://firebase.com), [Rapleaf](http://rapleaf.com), [Parse](http://parse.com) diff --git a/articles/monitoring/sending-events-to-segmentio.md b/articles/monitoring/sending-events-to-segmentio.md deleted file mode 100644 index 87b7ecf705..0000000000 --- a/articles/monitoring/sending-events-to-segmentio.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -description: How to send events to segment.io from Auth0 -topics: - - monitoring - - segmentio -contentType: - - how-to -useCase: - - analyze-auth0-analytics - - analyze-logs - - analyze-external-analytics - - integrate-analytics ---- -# Send Auth0 Events to Segment - -[Segment](http://segment.io/features) provides a large number of analytics-related functionality with a single, simple to use API. - -This example shows how you can connect Auth0 to Segment and stream `signup` and `login` events. You'll be using [Segment's Node.js library](https://github.com/segmentio/analytics-node) to record Auth0 data. - -![Segment Flow](/media/articles/monitoring/segment/segment-io-dataflow.png) - -## Find your Segment Write Key - -To configure this integration, you'll need your Segment **Write Key**. You can find this under **Settings** > **API**. - -![Segment API Keys](/media/articles/monitoring/segment/segment-3.png) - -## Record sign up and login events - -To record Auth0 signup and login events and send the information to Segment, you will create a [rule](/rules) implementing Segment's Node.js library. - -::: note -Be sure to add your **Write Key** to the [Global Configuration Object](/rules#using-the-configuration-object) prior to running your rule. -::: - -```js -function(user, context, callback) { - var Analytics = require('analytics-node'); - var analytics = new Analytics(configuration.WRITE_KEY, { flushAt: 1 }); - - // Note: Set { flushAt: 1 } and use analytics.flush to ensure - // the data is sent to Segment before the rule/Webtask terminates - - // Identify your user - analytics.identify({ - userId: user.user_id, - traits: { - email: user.email, - signed_up: user.created_at, - login_count: user.logins_count - }, - "context": { - "userAgent": context.request.UserAgent, - "ip": context.request.ip - } - }); - analytics.track({ - userId: user.user_id, - event: 'Logged In', - properties: { - clientName: context.clientName, - clientID: context.clientID, - connection: context.connection - }, - "context": { - "userAgent": context.request.UserAgent, - "ip": context.request.ip - } - }); - analytics.flush(function(err, batch){ - callback(null, user, context); - }); -} -``` - -## Check your integration - -To see if your integration works, you can check the Segment Debugger to see if your Auth0 events are appearing. - -![Segment Debugger](/media/articles/monitoring/segment/segment-14.png) diff --git a/articles/monitoring/sending-events-to-splunk.md b/articles/monitoring/sending-events-to-splunk.md deleted file mode 100644 index 249558446a..0000000000 --- a/articles/monitoring/sending-events-to-splunk.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -description: How to send events from Auth0 to Spunk. -topics: - - monitoring - - splunk -contentType: - - how-to -useCase: - - analyze-auth0-analytics - - analyze-logs - - analyze-external-analytics - - integrate-analytics ---- -# Sending Events from Auth0 to Splunk - -[Splunk](http://splunk.com) provides a platform to easily get insights into all the information generated by your IT infrastructure. - -This example shows how you can very easily connect Auth0 to Splunk and stream `signup` and `login` events with user contextual information. - -![](/media/articles/tutorials/splunk-dataflow.png) - -## Record a SignUp or Login Event in Splunk - -This [Auth0 rule](/rules) uses the [Splunk REST API](http://dev.splunk.com/view/rest-api-overview/SP-CAAADP8) to record `signup` and `login` events from users to your apps. This is tracked with the `signedUp` property. If the property is present, then we assume this is a `login` event. Otherwise we assume that this event is a new `signup`. - -You can send any number of properties. This sample sends contextual information like the user IP address (can be used for location), the application, the username, and so on. - -Splunk's API supports basic & token based auth. For simplicity, we use basic auth, with credentials in the rule. You can store these credentials securely in Auth0 using standard settings on the dashboard. - -When enabled, this rule will start sending events that will show up on Splunk's dashboard: - -![](/media/articles/scenarios/splunk/splunk-dashbaord.png) - -::: panel Securely Storing Credentials -This example has your Splunk credentials hard-coded into the rule, but if you prefer, you can store them instead in the `configuration` object (see the [Settings](${manage_url}/#/rules) under the list of your rules). This allows you to use those credentials in multiple rules if you require, and also prevents you from having to store them directly in the code. -::: - -```js -function(user, context, callback) { - user.app_metadata = user.app_metadata || {}; - var splunkBaseUrl = 'YOUR SPLUNK SERVER, like: https://your server:8089'; - - //Add any interesting info to the event - var event = { - message: user.app_metadata.signedUp ? 'Login' : 'SignUp', - application: context.clientName, - clientIP: context.request.ip, - protocol: context.protocol, - userName: user.name, - userId: user.user_id - }; - - request.post( { - url: splunkBaseUrl + '/services/receivers/simple', - auth: { - 'user': 'YOUR SPLUNK USER', - 'pass': 'YOUR SPLUNK PASSWORD', - }, - json: event, - qs: { - 'source': 'auth0', - 'sourcetype': 'auth0_activity' - } - }, function(e,r,b) { - if (e) return callback(e); - if (r.statusCode !== 200) return callback(new Error('Invalid operation')); - user.app_metadata.signedUp = true; - auth0.users.updateAppMetadata(user.user_id, user.app_metadata) - .then(function(){ - callback(null, user, context); - }) - .catch(function(err){ - callback(err); - }); - }); -} -``` - -::: note -Notice that if all calls are successful, we signal the user as signed up. So next time we record `login`. -::: - -Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: - -* Rules for access control -* Integration with other services: [Firebase](http://firebase.com), [Rapleaf](http://rapleaf.com), [Parse](http://parse.com) diff --git a/articles/monitoring/track-signups-enrich-user-profile-generate-leads.md b/articles/monitoring/track-signups-enrich-user-profile-generate-leads.md deleted file mode 100644 index dd32a077a5..0000000000 --- a/articles/monitoring/track-signups-enrich-user-profile-generate-leads.md +++ /dev/null @@ -1,155 +0,0 @@ ---- -description: How to track sign-ups, enrich user profiles and generate new leads. -topics: - - monitoring - - marketing -contentType: - - how-to -useCase: - - analyze-auth0-analytics - - analyze-logs - - analyze-external-analytics - - integrate-analytics ---- - -# How to track Sign-ups, enrich User Profile and generate new Leads - -Upon a signup of a new user to a website with any social credential, we want to: - -1. Record a __SignUp__ event on [MixPanel](https://mixpanel.com). -2. __Augment the user profile__ with additional public information through [FullContact](http://www.fullcontact.com/). -3. Record the new signup as a __New Lead__ on [Salesforce](http://www.salesforce.com/) for follow-up. - -Implementing this with Auth0 is very easy. You just need 3 [Rules](/rules) in your pipeline: - -![](/media/articles/tutorials/signups.png) - -## 1. Recording a SignUp in MixPanel - -This first rule checks whether the user has already signed up. If they have, it simply skips everything. If not, it calls __MixPanel__ to record the event. In the example below we are simply using a property `application` that you can then use in MixPanel to filter information. But the full `context` and `user` properties are available as sources of more information (such as IP addresses, agent, and so on.). - -We also call this event `Sign Up`: - -```js -function (user, context, callback) { - - if(user.signedUp) return callback(null,user,context); - - var mixPanelEvent = { - "event": "Sign Up", - "properties": { - "distinct_id": user.user_id, - "token": YOUR_MIXPANEL_TOKEN, - "application": context.clientName - } - }; - - var base64Event = new Buffer(JSON.stringify(mixPanelEvent)).toString('base64'); - - request('http://api.mixpanel.com/track/?data=' + base64Event, - function(e,r,b){ - if(e) return callback(e); - return callback(null,user,context); - }); -} - -``` - -## 2.Augment User Profile with FullContact - -The 2nd step is to obtain more information about this user using their email address. __FullContact__ provides an API to retrieve public information about a user using the email as input. We store this additional information in a property called `fullContactInfo`: - -:::note -We are ignoring certain conditions that exist in the API and only doing this when there's a successful call (`statusCode=200`). -::: - -```js -function (user, context, callback) { - - if(user.signedUp) return callback(null,user,context); - - var fullContactAPIKey = 'YOUR FULLCONTACT API KEY'; - - if(user.email){ - request('https://api.fullcontact.com/v2/person.json?email=' + encodeURIComponent(user.email) + '&apiKey=' + fullContactAPIKey, - function(e,r,b){ - if(e) return callback(e); - if(r.statusCode===200){ - user.fullContactInfo = JSON.parse(b); - } - return callback(null, user, context); - }); - } - else{ - return callback(null, user, context); - } -} -``` - -## 3. Create a New Lead in Salesforce - -In the last step we record the information as a __New Lead__ in Salesforce, so the sales department can followup. This __Rule__ has some interesting things: - -1. The Salesforce REST API uses an OAuth Access Token. We are using the OAuth2 `Resource Owner Password Credential Grant` to obtain such Access Token. This is the `getToken` function hat uses credentials as input as opposed to an `API-KEY` as the previous rules. -2. We are just recording the user name and a fixed company name. We would of course us anything available in the enriched user profile we obtained in step 2, to record more information and have better context for the sales representative. -3. If everything went well, we use a __persistent__ property: `user.signedUp` and set it to `true`. So next time this same users logs in, none of these rules will do anything. - -```js -function (user, context, callback) { - - if(user.signedUp) return callback(null,user,callback); - - getAccessToken(SFCOM_CLIENT_ID, SFCOM_CLIENT_SECRET, USERNAME, PASSWORD, - function(e,r){ - if( e ) return callback(e); - - createLead(r.instance_url, r.access_token, function(e,result){ - if(e) return callback(e); - //Everyhting worked fine. We signal this signup was succesful. - user.persistent.signedUp = true; - return callback(null,user,context); - }); - }); - - function createLead(url,access_token, callback){ - - //Just a few fields. The Lead object is much richer - var data = { - LastName: user.name, - Company: 'Web channel signups' - }; - - request.post({ - url: url + "/services/data/v20.0/sobjects/Lead/", - headers: { - "Authorization": "OAuth " + access_token, - "Content-type": "application/json" - }, - body: JSON.stringify(data) - }, function(e,r,b){ - if(e) return callback(e); - return callback(null,b); - }); - } - - function getAccessToken(client_id, client_secret, username, password, callback){ - request.post({ - url: 'https://login.salesforce.com/services/oauth2/token', - form: { - grant_type: 'password', - client_id: client_id, - client_secret: client_secret, - username: username, - password: password - }}, function(e,r,b){ - if(e) return callback(e); - return callback(null,JSON.parse(b)); - }); - } -} -``` - -Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: - -* Rules for access control -* Integration with other services: [Firebase](http://firebase.com), [Rapleaf](http://rapleaf.com) diff --git a/articles/monitoring/tracking-new-leads-in-salesforce-and-raplead.md b/articles/monitoring/tracking-new-leads-in-salesforce-and-raplead.md deleted file mode 100644 index 05d3da233a..0000000000 --- a/articles/monitoring/tracking-new-leads-in-salesforce-and-raplead.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -description: How to track new leads in Salesforce and augment user profile with Rapleaf. -topics: - - monitoring - - marketing - - salesforce - - rapleaf -contentType: - - how-to -useCase: - - analyze-auth0-analytics - - analyze-logs - - analyze-external-analytics - - integrate-analytics ---- - -# Tracking new leads in Salesforce, augmenting user profile with RapLeaf - -Upon a signup of a new user to a website with any social credential, we want to: - -1. __Augment the user profile__ with additional public information through [RapLeaf](http://www.rapleaf.com/). -2. Record the new signup as a __New Lead__ on [Salesforce](http://www.salesforce.com/) for follow-up. - -Implementing this with Auth0 is very easy. You just need 2 [Rules](/rules) in your pipeline: - -![](/media/articles/tutorials/rapleaf-salesforce.png) - -## 1. Augment User Profile with RapLeaf - -The 1st step is to obtain more information about this user using their email address. __RapLeaf__ provides an API to retrieve public information about a user using the email as input that is extremely easy to use. - -Once the call to RapLeaf completes, we store this additional information in a property called `rapLeafData`: - -:::note -We are ignoring certain conditions that exist in the API and only doing this when there's a successful call (`statusCode=200`). The entire rule is ignored if the user has already signed up (signaled by the `user.signedUp` property setup after recording a new lead in step 2 below). -::: - -```js -function (user, context, callback) { - - if(user.signedUp) return callback(null,user,callback); - - var rapLeafAPIKey = 'YOUR RAPLEAF API KEY'; - - if(user.email){ - request('https://personalize.rapleaf.com/v4/dr?email=' + - encodeURIComponent(user.email) + - '&api_key=' + rapLeafAPIKey, - function(e,r,b){ - if(e) return callback(e); - - if(r.statusCode===200){ - user.rapLeafData = JSON.parse(b); - } - - return callback(null,user,context); - }); - } - else { - return callback(null,user,context); - } -} -``` - -## 2. Create a New Lead in Salesforce - -In this second step we record the information as a __New Lead__ in Salesforce, so the sales department can followup. This __Rule__ has some interesting things: - -1. The Salesforce REST API uses an OAuth Access Token. We are using the OAuth2 `Resource Owner Password Credential Grant` to obtain such Access Token. This is the `getToken` function that uses credentials as input as opposed to an `API-KEY` as the previous rule. -2. We are just recording the user name and a fixed company name. We could of course use anything available in the enriched user profile we obtained in step 1, to record more information, and have better context for the sales representative. -3. If everything went well, we use a __persistent__ property: `user.signedUp` and set it to `true`. So next time this same users logs in, these rules will be skipped. - -```js -function (user, context, callback) { - - if(user.signedUp) return callback(null, user, callback); - - getAccessToken(SFCOM_CLIENT_ID, SFCOM_CLIENT_SECRET, USERNAME, PASSWORD, - function(err, response){ - if(err) return callback(err); - - createLead(response.instance_url, response.access_token, function(err, result){ - if(err) return callback(err); - //Everyhting worked fine. We signal this signup was successful. - user.persistent.signedUp = true; - return callback(null, user, context); - }); - }); - - function createLead(url, access_token, callback){ - - //Just a few fields. The Lead object is much richer. - var data = { - LastName: user.name, - Company: 'Web channel signups' - }; - - request.post({ - url: url + "/services/data/v20.0/sobjects/Lead/", - headers: { - "Authorization": "OAuth " + access_token, - "Content-type": "application/json" - }, - body: JSON.stringify(data) - }, function(err, response, body){ - if(err) return callback(err); - return callback(null,body); - }); - } - - //Helper function to get an Access Token from Salesforce - function getAccessToken(client_id, client_secret, username, password, callback){ - request.post({ - url: 'https://login.salesforce.com/services/oauth2/token', - form: { - grant_type: 'password', - client_id: client_id, - client_secret: client_secret, - username: username, - password: password - }}, function(e,r,b){ - if(e) return callback(e); - return callback(null,JSON.parse(b)); - }); - } -} -``` -That's it! - -Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples: - -* Rules for access control -* Integration with other services: [Firebase](http://firebase.com) diff --git a/articles/multifactor-authentication/administrator/customizing-widget.md b/articles/multifactor-authentication/administrator/customizing-widget.md deleted file mode 100644 index 6878622765..0000000000 --- a/articles/multifactor-authentication/administrator/customizing-widget.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -description: How to Customize the Guardian Widget -topics: - - mfa - - guardian -contentType: - - how-to -useCase: - - customize-mfa ---- -# Customizing the Guardian Screen - -You may change the logo and the friendly name that is displayed to your users. To do so, make the appropriate changes to the Guardian page's settings on the **General** tab in [Tenant Settings](${manage_url}/#/tenant). You can also reach the Tenant Settings page by clicking on your tenant name on the top right of the page and then selecting **Settings** from the dropdown menu. - -![](/media/articles/mfa/guardian-logo-and-name-settings.png) - -* **Friendly Name**: the name of the app that you want displayed to users -* **Logo URL**: the URL that points to the logo image you want displayed to users - -## Customizing the Guardian Landing Page - -### Activate the Hosted Page - -Customizing the content of the Guardian widget page is possible in the [Guardian Multi-factor Hosted Page](${manage_url}/#/guardian_mfa_page) by toggling __Customize Guardian Page__. - -![](/media/articles/mfa/guardian-mfa-hosted-page.png) - -### Theming Options - -There are a few theming options for MFA-Widget, namespaced under the `theme` property. - -#### icon - -The value for `icon` is the URL for an image that will be used in the MFA-Widget header, which defaults to the Auth0 logo. It has a recommended max height of `58px` for a better user experience. - -```js - theme: { - icon: 'https://example.com/assets/logo.png' - }, -``` - -#### primaryColor - -The `primaryColor` property defines the primary color of the MFA-Widget. This option is useful when providing a custom `icon`, to ensure all colors go well together with the `icon`'s color palette. Defaults to `#ea5323`. - -```js - theme: { - icon: 'https://example.com/assets/logo.png', - primaryColor: 'blue' - }, -``` - -### Rendering "Invited Enrollments" vs. Standard Scenarios - -There are two different possible scenarios in which the page is rendered. If a user has been directed to this page specifically for enrollment (for instance, from an email with an enrollment link) then the property **ticket** will be available. Otherwise, the property **requestToken** will be available. - -### HTML + Liquid syntax - -The hosted page uses [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) syntax for templating. -The following parameters are available to assist in rendering your page: - -* `userData.email` -* `userData.friendlyUserId` -* `userData.tenant` -* `userData.tenantFriendlyName` -* `iconUrl` - -Most of the parameters that are used in MFA-Widget need to be passed to Guardian as shown in the default template provided in the customization area. -If you need a higher level of customization you could use [auth0-guardian.js](https://github.com/auth0/auth0-guardian.js/tree/master/example). diff --git a/articles/multifactor-authentication/administrator/disabling-mfa.md b/articles/multifactor-authentication/administrator/disabling-mfa.md deleted file mode 100644 index 71be54dd11..0000000000 --- a/articles/multifactor-authentication/administrator/disabling-mfa.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -description: How to Disable Guardian and the other types of MFA. -topics: - - mfa - - guardian -contentType: - - how-to -useCase: - - customize-mfa ---- -# Disable Guardian and other MFA - -Multi-factor Authentication with Push Notifications (Guardian) and SMS can be disabled from the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard. Toggle the slider to disable each type. - -![Toggle Guardian](/media/articles/mfa/disable-guardian.png) - -A confirmation popup will appear confirming that you understand all customizations will be lost and that this action cannot be reverted. - -## Disable Google Authenticator or Duo - -To disable Google Authenticator or Duo, click on the configure link on the bottom of the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard, which will bring you to the [MFA configuration page for Google Authenticator and Duo](${manage_url}/#/multifactor). Then toggle the slider to disable the MFA type you wish to disable. - -![Toggle Other](/media/articles/mfa/disable-google-auth-duo.png) - -A confirmation popup will appear confirming that you understand all customizations will be lost. diff --git a/articles/multifactor-authentication/administrator/guardian-enrollment-email.md b/articles/multifactor-authentication/administrator/guardian-enrollment-email.md deleted file mode 100644 index 9fb0d5e124..0000000000 --- a/articles/multifactor-authentication/administrator/guardian-enrollment-email.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -description: Send an enrollment email (Guardian) -topics: - - mfa - - guardian - - email -contentType: - - how-to -useCase: - - customize-mfa ---- -# Sending a Guardian Enrollment Email to a User - -With this, an administrator can send an email to a user with a link for registering their device with Guardian. - -To send this email: - -1. Find and select the user in the [Users](${manage_url}/#/users) section of the dashboard. -2. Click on the **Actions** button on the top right of the screen. -3. Select **Send Enrollment Email (Guardian)** from the dropdown. - - ![](/media/articles/mfa/guardian-send-enrollment-email.png) - -The user will receive an enrollment email at their registered email address. - - ![](/media/articles/mfa/enrollment-email.png) - -Administrators can also [customize the email template](/email/templates) for the enrollment emails. - -## Restricting user-initiated enrollments - -Some organizations may want to only allow users to enroll a device with Guardian via an enrollment email, and prevent users from self-enrolling upon first sign in. This is possible using the _selfServiceEnrollment_ property on a Guardian rule. When set to true, or when the property is not set, the user may self-enroll. When set to false, the user may only enroll their device via an enrollment email. - -To edit the rule, go to the **Multi-factor Auth** section and edit appropriately. - -```js -function (user, context, callback) { - - context.multifactor = { - provider: 'guardian', - selfServiceEnrollment: false, - }; - - callback(null, user, context); -} -``` diff --git a/articles/multifactor-authentication/administrator/guardian-for-select-clients.md b/articles/multifactor-authentication/administrator/guardian-for-select-clients.md deleted file mode 100644 index 28e6ffb3fc..0000000000 --- a/articles/multifactor-authentication/administrator/guardian-for-select-clients.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -description: Guardian for Select Applications -topics: - - mfa - - guardian -contentType: - - how-to -useCase: - - customize-mfa ---- -# Customize MFA for Select Applications - -Once you have enabled either MFA option, you will be presented with the **Customize MFA** code snippet that allows advanced configuration of Guardian's behavior via [Rules](/rules). One option is to apply Guardian authentication only to a subset of your applications. - -By default, Auth0 enables Guardian for all applications. - -```js -function (user, context, callback) { - - var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - - // Apply Guardian only for the specified applications - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - context.multifactor = { - provider: 'guardian', //required - }; - } - - callback(null, user, context); -} -``` - -If you choose to selectively apply multi-factor authentication, you simply set the appropriate `clientID` values, and the code will be executed as part of a [Rule](/rules) whenever a user logs in. - -Once you have finished making your desired changes, click **Save**. diff --git a/articles/multifactor-authentication/administrator/guardian-for-select-users.md b/articles/multifactor-authentication/administrator/guardian-for-select-users.md deleted file mode 100644 index 991d4a99d9..0000000000 --- a/articles/multifactor-authentication/administrator/guardian-for-select-users.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -description: Guardian for Select Users -topics: - - mfa - - guardian -contentType: - - how-to -useCase: - - customize-mfa ---- -# Customize MFA for Select Users - -Once you have enabled either MFA option, you will be presented with the **Customize MFA** code snippet that allows advanced configuration of Guardian's behavior via [Rules](/rules). One option is to apply Guardian authentication only to a subset of your applications. - -By default, Auth0 enables Guardian for all applications. - -```js -function (user, context, callback) { - - var USERS_WITH_MFA = ['REPLACE_WITH_YOUR_USER_ID']; - - // Apply Guardian only for the specified users - if (USERS_WITH_MFA.indexOf(user.user_id) !== -1) { - context.multifactor = { - provider: 'guardian' - }; - } - - callback(null, user, context); -} -``` - -If you choose to selectively apply multi-factor authentication, you simply set the appropriate `user_id` values, and the code will be executed as part of a [Rule](/rules) whenever a user logs in. - -Once you have finished making your desired changes, click **Save**. diff --git a/articles/multifactor-authentication/administrator/guardian-logs.md b/articles/multifactor-authentication/administrator/guardian-logs.md deleted file mode 100644 index 71391f7c82..0000000000 --- a/articles/multifactor-authentication/administrator/guardian-logs.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -description: Guardian Logging -topics: - - mfa - - guardian - - logging -contentType: - - how-to - - reference -useCase: - - customize-mfa - - analyze-auth0-analytics ---- -# Tracking your Users' MFA Events - -In the [Logs](${manage_url}/#/logs) section of the dashboard, you can see the various events related to your users signing up and signing in using MFA. - -![](/media/articles/mfa/logs.png) - -Here are all the possible events related to MFA: - -| Event Type | Description | -| --- | --- | -| `gd_unenroll` | When a device account is deleted | -| `gd_update_device_account` | When a device account is updated | -| `gd_send_pn` | When a push notification is sent | -| `gd_send_sms` | When a SMS is sent | -| `gd_start_auth` | Start second factor authentication | -| `gd_start_enroll` | Second factor auth enrollment is started | -| `gd_module_switch` | When changing feature config | -| `gd_tenant_update` | When tenant info has been updated | -| `gd_user_delete` | When calling (user delete => unenroll) | -| `gd_auth_failed` | When second factor login has failed | -| `gd_auth_succeed` | When second factor authentication has succeeded | -| `gd_recovery_succeed` | Recovery succeeded | -| `gd_recovery_failed` | Failed recovery | -| `gd_otp_rate_limit_exceed` | When One Time Password fails validation because rate limit is exceeded | -| `gd_recovery_rate_limit_exceed` | When recovery validation fails because rate limit is exceeded | - -These events can also be searched using the [Management APIv2](/api/management/v2#!/Logs) using [query string syntax](/api/management/v2/query-string-syntax). You can search criteria using the `q` parameter or you can search by a specific log ID. - -## Examples searching with the `q` parameter - -To see the events for users who are enrolling with MFA: - -`type: gd_start_enroll` - -To see all the times an SMS is sent: - -`type: gd_send_sms` diff --git a/articles/multifactor-authentication/administrator/index.md b/articles/multifactor-authentication/administrator/index.md deleted file mode 100644 index 11dc9ad7e7..0000000000 --- a/articles/multifactor-authentication/administrator/index.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -description: How to enable and use Push Notifications and SMS for Guardian MFA. -topics: - - mfa - - guardian - - push-notifications - - sms -contentType: - - index -useCase: - - customize-mfa ---- - -# Guardian for Administrators - -Guardian is Auth0's multi-factor authentication solution that provides a simple and secure way to implement MFA. When using Guardian with Auth0, users will be prompted for additional authentication from the Guardian mobile application, helping to provide a more secure login. - -This page contains information on how to enable and configure Guardian as an administrator. Information geared toward developers and users can be found under [additional documents](#additional-documents). - -## Guardian Basics -* [Guardian Push Notifications](/multifactor-authentication/administrator/push-notifications) -* [Guardian SMS Notifications](/multifactor-authentication/administrator/sms-notifications) - * [Configuring your Twilio Account](/multifactor-authentication/administrator/twilio-configuration) - * [Customize your text messages](/multifactor-authentication/administrator/sms-templates) -* [Turning off Guardian](/multifactor-authentication/administrator/disabling-mfa) - -## Managing Users -* [Applying Guardian to Specific Users](/multifactor-authentication/administrator/guardian-for-select-users) -* [Sending Guardian Enrollment Emails](/multifactor-authentication/administrator/guardian-enrollment-email) -* [Resetting Guardian Credentials](/multifactor-authentication/administrator/reset-user) -* [Guardian logs](/multifactor-authentication/administrator/guardian-logs) - -## Customization -* [Customize the Guardian Widget](/multifactor-authentication/administrator/customizing-widget) -* [Advanced Customization of the Guardian Widget](https://github.com/auth0/auth0-guardian.js/tree/master/example) -* [Customizing Guardian Rules and Behavior](/multifactor-authentication/custom) - - -## Additional Documents -* [Guardian for Developers](/multifactor-authentication/developer) -* [Guardian for Users](/multifactor-authentication/guardian/user-guide) diff --git a/articles/multifactor-authentication/administrator/push-notifications.md b/articles/multifactor-authentication/administrator/push-notifications.md deleted file mode 100644 index 396e6c65f2..0000000000 --- a/articles/multifactor-authentication/administrator/push-notifications.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -description: How to enable and use push notifications for Guardian. -topics: - - mfa - - guardian - - push-notifications -contentType: - - how-to -useCase: - - customize-mfa ---- -# Guardian Push Notifications - -To enable Push Notifications for Guardian for your users, go to the [Multi-factor Auth](${manage_url}/#/guardian) section of the Auth0 dashboard. Then toggle the **Push Notification** slider to enable it. - -![](/media/articles/mfa/guardian-dashboard.png) - -New users signing up will be prompted to download the Guardian app from either the App Store or Google Play. Once they indicate that they downloaded the app, a code will appear. They will have five minutes to scan the code with the app before it expires. After the code has been successfully scanned, users will see a confirmation screen which includes a recovery code. They need to have this recovery code to login without their mobile device. If they lose both the recovery code and their mobile device, you will need to [reset their MFA](#reset-an-mfa-for-a-user). Then they will receive a push notification to their device and they will be logged in. - -Users that were previously registered before you enabled MFA will need to complete the same process as new users on their next login. diff --git a/articles/multifactor-authentication/administrator/reset-user.md b/articles/multifactor-authentication/administrator/reset-user.md deleted file mode 100644 index 91ce64a158..0000000000 --- a/articles/multifactor-authentication/administrator/reset-user.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -description: Reset a User's MFA -topics: - - mfa - - guardian - - user-management -contentType: - - how-to -useCase: - - customize-mfa ---- -# Resetting a user's multi-factor account - -If a user has lost their mobile device they can use their recovery code to log in. If they do not have recovery code, they will need their tenant administrator to reset their multi-factor authentication. - -To reset a user's multi-factor authentication: - -1. Find and select the user in the [Users](${manage_url}/#/users) section of the dashboard. -2. Once you have selected the affected user, click on the **Actions** button on the top right of the screen. -3. Select **Reset Multi-factor Authentication** from the dropdown. -4. There will be a pop up box to confirm your decision. Click **YES, RESET IT** to reset the user's MFA. - - ![](/media/articles/mfa/reset-mfa.png) - -The next time the user logs in they will need to setup their MFA just like a new user. diff --git a/articles/multifactor-authentication/administrator/sms-notifications.md b/articles/multifactor-authentication/administrator/sms-notifications.md deleted file mode 100644 index 209f0c70b1..0000000000 --- a/articles/multifactor-authentication/administrator/sms-notifications.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -description: How to enable and use push notifications for Guardian. -topics: - - mfa - - guardian - - push-notifications -contentType: - - how-to -useCase: - - customize-mfa ---- -# SMS notifications - -You can enable SMS messages to use as a form of multi-factor authentication. This is also under the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard. By toggling the **SMS** slider, you can enable using SMS for sign in and sign up for your application. SMS can be used as your only form of MFA or in addition to Push Notifications. - -Your users must have a device capable of using SMS to use this option. If your users are unable to always receive SMS messages (such as when traveling), they will be unable sign up with SMS and unable to log in without the recovery code. - -When your users sign up with SMS, they enter their phone number's country code and mobile phone number. - -![](/media/articles/mfa/sms.png) - -After sign up, they receive a six digit code to their phone. They need to enter this code into the box, and then they will get a recovery code. They will need this code to login if they do not have their device. If they have lost their recovery code and device, you will need to [reset the user's MFA](/multifactor-authentication/administrator/reset-user). diff --git a/articles/multifactor-authentication/administrator/sms-templates.md b/articles/multifactor-authentication/administrator/sms-templates.md deleted file mode 100644 index d5c8cdbb03..0000000000 --- a/articles/multifactor-authentication/administrator/sms-templates.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -description: Customize SMS Messages -topics: - - mfa - - guardian - - sms -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Customize SMS Messages - -To customize the SMS messages sent by Auth0 during enrollment (when associating a device to Guardian) or verification (when an authentication message is sent to the device), do the following: - -First, go to ([Multi-factor Auth With Guardian](${manage_url}/#/guardian), then click on the **SMS** box to configure your SMS settings. - -![](/media/articles/mfa/sms-config.png) - -You have two fields to customize your messages: -* **Enrollment Template**: the message sent by Auth0 during device enrollment. -* **Verification Template**: the message sent by Auth0 to verify the possession of the device. - -[Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) syntax is the supported templating engine to use when accessing user attributes in SMS templates. The following attributes are available: -* `code`: The Enrollment/Verification code. -* `requestInfo.lang`: The browser language (ie, `es-AR,es;q=0.8`, `en-US,en`, and so on.). -* `tenant.friendlyName`: The **Friendly Name** set in [Tenant Settings](${manage_url}/#/tenant). diff --git a/articles/multifactor-authentication/administrator/twilio-configuration.md b/articles/multifactor-authentication/administrator/twilio-configuration.md deleted file mode 100644 index 8948322200..0000000000 --- a/articles/multifactor-authentication/administrator/twilio-configuration.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -description: Configuring Twilio for Guardian -topics: - - mfa - - guardian - - twilio -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Configuring Twilio for Guardian SMS - -When initially setting up SMS, you have up to 100 SMS to be used for testing. This limit can be removed by setting up a Twilio account. To prevent malicious login attempts, your users will always be limited to up to 10 SMS/Hour (replenishing one message an hour, up to 10). - -Click on the **SMS** box to configure your SMS settings. - -![](/media/articles/mfa/sms-config.png) - -## 1. Open an account with Twilio - -You will need a [Twilio Account SID](https://www.twilio.com/help/faq/twilio-basics/what-is-an-application-sid) and a [Twilio Auth Token](https://www.twilio.com/help/faq/twilio-basics/what-is-the-auth-token-and-how-can-i-change-it). These are the Twilio API credentials that Auth0 will use to send an SMS to the user. You may also need to enable permissions for your [geographic region](https://support.twilio.com/hc/en-us/articles/223181108-How-International-SMS-Permissions-work). - -## 2. Configure the connection - -Enter your **Twilio Account SID** and **Twilio Auth Token** in the appropriate fields. - -Choose your **SMS Source**. - -* If you choose **Use From**, you will need to enter the **From** phone number that users will see as the sender of the SMS. You may also configure this in Twilio. - -* If you choose **Use Copilot**, you will need to enter a [Copilot SID](https://www.twilio.com/docs/api/rest/sending-messages-copilot). - -Click **SAVE**. diff --git a/articles/multifactor-authentication/api/_authenticator-before-start.md b/articles/multifactor-authentication/api/_authenticator-before-start.md deleted file mode 100644 index 282bd635df..0000000000 --- a/articles/multifactor-authentication/api/_authenticator-before-start.md +++ /dev/null @@ -1,6 +0,0 @@ -## Before you start - -Before you can use the MFA APIs, you'll need to: - -* Enable the MFA grant type for your application. You can enable the MFA grant by going to [Applications > Your Application > Advanced Settings > Grant Types](${manage_url}/#/applications) and selecting MFA. -* Create a rule that sets Guardian as the MFA provider. For more information, see [Guardian for Administrators](/multifactor-authentication/administrator). \ No newline at end of file diff --git a/articles/multifactor-authentication/api/challenges.md b/articles/multifactor-authentication/api/challenges.md deleted file mode 100644 index c7e86ac8db..0000000000 --- a/articles/multifactor-authentication/api/challenges.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: Trigger MFA using the API -description: How to trigger MFA challenges for enrolled authenticators using the MFA API -topics: - - mfa - - mfa-api - - mfa-challenges -contentType: - - how-to - - reference -useCase: - - customize-mfa ---- -# Trigger MFA using the API - -You can trigger MFA challenges for enrolled authenticators by calling the `/mfa/challenge` endpoint. - -## OTP Challenges - -To trigger an OTP challenge, make the appropriate `POST` call to `mfa/challenge`. - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/mfa/challenge", - "postData": { - "mimeType": "application/json", - "text": "{ \"client_id\": \"YOUR_CLIENT_ID\", \"challenge_type\": \"otp\", \"mfa_token\": \"Fe26.2**05...\" }" - } -} -``` - -If successful, you'll receive the following response: - -```json -{ - "challenge_type": "otp" -} -``` - -Proceed with the authentication process as usual. - -## OOB Challenges - -To trigger an OOB challenge, make the appropriate `POST` call to `mfa/challenge`. - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/mfa/challenge", - "postData": { - "mimeType": "application/json", - "text": "{ \"client_id\": \"YOUR_CLIENT_ID\", \"challenge_type\": \"oob\", \"authenticator_id\": \"sms|dev_s...O\", \"mfa_token\": \"Fe26.2**05...\" }" - } -} -``` - -If successful, you'll receive the following response, as well as an SMS message containing the required six-digit code: - -```json -{ - "challenge_type": "oob", - "oob_code": "asdae35fdt5...oob_code_redacted", - "binding_method": "prompt" -} -``` - -Proceed with the authentication process as usual. - -## Posting the MFA Responses - -You can post MFA OTP or MFA OOB responses using the `/oauth/token` endpoint. diff --git a/articles/multifactor-authentication/api/faq.md b/articles/multifactor-authentication/api/faq.md deleted file mode 100644 index 106b4febdb..0000000000 --- a/articles/multifactor-authentication/api/faq.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Multi-factor Authentication API FAQ -description: Frequently asked questions about MFA and its API -topics: - - mfa - - mfa-api -contentType: - - reference -useCase: - - customize-mfa ---- - -# FAQ: MFA and the MFA API - -The following is a list of frequently-asked questions about multi-factor authentication (MFA) and Auth0's MFA API. - -## When can I self-associate authenticators during the authorization process? - -You can self-associate authenticators if you don't have any active authenticators. If there are one or more active authenticators, you cannot self-associate a new authenticator. - -## With push notifications, why do I get two authenticators instead of one? - -Push notifications have two authenticators. One to trigger the push notification and the other for a time-based one-time password (TOTP). The TOTP authenticator lets you authenticate if you are offline or can't receive the push notification. - -## Why can I associate more than one authenticator with a particular end user? - -Associating multiple authenticators with a user can provide flexibility for the user. - -For example, a user may enable push notifications on their phone and TOTP codes on their computer. If the user is unable to use one of the devices, they can use the other (and not have to rely on the recovery code). - -## When should I use self-association during authorization vs. association outside the authorization process? - -You can self-associate during the authorization process if there are no active authenticators. Associating authenticators outside the authorization process (generally used to add additional authenticators) requires additional programming, such as the use of [rules](/rules). - -## What happens if I delete an authenticator? - -If you delete an authenticator and have multiple authenticators associated, you can use the remaining authenticators. - -If you delete a push authenticator, the associated one-time password (OTP) authenticator is also deleted. If you delete the OTP authenticator, the associated push authenticator is deleted. - -Recovery codes can only be deleted by an administrator using the [Management API](/multifactor-authentication/api/manage#delete-authenticators). - -## If I'm using Guardian, what happens if I delete one of the authenticators? - -Guardian behaves as you'd expect when deleting authenticators. If you delete the push notification authenticator, Guardian removes both it and the OTP authenticator. \ No newline at end of file diff --git a/articles/multifactor-authentication/api/index.md b/articles/multifactor-authentication/api/index.md deleted file mode 100644 index a6a3971be8..0000000000 --- a/articles/multifactor-authentication/api/index.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Multi-factor Authentication API -description: Overview of available multi-factor authentication APIs -topics: - - mfa - - mfa-api -contentType: - - index -useCase: - - customize-mfa ---- - -# Multi-factor Authentication API - -The Multi-factor Authentication (MFA) API endpoints allow you to enforce MFA when users interact with [the Token endpoints](/api/authentication#get-token), as well enroll and manage user authenticators. - -## Multi-factor authentication with the Token endpoint - -We have expanded MFA support on the Token endpoints to cover the following use cases: - -* Use MFA with the [password](/api-auth/grant/password), [password-realm](/api-auth/grant/password#realm-support), and [refresh-token](/tokens/refresh-token/current#use-a-refresh-token) grants. -* Completion of first-time enrollment by users during authentication. -* Selection of the desired MFA authenticator by the user before they execute the MFA challenge. - -### More information - -* [Trigger MFA using the API](/multifactor-authentication/api/challenges) -* [Using one-time passwords as the MFA challenge](/multifactor-authentication/api/otp) -* [Using SMS messages as the MFA challenge](/multifactor-authentication/api/oob) -* [Tutorial: How to use MFA with the Resource Owner Password Grant](/api-auth/tutorials/multifactor-resource-owner-password) - -## Enrollment and management of user authenticators - -The MFA Associate API allows you to create, read, update, and delete authenticators. You can use this API to power user interfaces where users can manage MFA enrollments, or add and remove authenticators. - -This enables users to enroll more than one device and select a fallback MFA mechanism in case the primary one is not available. For example, your user might use OTP when their SMS network is not present or unresponsive. - -Check out [Manage Authenticators](/multifactor-authentication/api/manage) for more on listing or deleting authenticators. - -<%= include('./_authenticator-before-start') %> - -If you are using the MFA API in conjunction with the [Token endpoint](/api/authentication#get-token), you must meet the requirements of the corresponding grant. - -## Limitations - -* The MFA API is designed to work with the Guardian Provider. Support for other providers will be provided in future releases. -* Support for authenticator selection is currently limited to the Token Endpoint. Auth0 is working to extend support to [Hosted MFA Pages](/hosted-pages/guardian). If users have more than one authenticator enrolled, the most-recently enrolled option will be used by the Hosted MFA Pages. diff --git a/articles/multifactor-authentication/api/manage.md b/articles/multifactor-authentication/api/manage.md deleted file mode 100644 index 0354f008fb..0000000000 --- a/articles/multifactor-authentication/api/manage.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: Manage the Authenticators for Multi-factor Authentication -description: How to manage your MFA authenticators -beta: true -topics: - - mfa - - mfa-api - - mfa-authenticators -contentType: - - how-to - - reference -useCase: - - customize-mfa ---- - -# Manage the Authenticators - -Auth0 provides several API endpoints to help you manage the authenticators you're using with an application for multi-factor authentication (MFA). - -## Before you start - -The MFA endpoints require an [Access Token](/tokens/access-token) with: - -- `audience`: Set to `https://${account.namespace}/mfa/` -- `scope`: Include `enroll` for enrollment, `read:authenticators` to list authenticators, and `remove:authenticators` to delete authenticators. - -For example: - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/oauth/token", - "headers": [{ - "name": "Content-Type", "value": "application/json" - }], - "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"password\",\"username\": \"user@example.com\",\"password\": \"pwd\",\"audience\": \"https://${account.namespace}/mfa/\", \"scope\": \"enroll read:authenticators remove:authenticators\", \"client_id\": \"${account.clientId}\", \"client_secret\": \"YOUR_CLIENT_SECRET\"}" - } -} -``` - -## List Authenticators - -To get a list of the authenticators you've associated and can be used with your tenant, you can make the appropriate call to the `/mfa/authenticators` endpoint: - -```har -{ - "method": "GET", - "url": "https://${account.namespace}/mfa/authenticators", - "headers": [{ - "name": "Authorization", - "value": "Bearer ACCESS_TOKEN" - }] -} -``` - -You should receive information about the authenticator type(s) in the response: - -```json -[ - { - "authenticator_type": "recovery-code", - "id": "recovery-code|dev_IsBj5j3H12VAdOIj", - "active": true - }, - { - "authenticator_type": "otp", - "id": "totp|dev_nELLU4PFUiTW6iWs", - "active": true, - }, - { - "authenticator_type": "oob", - "oob_channel": "sms", - "id": "sms|dev_sEe99pcpN0xp0yOO", - "name": "+1123XXXXX", - "active": true - } -] -``` - -## Delete Authenticators - -To delete an authenticator you've associated, send a delete request to the `/mfa/authenticators/AUTHENTICATOR_ID` endpoint (be sure to replace `AUTHENTICATOR_ID` with your authenticator ID). - -```har -{ - "method": "DELETE", - "url": "https://${account.namespace}/mfa/authenticators/AUTHENTICATOR_ID", - "headers": [{ - "name": "Authorization", - "value": "Bearer ACCESS_TOKEN" - }] -} -``` - -If the authenticator was deleted, a 204 response is returned. diff --git a/articles/multifactor-authentication/api/oob.md b/articles/multifactor-authentication/api/oob.md deleted file mode 100644 index 9aae3f4a5f..0000000000 --- a/articles/multifactor-authentication/api/oob.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Associate an Out-of-Band Authenticator -description: Configure your application so users can self-associate out-of-band (OOB) authenticators. -topics: - - mfa - - mfa-api - - mfa-authenticators - - oob -contentType: - - how-to - - reference -useCase: - - customize-mfa ---- - -# Associate an Out-of-Band Authenticator - -In this tutorial, you'll learn how to configure your application so users can self-associate out-of-band (OOB) authenticators. - -<%= include('./_authenticator-before-start') %> - -## 1. Get the MFA token - -When a user begins the authorization process without an active authenticator associated with their account, they will trigger the following MFA response when calling the `/oauth/token` endpoint: - -```json -{ - "error": "mfa_required", - "error_description": "Multifactor authentication required", - "mfa_token": "Fe26...Ha" -} -``` - -In the next step, use the MFA token (`mfa_token`) instead of the standard Access Token to request association of a new authenticator. - -## 2. Request association of the authenticator - -Next, make a `POST` request to the `/mfa/associate` endpoint to request association of your authenticator. Remember to use the MFA token from the previous step. - -To associate an authenticator where the challenge type is an SMS message containing a code the user provides, make the following `POST` request to the `/mfa/associate` endpoint. Be sure to replace the placeholder values in the payload body shown below as appropriate. - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/mfa/associate", - "headers": [{ - "name": "Authorization", - "value": "Bearer MFA_API_ACCESS_TOKEN" - }], - "postData": { - "mimeType": "application/json", - "text": "{ \"authenticator_types\": [\"oob\"], \"oob_channels\": [\"sms\"], \"phone_number\": \"+11...9\" }" - } -} -``` - -If successful, you'll receive a response like this: - -```json -{ - "authenticator_type": "oob", - "oob_channel": "sms", - "recovery_codes": [ "N3BGPZZWJ85JLCNPZBDW6QXC" ], - "oob_code": "ata6daXAiOi..." -} -``` - -### Recovery Codes - -If this is the first time you're associating an authenticator, you'll notice your response includes `recovery_codes`. This is used to access your account in the event that you lose access to the account or device used for your second factor authentication. These are one-time usable codes, and new ones are generated as necessary. - -## 3. Confirm the authenticator association - -Once you've associated an authenticator, **you must use it at least once to confirm the association**. - -You can check if an authenticator has been confirmed by calling the [`mfa/authenticators` endpoint](/multifactor-authentication/api/manage#list-authenticators). If confirmed, the value of `active` is `true`. - -To confirm the association of an authenticator using SMS messages for the MFA challenge, make a `POST` request to the `oauth/token` endpoint. Be sure to replace the placeholder values in the payload body shown below as appropriate. - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/oauth/token", - "postData": { - "mimeType": "application/json", - "text": "{ \"client_id\": [\"YOUR_CLIENT_ID\"], \"grant_type\": \"http://auth0.com/oauth/grant-type/mfa-oob\", \"mfa_token\": \"YOUR_MFA_TOKEN\", \"oob_code\": \"ata...i0i\", \"binding_code\": \"000000\" }" - } -} -``` - -If your call was successful, you'll receive a response like this: - -``` -{ - "access_token": "eyJ...i", - "expires_in": 600, - "scope": "enroll read:authenticators remove:authenticators", - "token_type": "Bearer" -} -``` - -At this point, your authenticator is fully associated and ready to be used. diff --git a/articles/multifactor-authentication/api/otp.md b/articles/multifactor-authentication/api/otp.md deleted file mode 100644 index cde4bd8794..0000000000 --- a/articles/multifactor-authentication/api/otp.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: Associate a One-Time Password Authenticator -description: Configure your application so users can self-associate one-time password (OTP) authenticators. -topics: - - mfa - - mfa-api - - mfa-authenticators - - otp -contentType: - - how-to - - reference -useCase: - - customize-mfa ---- - -# Associate a One-Time Password Authenticator - -In this tutorial, you'll learn how to configure your application so users can self-associate one-time password (OTP) authenticators. - -<%= include('./_authenticator-before-start') %> - -## 1. Get the MFA Token - -When a user begins the authorization process without an active authenticator associated with their account, they will trigger the an `mfa_required` error when calling the `/oauth/token` endpoint. For example: - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/oauth/token", - "headers": [ - { "name": "Content-Type", "value": "application/json" } - ], - "postData": { - "mimeType": "application/json", - "text": "{\"grant_type\":\"password\",\"username\": \"user@example.com\",\"password\": \"pwd\",\"audience\": \"https://someapi.com/api\", \"scope\": \"read:sample\", \"client_id\": \"${account.clientId}\", \"client_secret\": \"YOUR_CLIENT_SECRET\"}" - } -} -``` - -The `mfa_required` error will look like this: - -```json -{ - "error": "mfa_required", - "error_description": "Multifactor authentication required", - "mfa_token": "Fe26...Ha" -} -``` - -In the next step, use the `mfa_token` value instead of the standard Access Token to request association of a new authenticator. - -## 2. Request association of the authenticator - -Next, make a `POST` request to the `/mfa/associate` endpoint to request association of your authenticator. Remember to use the `mfa_token` from the previous step. - -To associate an authenticator where the challenge type is an OTP code the user provides, make the following `POST` request to the `/mfa/associate` endpoint. Be sure to replace the placeholder values in the payload body shown below as appropriate. - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/mfa/associate", - "headers": [{ - "name": "Authorization", - "value": "Bearer ACCESS_TOKEN" - }], - "postData": { - "mimeType": "application/json", - "text": "{ \"authenticator_types\": [\"otp\"] }" - } -} -``` - -If successful, you'll receive a response like this: - -```json -{ - "authenticator_type": "otp", - "secret": "EN...S", - "barcode_uri": "otpauth...period=30", - "recovery_codes": [ "N3B...XC"] -} -``` - -In the next step, you'll need the one-time password (`otp`), which can be obtained by using the `barcode_uri` to generate a QR code that can be scanned by the OTP generator of your choice (such as Guardian). - -You might also consider displaying the `secret` in plain text so that your users can copy and paste it directly into the OTP generator (this is especially helpful for users on desktop applications). - -### Recovery Codes - -If this is the first time you're associating an authenticator, you'll notice that your response includes `recovery_codes`. This is used to access your account in the event that you lose access to the account or device used for your second factor authentication. These are one-time usable codes, and new ones are generated as necessary. - -## 3. Confirm the authenticator association - -Once you've associated an authenticator, **you must use it at least once to confirm the association**. - -You can check if an authenticator has been confirmed by calling the [`mfa/authenticators` endpoint](/multifactor-authentication/api/manage#list-authenticators). If confirmed, the value of `active` is `true`. - -To confirm the association of an authenticator using OTP, make a `POST` request to the `oauth/token` endpoint with the `otp` (from the previous step after turning the `barcode_uri` into a QR code). - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/oauth/token", - "postData": { - "mimeType": "application/json", - "text": "{ \"client_id\": [\"YOUR_CLIENT_ID\"], \"grant_type\": \"http://auth0.com/oauth/grant-type/mfa-otp\", \"mfa_token\": \"YOUR_MFA_TOKEN\", \"otp\": \"000000\" }" - } -} -``` - -If the call was successful, you'll receive a response like this: - -``` -{ - "access_token": "eyJ...d", - "expires_in": 600, - "scope": "enroll read:authenticators remove:authenticators", - "token_type": "Bearer" -} -``` - -At this point, your authenticator is fully associated and ready to be used. \ No newline at end of file diff --git a/articles/multifactor-authentication/custom/custom-landing.md b/articles/multifactor-authentication/custom/custom-landing.md deleted file mode 100644 index 59b565ad4c..0000000000 --- a/articles/multifactor-authentication/custom/custom-landing.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: Configuring Custom Multi-factor Authentication -url: /multifactor-authentication/custom -description: Examples for configuring custom MFA implementations. -topics: - - mfa - - custom-mfa -contentType: - - how-to - - concept -useCase: - - customize-mfa ---- -# Configuring Custom MFA - -You may configure [rules](/rules) for custom MFA processes, which allow you to define the conditions that will trigger additional authentication challenges, such as changes in geographic location or logins from unrecognized devices. - -## Implementing Contextual MFA - -The exact requirements for configuring Contextual MFA will vary. Below are sample snippets you might consider using as you customize your specific solution. - -### Change the frequency of authentication requests - -When using the Guardian multi-factor application, by default users are given the option to be remembered and skip MFA for a period of 30 days. To disable this choice for users, set the `allowRememberBrowser` field to `false`. - -For other types of MFA, users are remembered for 30 days by default, or when `allowRememberBrowser` is explicitly set to `true`. You can disable this by setting `allowRememberBrowser` to `false`. - -Note that some older rules may use the field `ignoreCookie` here. While deprecated, that field will still function as expected, and will force multi-factor authentication at every login. - -```JS -function (user, context, callback) { - - if (conditionIsMet()){ - context.multifactor = { - allowRememberBrowser: false, - provider: 'guardian' - }; - } - - callback(null, user, context); -} -``` - -### Access from an extranet - -You can have Auth0 request MFA from users whose requests originate from outside the corporate network: - -```js -function (user, context, callback) { - var ipaddr = require('ipaddr.js'); - var corp_network = "192.168.1.134/26"; - - var current_ip = ipaddr.parse(context.request.ip); - if (!current_ip.match(ipaddr.parseCIDR(corp_network))) { - context.multifactor = { - provider: 'guardian', - - // optional, defaults to true. Set to false to force Guardian authentication every time. - // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details - allowRememberBrowser: false - }; - } - - callback(null, user, context); -} -``` - -## Use a Custom MFA Service - -If you are using an MFA provider that does not have Auth0 built-in support or if you are using a service you have created, you can use the [redirect](/rules/redirect) protocol for the integration. - -By using the redirect protocol, you interrupt the authentication transaction and redirect the user to a specified URL where they are asked for MFA. If authentication is successful, Auth0 will continue processing the request. - -Some MFA options you can implement using the redirect protocol include: - -* A one-time code sent via SMS -* Integration with specialized providers, such as those that require hardware tokens - -To use the redirect protocol, edit the `URL` field: - -```JS -function (user, context, callback) { - - if (condition() && context.protocol !== 'redirect-callback'){ - context.redirect = { - url: 'https://your_custom_mfa' - }; - } - - if (context.protocol === 'redirect-callback'){ - //TODO: handle the result of the MFA step - } - - callback(null, user, context); -} -``` - -## Additional Notes - -* A tutorial is available on using MFA with the [Resource Owner](/api-auth/tutorials/multifactor-resource-owner-password) endpoint. -* If you are using MFA for database connections that use Popup Mode, set `sso` to `true` when defining the options in [auth0.js](/libraries/auth0js) or [Lock](/libraries/lock). If you fail to do this, users will be able to log in without MFA. -* If you are using MFA after an authentication with one or more social providers, you may need to use your own application `ID` and `Secret` in the connection to the provider's site in place of the default Auth0 development credentials. For instructions on how to get the credentials for each social provider, select your particular from the list at: [Identity Providers](/identityproviders). diff --git a/articles/multifactor-authentication/developer/custom-enrollment-ticket.md b/articles/multifactor-authentication/developer/custom-enrollment-ticket.md deleted file mode 100644 index 7944b4d9b5..0000000000 --- a/articles/multifactor-authentication/developer/custom-enrollment-ticket.md +++ /dev/null @@ -1,135 +0,0 @@ ---- -description: Describes how to create an enrollment ticket from API -topics: - - mfa - - step-up-authentication - - api - - custom-enrollment - - tickets -contentType: - - how-to - - concept -useCase: - - customize-mfa ---- -# Custom Enrollment - -In addition to [directly sending emails to enroll users](/multifactor-authentication/administrator/guardian-enrollment-email), it is also possible to manage users' enrollments by creating _enrollment tickets_ via the [post_ticket API](/api/management/v2#!/Guardian/post_ticket). - -This API will return an _enrollment ticket_ containing a `ticket_id` and a `ticket_url`, which can be used to enroll a user. - -The `ticket_url` can be delivered to the user (for instance, via email) and used to kick off the enrollment process. - -Alternatively, the ticket can be leveraged inside the Guardian [Hosted Page](${manage_url}/#/guardian_mfa_page) to customize the Guardian widget's appearance: - -```html - - - - 2nd Factor Authentication - - - - - - - -
    -
    -

    Welcome! {{ userData.email }} enroll your device

    -
    - - -
    -
    -
    -
    - - - - - - -``` - -Since this hosted page is used for displaying the Guardian widget in both enrollment and standard multi-factor login scenarios, it's important to note that the existence of the `ticket` variable can be used to determine which scenario is being used, and to control the content accordingly. - -For example, the following code could be used to used to alter the message: - -```html -{% if ticket %} -

    Welcome, {{ userData.email }}, enroll your device below

    -{% else %} -

    Welcome back, {{ userData.email }}, authenticate below

    -{% endif %} -```` - -Note that this conditional logic around the existence of the `ticket` variable is also used in the initialization of the `Auth0MFAWidget` above. - -## Keep reading - -::: next-steps -* [Sending Guardian Enrollment Emails](/multifactor-authentication/administrator/guardian-enrollment-email) -::: diff --git a/articles/multifactor-authentication/developer/index.md b/articles/multifactor-authentication/developer/index.md deleted file mode 100644 index 116c8cb647..0000000000 --- a/articles/multifactor-authentication/developer/index.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Developer Documentation for Guardian -url: /multifactor-authentication/developer -description: Developer Documentation for Guardian -topics: - - mfa - - guardian -contentType: - - index -useCase: - - customize-mfa ---- - -# Developer Resources for Guardian - -At Auth0, we believe in giving developers the tools they need to get their jobs done. With Guardian, developers are able to customize their users' experience, and even build their own applications on top of our multi-factor capabilities. - -## Getting started with Guardian within your Application -Most often, administrators will [manage multi-factor configuration for an application](multifactor-authentication/guardian/admin-guide). For more advanced use cases, Guardian provides developers the ability to control user access directly. -* [Example Application using Guardian for multi-factor Authentication](https://github.com/auth0/guardian-example) -* [Step-up Authentication](/multifactor-authentication/step-up-authentication) - -## Customize the Guardian Widget -Use our Guardian client libraries to apply the look-and-feel of your organization. -* [Client library for Auth0 Guardian](https://github.com/auth0/auth0-guardian.js) -* [Creating a Custom Guardian Widget](https://github.com/auth0/auth0-guardian.js/tree/master/example) - -## Manage Enrollments -Directly customize the enrollment process for your users. -* [Custom enrollment](/multifactor-authentication/developer/custom-enrollment-ticket) - -## Build Custom Mobile Applications -Developers can build custom _white-label_ Guardian-like applications, or add multi-factor functionality into their own applications. -* [Getting Started with Guardian for Android](/multifactor-authentication/developer/libraries/android) -* [Getting Started with Guardian for iOS](/multifactor-authentication/developer/libraries/ios) diff --git a/articles/multifactor-authentication/developer/libraries/android/index.md b/articles/multifactor-authentication/developer/libraries/android/index.md deleted file mode 100644 index 5d56e24c5f..0000000000 --- a/articles/multifactor-authentication/developer/libraries/android/index.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -title: Getting Started with Guardian for Android -url: /multifactor-authentication/developer/libraries/android -description: Installation, usage, and configuration options guide for Guardian for Android -topics: - - mfa - - guardian - - android -contentType: - - how-to - - reference -useCase: - - customize-mfa ---- - -# Guardian for Android -The [Guardian for Android Software Development Kit](https://github.com/auth0/Guardian.Android) allows developers to create Android apps with Guardian functionality, providing easy and secure access to multi-factor authentication with push notifications. For example, this toolkit gives you the power to build a 'white label' version of the Guardian application for your users, using your own look-and-feel. - -More information can be found on Guardian [here](/multifactor-authentication/guardian). For general multi-factor discussion, read more [here](/multifactor-authentication). - -Get started using Guardian for Android below, or, if you're looking for a specific document, try the listing of [additional documents](#additional-documents) related to Guardian for Android. - -## Requirements - -Android API level 15+ is required in order to use the Guardian Android SDK. - -## Installation - -Guardian is available both in [Maven Central](http://search.maven.org) and [JCenter](https://bintray.com/bintray/jcenter). To start using *Guardian* add these lines to your `build.gradle` dependencies file: - -```gradle -compile 'com.auth0.android:guardian-sdk:0.2.0' -``` - -::: note -You can check for the latest version on the repository [Releases](https://github.com/auth0/GuardianSDK.Android/releases) tab, in [Maven](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.auth0.android%22%20AND%20a%3A%22guardian%22), or in [JCenter](https://bintray.com/auth0/android/Guardian.Android). -::: - -After adding your Gradle dependency, make sure to remember to sync your project with Gradle files. - -## Dashboard Settings - -To enable Guardian Push Notifications for your users, go to the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard. Then toggle the **Push Notification** slider to enable it. - -![](/media/articles/mfa/guardian-dashboard.png) - -## SNS configuration - -For your native application to receive push notifications from Guardian, you will need to override the default SNS settings. Follow the instructions [here](/multifactor-authentication/developer/sns-configuration). - -## Using the SDK - - -`Guardian` is the core of the SDK. You'll need to create an instance of this class for your specific tenant/url. - -```java -Uri url = Uri.parse("https://tenant.guardian.auth0.com/"); - -Guardian guardian = new Guardian.Builder() - .url(url) - .build(); -``` - -or - -```java -String domain = "tenant.guardian.auth0.com"; - -Guardian guardian = new Guardian.Builder() - .domain(domain) - .build(); -``` - - -### Enroll - -The link between the second factor (an instance of your app on a device) and an Auth0 account is referred to as an enrollment. - -You can create an enrollment using the `Guardian.enroll` function, but first you'll have to create a new pair of RSA keys for it. The private key will be used to sign the requests to allow or reject a login. The public key will be sent during the enroll process so the server can later verify the request's signature. - -```java -KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); -keyPairGenerator.initialize(2048); // you MUST use at least 2048 bit keys -KeyPair keyPair = keyPairGenerator.generateKeyPair(); -``` - -Next, obtain the enrollment information by scanning the Guardian QR code, and use it to enroll the account: - -```java -Uri enrollmentUriFromQr = ...; // the URI obtained from a Guardian QR code - -CurrentDevice device = new CurrentDevice(context, "gcmToken", "deviceName"); - -Enrollment enrollment = guardian - .enroll(enrollmentUriFromQr, device, keyPair) - .execute(); -``` - -Alternatively, you can execute the request in a background thread: - -```java -guardian - .enroll(enrollmentUriFromQr, device, keyPair) - .start(new Callback { - @Override - void onSuccess(Enrollment enrollment) { - // we have the enrollment data - } - - @Override - void onFailure(Throwable exception) { - // something failed - } - }); -``` - -The `deviceName` and `gcmToken` are data that you must provide: - -- The `deviceName` is the name that you want for the enrollment. It will be displayed to the user when the second factor is required. -- The `gcmToken` is the token for Google's GCM push notification service. See the [docs](https://developers.google.com/cloud-messaging/android/client#sample-register) for more information about the GCM token. - -### Unenroll - -To disable multi-factor authentication you can delete the enrollment: - -```java -guardian - .delete(enrollment) - .execute(); // or start(new Callback<> ...) -``` - -### Allow a login request - -Once you have the enrollment in place, you will receive a GCM push notification every time the user needs multi-factor authentication. - -Guardian provides a method to parse the `Bundle` received from GCM and return a `Notification` instance ready to be used. - -```java -// at the GCM listener you receive a Bundle -@Override -public void onMessageReceived(String from, Bundle data) { - Notification notification = Guardian.parseNotification(data); - if (notification != null) { - // you received a Guardian notification, handle it - handleGuardianNotification(notification); - return; - } - - /* handle other push notifications you might be using ... */ -} -``` - -Once you have the notification instance, you can easily approve the authentication request by using the `allow` method. You'll also need the enrollment that you obtained previously. If there are multiple enrollments, be sure to use the one that has the same `id` as the notification (the `enrollmentId` property). - -```java -guardian - .allow(notification, enrollment) - .execute(); // or start(new Callback<> ...) -``` - -### Reject a login request - -To deny an authentication request, use `reject` instead. You can optionally add a reason for the rejection, which will be available in the guardian logs. - -```java -guardian - .reject(notification, enrollment) // or reject(notification, enrollment, reason) - .execute(); // or start(new Callback<> ...) -``` - - - -## Additional Documents - -* [Configuring Amazon SNS with Guardian](/multifactor-authentication/developer/sns-configuration) -* [Getting Started with Google Cloud Messaging for Android](https://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html) diff --git a/articles/multifactor-authentication/developer/libraries/ios/index.md b/articles/multifactor-authentication/developer/libraries/ios/index.md deleted file mode 100644 index 3c64b517af..0000000000 --- a/articles/multifactor-authentication/developer/libraries/ios/index.md +++ /dev/null @@ -1,197 +0,0 @@ ---- -title: Getting Started with Guardian for iOS -url: /multifactor-authentication/developer/libraries/ios -description: Installation, usage, and configuration options guide for Guardian for iOS -topics: - - mfa - - guardian - - ios -contentType: - - how-to - - reference -useCase: - - customize-mfa ---- - -# Guardian for iOS -The [Guardian for iOS Software Development Kit](https://github.com/auth0/GuardianSDK.iOS) allows developers to create iOS apps with Guardian functionality, providing easy and secure access to multi-factor authentication with push notifications. For example, this toolkit gives you the power to build a 'white label' version of the Guardian application for your users, using your own look-and-feel. - -More information can be found on Guardian [here](/multifactor-authentication/guardian). For general multi-factor discussion, read more [here](/multifactor-authentication). - -Get started using Guardian for iOS below, or, if you're looking for a specific document, try the listing of [additional documents](#additional-documents) related to Guardian for iOS. - -## Requirements - -The Guardian iOS SDK requires iOS 9.3+ and Swift 3. - -## Installation - -### CocoaPods - -Guardian.swift is available through [CocoaPods](http://cocoapods.org). -To install it, simply add the following line to your Podfile: - -```ruby -pod "Guardian" -``` - -### Carthage - -In your Cartfile add this line - -``` -github "auth0/Guardian.swift" -``` - -## Dashboard Settings - -To enable Guardian Push Notifications for your users, go to the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard. Then toggle the **Push Notification** slider to enable it. - -![](/media/articles/mfa/guardian-dashboard.png) - -## SNS configuration - -For your native application to receive push notifications from Guardian, you will need to override the default SNS settings. Follow the instructions [here](/multifactor-authentication/developer/sns-configuration). - -## Using the SDK - -`Guardian` is the core of the SDK. To get things going you'll have to import the library: - -```swift -import Guardian -``` - -Then you'll need the Auth0 Guarduan domain for your account: - -```swift -let domain = "{YOUR_ACCOUNT_NAME}.guardian.auth0.com" -``` - -### Enroll - -An enrollment is a link between the second factor and an Auth0 account. When an account is enrolled you'll need it to provide the second factor required to verify the identity. - -For an enrollment you need the following things, besides your Guardian Domain: - -- Enrollment Uri: The value encoded in the QR Code scanned from Guardian Web Widget or in your enrollment ticket sent to you, for example, by email. -- APNS Token: Apple APNS token for the device and **MUST** be a `String`containing the 64 bytes (expressed in hexadecimal format) -- Key Pair: A RSA (Private/Public) key pair used to assert your identity with Auth0 Guardian - -::: note -In case your app is not yet using push notifications or you're not familiar with it, you should check their [docs](https://developer.apple.com/go/?id=push-notifications). -::: - -After your have all of them, you can enroll your device: - -```swift -Guardian - .enroll(forDomain: "{YOUR_GUARDIAN_DOMAIN}", - usingUri: "{ENROLLMENT_URI}", - notificationToken: "{APNS_TOKEN}", - keyPair: keyPair) - .start { result in - switch result { - case .success(let enrollment): - // success, we have the enrollment data available - case .failure(let cause): - // something failed, check cause to see what went wrong - } - } -``` - -On success you'll obtain the enrollment information, that should be secured stored in your application. This information includes the enrollment identifier, and the token for Guardian API associated to your device for updating or deleting your enrollment. - -#### RSA key pair - -Guardian.swift provides a convenience class to generate an RSA key pair and store it in iOS Keychain. - -```swift -let rsaKeyPair = RSAKeyPair.new( - usingPublicTag: "com.auth0.guardian.enroll.public", - privateTag: "com.auth0.guardian.enroll.private" - ) -``` - -::: note -The tags should be unique since it's the identifier of each key inside iOS Keychain. -::: - -::: note -Since the keys are already secured stored inside iOS Keychain, you olny need to store the identifiers -::: - -### Allow a login request - -Once you have the enrollment in place, you will receive a push notification every time the user has to validate their identity with MFA. - -Guardian provides a method to parse the data received from APNs and return a `Notification` instance ready to be used. - -```swift -if let notification = Guardian.notification(from: notificationPayload) { - // we have received a Guardian push notification -} -``` - -Once you have the notification instance, you can easily allow the authentication request by using -the `allow` method. You'll also need the enrollment that you obtained previously. -In case you have more than one enrollment, you'll have to find the one that has the same `id` as the -notification (the `enrollmentId` property). - -```swift -Guardian - .authentication(forDomain: "{YOUR_GUARDIAN_DOMAIN}", andEnrollment: enrollment) - .allow(notification: notification) - .start { result in - switch result { - case .success: - // the auth request was successfuly allowed - case .failure(let cause): - // something failed, check cause to see what went wrong - } - } -``` - -### Reject a login request - -To deny an authentication request just call `reject` instead. You can also send a reject reason if -you want. The reject reason will be available in the guardian logs. - -```swift -Guardian - .authentication(forDomain: "{YOUR_GUARDIAN_DOMAIN}", andEnrollment: enrollment) - .reject(notification: notification) - // or reject(notification: notification, withReason: "hacked") - .start { result in - switch result { - case .success: - // the auth request was successfuly rejected - case .failure(let cause): - // something failed, check cause to see what went wrong - } - } -``` - -### Unenroll - -If you want to delete an enrollment -for example if you want to disable MFA- you can make the -following request: - -```swift -Guardian - .api(forDomain: "{YOUR_GUARDIAN_DOMAIN}") - .device(forEnrollmentId: "{USER_ENROLLMENT_ID}", token: "{ENROLLMENT_DEVICE_TOKEN}") - .delete() - .start { result in - switch result { - case .success: - // success, the enrollment was deleted - case .failure(let cause): - // something failed, check cause to see what went wrong - } - } -``` - -## Additional Documents - -* [Configuring Amazon SNS with Guardian](/multifactor-authentication/developer/sns-configuration) -* [Getting Started with Apple Push Notification Service](https://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html) diff --git a/articles/multifactor-authentication/developer/sns-configuration.md b/articles/multifactor-authentication/developer/sns-configuration.md deleted file mode 100644 index 89d186de9b..0000000000 --- a/articles/multifactor-authentication/developer/sns-configuration.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -description: Describes how to configure Amazon SNS with Guardian Multi-factor -topics: - - mfa - - guardian - - amazon-sns -contentType: - - how-to - - concept -useCase: - - customize-mfa ---- -# Configuring Amazon SNS - -In order to receive push notifications from Guardian, it's necessary to override Guardian's default SNS settings. - -To do this, go to the [multi-factor Auth](${manage_url}/#/guardian) section of the dashboard and click on the **Push Notifications** box. - -![Push Notifications](/media/articles/mfa/push-notification-config.png) - -Enable the switch to use a custom app and provide the following values for your configuration: - -Name | Description ------|------------ -AWS Access Key Id | Your AWS access key id. -AWS Secret Access Key | Your AWS secret access key. -AWS Region | Your AWS application's region. -APNS ARN | The Amazon Resource Name for your [Apple Push Notification Service](http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html). -GCM ARN | The Amazon Resource Name for your [Google Cloud Messaging Service](http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html). - -Then click **SAVE**. - -## Keep reading - -::: next-steps -* [Auth0 Management API](/api/management/v2) -* [Getting Started with Apple Push Notification Service](https://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html) -* [Getting Started with Google Cloud Messaging for Android](https://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html) -::: diff --git a/articles/multifactor-authentication/duo/admin-guide.md b/articles/multifactor-authentication/duo/admin-guide.md deleted file mode 100644 index 2d876a2ea0..0000000000 --- a/articles/multifactor-authentication/duo/admin-guide.md +++ /dev/null @@ -1,108 +0,0 @@ ---- -description: Information for how to use Duo Security for administrators. -topics: - - mfa - - duo -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Duo for Administrators - -## Enabling Duo for MFA - -To turn on Duo for two-step verification, first visit the [Multi-factor Auth](${manage_url}/#/guardian) page from the dashboard. Then click on the link to use a different provider. - -![](/media/articles/mfa/change-provider.png) - -Then you can use the slider to turn on Duo. - -![](/media/articles/mfa/toggle-duo.png) - -::: note -If you enable Duo while using another provider for MFA, all other providers will be disabled. All customizations and enrolled users in other MFA will be lost. Be careful as this action cannot be reverted. -::: - -### Customize Duo - -After you toggle the slider to enable using Duo, a portal displays a code editing textbox containing the following code snippet for you to use: - -```JS -function (user, context, callback) { - - var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - // run only for the specified applications - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true - // if (user.user_metadata && user.user_metadata.use_mfa){ - context.multifactor = { - //required - provider: 'duo', - ikey: 'DIXBMN...LZO8IOS8', - skey: 'nZLxq8GK7....saKCOLPnh', - host: 'api-3....049.duosecurity.com', - - // optional, defaults to true. Set to false to force DuoSecurity every time. - // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details - allowRememberBrowser: false, - - // optional. Use some attribute of the profile as the username in DuoSecurity. This is also useful if you already have your users enrolled in Duo. - // username: user.nickname, - - // optional. Admin credentials. If you provide an Admin SDK type of credentials. auth0 will update the realname and email in DuoSecurity. - // admin: { - // ikey: 'DIAN...NV6UM', - // skey: 'YL8OVzvoeeh...I1uiYrKoHvuzHnSRj' - // }, - }; - // } - } - - callback(null, user, context); -} -``` - -#### Changing the Required Fields - -Required fields that you **must** replace to use Duo are: `ikey`, `skey` and `host`. - -1. To get these fields first [login to your Duo account](https://admin.duosecurity.com/login). - -2. Click on the **Applications** section from the sidebar. - -3. Then click on the button to **Protect an Application**. - -4. Find the **Auth API** option from the list and then click **Protect this Application**. - -5. Then you will be brought to the **Auth API** page under your Appications, you should see a **Details** section. - -6. Under the **Details** section you will see: - -* **Integration key** - use this for your `ikey` field -* **Secret key** - use this for your `skey` field -* **API hostname** - use this for your `host` field - -Replace the three fields in the code snippet. For more details about editing the other parts of this code snippet, [see Duo for Developers](/multifactor-authentication/duo/dev-guide#other-customizations). - -When you have finished editing the code snippet based on the requirements of your app, click **Save**. - -## Editing a User's Settings - -If you need to change the settings for logging in with Duo for one of your users or if a user has lost their mobile device, you will need to edit User setting on the Duo site. - -1. Visit [Duo.com](https://duo.com/) and login to your account. -2. Click **Users** from the sidebar. -3. Find the desired user and click their username. -4. From a User page you can edit their settings. - -## Disabling Duo - -Duo can be disabled from the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard then by clicking the link to use a different provider. - -![](/media/articles/mfa/change-provider.png) - -Toggle the slider button to disable Duo, then a confirmation popup will appear. - -By disabling Duo you will lose all customizations, but your previously enrolled users will still be visible in your Duo settings. diff --git a/articles/multifactor-authentication/duo/dev-guide.md b/articles/multifactor-authentication/duo/dev-guide.md deleted file mode 100644 index 71dc984bfa..0000000000 --- a/articles/multifactor-authentication/duo/dev-guide.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -description: Information for how to use Duo Security for developers. -topics: - - mfa - - duo -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Duo for Developers - -## Enabling Duo for MFA - -To turn on Duo for two-step verification, first visit the [Multi-factor Auth](${manage_url}/#/guardian) page from the dashboard. Then click on the link to use a different provider. - -![](/media/articles/mfa/change-provider.png) - -Then you can use the slider to turn on Duo. - -![](/media/articles/mfa/toggle-duo.png) - -### Customize Duo - -After you toggle the slider to enable using Duo, a portal displays a code editing textbox containing the following code snippet for you to use: - -```JS -function (user, context, callback) { - - var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - // run only for the specified clients - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true - // if (user.user_metadata && user.user_metadata.use_mfa){ - context.multifactor = { - //required - provider: 'duo', - ikey: 'DIXBMN...LZO8IOS8', - skey: 'nZLxq8GK7....saKCOLPnh', - host: 'api-3....049.duosecurity.com', - - // optional, defaults to true. Set to false to force DuoSecurity every time. - // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details - allowRememberBrowser: false, - - // optional. Use some attribute of the profile as the username in DuoSecurity. This is also useful if you already have your users enrolled in Duo. - // username: user.nickname, - - // optional. Admin credentials. If you provide an Admin SDK type of credentials. auth0 will update the realname and email in DuoSecurity. - // admin: { - // ikey: 'DIAN...NV6UM', - // skey: 'YL8OVzvoeeh...I1uiYrKoHvuzHnSRj' - // }, - }; - // } - } - - callback(null, user, context); -} -``` - -### Changing the Required Fields - -Required fields that you **must** replace to use Duo are: `ikey`, `skey` and `host`. - -1. To get these fields first [login to your Duo account](https://admin.duosecurity.com/login). - -2. Click on the **Applications** section from the sidebar. - -3. Then click on the button to **Protect an Application**. - -4. Find the **Auth API** option from the list and then click **Protect this Application**. - -5. Then you will be brought to the **Auth API** page under your Appications, you should see a **Details** section. - -6. Under the **Details** section you will see: - -* **Integration key** - use this for your `ikey` field -* **Secret key** - use this for your `skey` field -* **API hostname** - use this for your `host` field - -Replace the three fields in the code snippet, and click **SAVE**. - -[Click here to learn more about Duo's Auth API](https://duo.com/docs/authapi) - -## Other Customizations - -### Use Duo only for Specified Users - -#### Based on your Application -To use Duo for logins only for the specified applications, replace `REPLACE_WITH_YOUR_CLIENT_ID` field with the Client ID of the application you wish to use. You can find your Client ID(s) under the [Applications](${manage_url}/#/applications) section of the dashboard and then clicking the application you wish to use. - -To use Duo for users of all your applications, you can comment or remove the sections regarding `CLIENTS_WITH_MFA`. - -#### Specify users to use MFA -To only use Duo for MFA on users that have `user_metadata.use_mfa === true` uncomment this if block. This field can be updated using the [Management APIv2](/api/management/v2#!/Users/patch_users_by_id). - -### Setting `allowRememberBrowser: false` -If `allowRememberBrowser: true` is set, or if the field is left unset, then users will not have to login with Duo everytime they login. The browser will save a cookie that will persist for 30 days and this cannot be undone. - -### Changing the Username sent to Duo -To use a specific attribute of the profile as the username in DuoSecurity, uncomment `username: user.nickname` and change it to the attribute you wish to use. This is also useful if you already have your users enrolled in Duo. - -### Setting Admin Credentials -If you provide an Admin SDK type of credentials then Auth0 will update the realname and email in Duo. To do this, replace the `ikey` and `skey` with the integration key and secret key. diff --git a/articles/multifactor-authentication/duo/duo-landing.md b/articles/multifactor-authentication/duo/duo-landing.md deleted file mode 100644 index 2c6b69312f..0000000000 --- a/articles/multifactor-authentication/duo/duo-landing.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Duo Security with Auth0 -description: Links to documentation on using Duo with Auth0 for each user type. -url: /multifactor-authentication/duo -topics: - - mfa - - duo -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Duo Security - -Duo Security is a vendor of cloud-based two-factor authentication services. If you have an account with Duo it is easy to integrate Duo's two-factor authentication into your Auth0 application. - -**Click the link below that most fits your role to learn more:** - -[Duo Security for Administrators](/multifactor-authentication/duo/admin-guide) - this page explains how to setup using Duo, how to reset accounts and how to disable using Duo. - -[Duo Security for Developers](/multifactor-authentication/duo/dev-guide) - this page explains how to enable using Duo for two-factor auth and details on how to configure it to meet your needs. - -[Duo Security for Users](/multifactor-authentication/duo/user-guide) - this page is for users logging into your application using Duo. It also has troubleshooting tips for any issues they may encounter. diff --git a/articles/multifactor-authentication/duo/user-guide.md b/articles/multifactor-authentication/duo/user-guide.md deleted file mode 100644 index f71fad69ec..0000000000 --- a/articles/multifactor-authentication/duo/user-guide.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -description: Information for how to use Duo Security for users. -topics: - - mfa - - duo -contentType: - - how-to -useCase: - - customize-mfa ---- - -# How to Use Duo - -Duo is a service and has a mobile app used for two-factor authentication when logging into an application, which helps create a more secure login. With two-factor authentication you will always need your mobile device when you log in. - -This page will help to explain how to sign up and log in using Duo. - -## Signing Up - -After entering your username and password see [Duo's Enrollment Guide](https://guide.duo.com/enrollment) for help with the sign up process. - -## Logging In - -When you are logging in, first enter you username and password. Then you will see a page to choose how to use Duo to complete your login. - -![](/media/articles/mfa/duo-login.png) - -### Send me a Push -If you choose this option, you must have the Duo App installed on your device. The app will send you a push notification, choose Accept to login. - -### Call me -If you choose this option, you will receive an automated call from Duo. Answer the call and press any key to finish logging in. - -### Enter a Passcode -If you choose this option, you must have the Duo App installed on your device. Open the app on your device and then click on the key icon next to the name of the application you are logging into. This will reveal a six-digit code, enter this passcode and then click **Log In** to continue. - -## Troubleshooting - -### If you do not have your mobile device - -If you have lost your phone and are unable to finish the two-step authentication you will need to contact your system administrator for help accessing your account. - -### If you forgot your password - -If you forgot your password when you are trying to login, click **Don't remember your password?** underneath the login. Enter your email to receive an email that will contain a link to reset your password. - -### Additional Help - -For other issues/questions regarding Duo [see here.](https://guide.duo.com) diff --git a/articles/multifactor-authentication/google-auth/admin-guide.md b/articles/multifactor-authentication/google-auth/admin-guide.md deleted file mode 100644 index 7fa096a3d2..0000000000 --- a/articles/multifactor-authentication/google-auth/admin-guide.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -description: Using Google Authenticator with Auth0 for administrators -topics: - - mfa - - google - - google-autheticator -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Google Authenticator for Administrators - -## Enabling Google Authenticator for MFA - -To turn on Google Authenticator for two-step verification, first visit the [Multi-factor Auth](${manage_url}/#/guardian) page from the dashboard. Then click on the link to use a different provider. - -![](/media/articles/mfa/change-provider.png) - -Then you can use the slider to turn on Google Authenticator. - -![](/media/articles/mfa/toggle-google-auth.png) - -::: note -If you enable Google Authenticator while using another provider for MFA, all other providers will be disabled. All customizations and enrolled users in other MFA will be lost. Be careful as this action cannot be reverted. -::: - -## Google Authenticator Supported Devices - -Your users must have a supported device to use the Google Authenticator app. If some of your users have an unsupported device type, they may be able to use Auth0's Guardian app instead of Google Authenticator. [Click here for information on using Guardian.](/multifactor-authentication/guardian/admin-guide) - -| **OS** | **Google Authenticator** | -| --- | --- | -| **iOS** | Requires iOS 5.0 or later | -| **Android** | Requires Android version 2.1 or later | -| **Windows** | Unsupported | -| **Blackberry** | Requires OS 4.5-7.0 | -| **Other** | Unsupported | - -## Customize Google Authenticator - -Once you have turned on Google Authenticator, the portal displays a code editing textbox containing the following code snippet for you to use: - -```JS -function (user, context, callback) { - // Uncomment the following to skip MFA when impersonating a user - // if (user.impersonated) { return callback(null, user, context); } - - var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - // run only for the specified clients - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // uncomment the following if clause in case you want to request a second factor only from users that have app_metadata.use_mfa === true - // if (user.app_metadata && user.app_metadata.use_mfa){ - context.multifactor = { - provider: 'google-authenticator', - // issuer: 'Label on Google Authenticator App', // optional - - // optional, defaults to true. Set to false to force Google Authenticator every time. - // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details - allowRememberBrowser: false, - }; - // } - } - - callback(null, user, context); -} -``` - -When you have finished editing the code snippet based on the requirements of your app, click **Save**. - -::: panel Screen customization -At this time Google Authenticator does not allow any customizations to the look and feel of the Google Authenticator screens. For other customization options [see Auth0 Guardian](/multifactor-authentication/administrator#customization). -::: - -## Reset a MFA for a User - -If a user has lost their mobile device, you as an administrator will need to reset their MFA. - -To reset a user's MFA: - -1. Find and select the user in the [Users](${manage_url}/#/users) section of the dashboard. -2. Once you have selected the affected user click on the **Actions** button on the top right of the screen. -3. Select **Reset Multi Factor (Google)** from the dropdown. -4. There will be a pop up box to confirm your decision, click **YES, RESET IT** to reset the user's MFA. - -![](/media/articles/mfa/reset-google-mfa.png) - -The next time the user logs in they will need to resetup their MFA just like a new user. - -## Disabling Google Authenticator - -Google Authenticator can be disabled from the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard then by clicking the link to use a different provider. - -![](/media/articles/mfa/change-provider.png) - -Toggle the slider button to disable Google Authenticator, then a confirmation popup will appear. - -By disabling a type of MFA you will lose all customizations. diff --git a/articles/multifactor-authentication/google-auth/dev-guide.md b/articles/multifactor-authentication/google-auth/dev-guide.md deleted file mode 100644 index 0f65cb7302..0000000000 --- a/articles/multifactor-authentication/google-auth/dev-guide.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -description: Using Google Authenticator with Auth0 for developers -topics: - - mfa - - google - - google-autheticator -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Google Authenticator for Developers - -## Enabling Google Authenticator for MFA - -To turn on Google Authenticator for two-step verification, first visit the [Multi-factor Auth](${manage_url}/#/guardian) page from the dashboard. Then click on the link to use a different provider. - -![](/media/articles/mfa/change-provider.png) - -Then you can use the slider to turn on Google Authenticator. - -![](/media/articles/mfa/toggle-google-auth.png) - -## Customize Google Authenticator - -Once you have turned on Google Authenticator, the portal displays a code editing textbox containing the following code snippet for you to use: - -```JS -function (user, context, callback) { - - var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - // run only for the specified clients - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true - // if (user.user_metadata && user.user_metadata.use_mfa){ - context.multifactor = { - provider: 'google-authenticator', - // issuer: 'Label on Google Authenticator App', // optional - // key: 'YOUR_KEY_HERE', // optional, the key to use for TOTP. by default one is generated for you - - // optional, defaults to true. Set to false to force Google Authenticator every time. - // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details - allowRememberBrowser: false - }; - // } - } - - callback(null, user, context); -} -``` - -When you have finished editing the code snippet based on the requirements of your app, click **Save**. - -::: panel Screen customization -The Google Authenticator widget inherits from the Guardian widget. To customize the Google Authenticator screen, [customize the Guardian screen](/multifactor-authentication/administrator/customizing-widget) in your [tenant settings](${manage_url}/#/tenant). -::: - -### Configuring Google Authenticator for Select Users - -You may choose to enable Google Authenticator only for select users. Within the Customize MFA code snippet, you may include the conditions for Google Authenticator is enabled. - -For example, suppose you want to *omit* MFA for all users signing in from the `foo.com` domain. - - -```js -function (user, context, callback) { - - if (context.connection !== 'foo.com'){ - context.multifactor = { - provider: 'google-authenticator', //required - }; - } - - callback(null, user, context); -} -``` - -Once you have finished making your desired changes, click **SAVE** so that they persist. diff --git a/articles/multifactor-authentication/google-auth/google-landing.md b/articles/multifactor-authentication/google-auth/google-landing.md deleted file mode 100644 index 2e2e69d8b2..0000000000 --- a/articles/multifactor-authentication/google-auth/google-landing.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: Multi-factor Authentication - Google Authenticator -description: Links to Google Authentication with Auth0 documentation for each type of user role. -url: /multifactor-authentication/google-authenticator -topics: - - mfa - - google - - google-autheticator -contentType: - - index -useCase: - - customize-mfa ---- - -# Google Authenticator - -Google Authenticator is a mobile application made by Google that implements two-step verification. Authenticator provides a six to eight digit one-time password which users must provide in addition to their username and password to log into an application. - -**Click the link below that most fits your role to learn more:** - -[Google Authenticator for Administrators](/multifactor-authentication/google-auth/admin-guide) - this page explains how to enable/disable using Google Authenticator, how to reset accounts, supported devices and customization. - -[Google Authenticator for Developers](/multifactor-authentication/google-auth/dev-guide) - this page explains how to enable Google Authenticator and details on how to configure it to meet your needs. - -[Google Authenticator for Users](/multifactor-authentication/google-auth/user-guide) - this page is for users logging into your application using Google Authenticator. It also has troubleshooting tips for any issues they may encounter. diff --git a/articles/multifactor-authentication/google-auth/user-guide.md b/articles/multifactor-authentication/google-auth/user-guide.md deleted file mode 100644 index 47fbef24b2..0000000000 --- a/articles/multifactor-authentication/google-auth/user-guide.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -description: How to sign-up and login using the Google Authenticator app. -topics: - - mfa - - google - - google-autheticator -contentType: - - how-to -useCase: - - customize-mfa ---- - -# How to Use Google Authenticator - -Google Authenticator is a mobile app used for two-factor authentication when logging into an application, which helps create a more secure login. With two-factor authentication you will always need your mobile device when you log in. - -This page will help to explain how to sign up and log in using the Google Authenticator app. - -## Download the Google Authenticator App - -### Android -Requirements: Must be running Android version 2.1 or later. - -To download the app: - -1. Visit [Google Play](https://play.google.com/store). -2. Search for Google Authenticator. -3. Download and install the application. - -### iOS -Requirements: Must have iOS 5.0 or later. In addition, in order to set up the app on your iPhone using a QR code, you must have a 3G model or later. - -To download the app: - -1. Visit the [iTunes App Store](https://itunes.apple.com/us/genre/ios/id36). -2. Search for Google Authenticator. -3. Download and install the application. - -### Blackberry - -Requirements: Must have OS 4.5-7.0. In addition, make sure your BlackBerry device is configured for US English -- you might not be able to download Google Authenticator if your device is operating in another language. - -To download the app: - -1. Open the web browser on your BlackBerry. -2. Visit [m.google.com/authenticator](https://m.google.com/authenticator). -3. Download and install the application. - -## Sign Up as a New User - -If you do not have an existing account, you will need to sign up to create one. Click the **SIGN UP** button and enter your email and create a password. - -![](/media/articles/mfa/sign-up.png) - -You will need to download Google Authenticator app. - -A code will appear, and you will have five minutes to scan the code before it expires. After scanning the code, you will get a six digit code to enter. Once you enter this code you will be logged in. - -![](/media/articles/mfa/google-code.png) - -## Logging in - -After entering your username and password, you will be prompted for a six digit code. Open the Google Authenticator app on your mobile device to find the correct code. If you use Google Authenticator for other applications as well, make sure you are using the code for the current application. After entering the six digit code you will be logged in. - -## Troubleshooting - -### If you do not have your mobile device - -If you have lost your phone and are unable to finish the two-step authentication you will need to contact your system administrator for help accessing your account. - -### If you forgot your password - -If you forgot your password when you are trying to login, click **Don't remember your password?** underneath the login. Enter your email to receive an email that will contain a link to reset your password. - -### Transaction Expiration - -For logging in with Google Authenticator, there is a timeout that occurs with the passcode where it will expire. Try logging in again if you do not see a refreshed passcode in the app. - -### Additional Help - -For other issues/questions regarding Google Authenticator, see: [Install Google Authenticator](https://support.google.com/accounts/answer/1066447). diff --git a/articles/multifactor-authentication/guardian/admin-guide.md b/articles/multifactor-authentication/guardian/admin-guide.md deleted file mode 100644 index e224cb9871..0000000000 --- a/articles/multifactor-authentication/guardian/admin-guide.md +++ /dev/null @@ -1,195 +0,0 @@ ---- -description: How to enable and use Push Notifications and SMS for Guardian MFA. -toc: true -topics: - - mfa - - guardian - - push-notifications -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Guardian for Administrators - -Guardian is Auth0's multi-factor authentication (MFA) application that provides a simple, safe way for you to implement MFA. The Guardian app is used for two-factor authentication when logging into an application, which helps create a more secure login. With two-factor authentication your users will always need their mobile device in order to login. - -This page explains how to enable and use Push Notifications and SMS for MFA for signing in your users. - -For more information on Guardian, how to download the app, and common questions, see: [How to Use the Guardian App](/multifactor-authentication/guardian/user-guide). - -## Support for Push Notifications - -To enable Push Notifications MFA for sign in and sign up for your application by your users, go to the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard. Then toggle the **Push Notification** slider to enable it. - -![Dashboard > Guardian](/media/articles/mfa/guardian-dashboard.png) - -For your users to utilize this type of MFA, they will need a supported mobile device. The device must have either the Guardian app installed, the Google Authenticator app installed, or an app that supports scanning Time-based One-time Password (TOTP) codes to use with Guardian. Here are the available options: - -| **OS** | **Guardian** | **Google Authenticator** | -| --- | --- | --- | -| **iOS** | Requires iOS 9.0 or later| Requires iOS 5.0 or later | -| **Android** | Requires Android API version 18 or later| Requires Android version 2.1 or later | -| **Windows** | Guardian codes are supported using the Microsoft Authenticator app available for Windows 10 Mobile and Windows Phone 8/8.1 | Unsupported | -| **Blackberry** | Must use a TOTP scanning app | Requires OS 4.5-7.0 | -| **Other** | Must use a TOTP scanning app | Unsupported | - -::: note -For more information on using the Google Authenticator app, refer to [Google Authenticator](/multifactor-authentication/google-authenticator). -::: - -New users signing up will be prompted to download the Guardian app from either the App Store or Google Play. Once they indicate that they downloaded the app, a code will appear. They will have five minutes to scan the code with the app before it expires. After the code has been successfully scanned, users will see a confirmation screen which includes a recovery code. They need to have this recovery code to login without their mobile device. If they lose both the recovery code and their mobile device, you will need to [reset their MFA](#reset-an-mfa-for-a-user). Then they will receive a push notification to their device and they will be logged in. - -Users that were previously registered before you enabled MFA will need to complete the same process as new users on their next login. - -## Support for SMS - -You can enable SMS messages to use as a form of multi-factor authentication. This is also under the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard. By toggling the **SMS** slider, you can enable using SMS for sign in and sign up for your application. SMS can be used as your only form of MFA or in addition to Push Notifications. - -Your users must have a device capable of using SMS to use this option. If your users are unable to always receive SMS messages (such as when traveling), they will be unable sign up with SMS and unable to login without the recovery code. - -When your users sign up with SMS, they enter their phone number's country code and mobile phone number. - -![](/media/articles/mfa/sms.png) - -After sign up, they receive a six digit code to their phone. They need to enter this code into the box, and then they will get a recovery code. They will need this code to login if they do not have their device. If they have lost their recovery code and device, you will need to [reset the user's MFA](#reset-an-mfa-for-a-user). - -::: panel Rate Limits - -Each hour, any given user is allotted a maximum of ten failed SMS attempts. After that, Auth0 considers all OTP codes invalid, and any additional attempts to log in results in a `Too Many Attempts` error. - -More specifically, this means that if someone enters in the code incorrectly ten or more times within an hour, they will need to wait six minutes to gain another attempt. If the user attempts another code before sufficient time has elapsed, Auth0 considers all OTP codes invalid (even if they aren't expired). -::: - -### Configuring Guardian SMS with Twilio - -When initially setting up SMS, you have up to 100 SMS to be used for testing. This limit can be removed by setting up a Twilio account. To prevent malicious login attempts, your users will always be limited to up to 10 SMS/Hour (replenishing one message an hour, up to 10). - -Click on the **SMS** box to configure your SMS settings. - -![](/media/articles/mfa/sms-config.png) - -#### 1. Open an account with Twilio - -You will need a [Twilio Account SID](https://www.twilio.com/help/faq/twilio-basics/what-is-an-application-sid) and a [Twilio Auth Token](https://www.twilio.com/help/faq/twilio-basics/what-is-the-auth-token-and-how-can-i-change-it). These are the Twilio API credentials that Auth0 will use to send an SMS to the user. You may also need to enable permissions for your [geographic region](https://support.twilio.com/hc/en-us/articles/223181108-How-International-SMS-Permissions-work). - -#### 2. Configure the connection - -Enter your **Twilio Account SID** and **Twilio Auth Token** in the appropriate fields. - -Choose your **SMS Source**. - -* If you choose **Use From**, you will need to enter the **From** phone number that users will see as the sender of the SMS. You may also configure this in Twilio. - -* If you choose **Use Copilot **, you will need to enter a [Copilot SID](https://www.twilio.com/docs/api/rest/sending-messages-copilot). - -Click **SAVE**. - -## Customize MFA for Select Users - -Once you have enabled either MFA option, you will be presented with the **Customize MFA** code snippet that you can edit to ensure that MFA is applied to the appropriate Applications. By default, Auth0 enables Guardian for all accounts. - -```js -function (user, context, callback) { - - //var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - // run only for the specified applications - // if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true - // if (user.user_metadata && user.user_metadata.use_mfa){ - context.multifactor = { - provider: 'guardian', //required - - // optional, defaults to true. Set to false to force MFA authentication every time. - // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details - allowRememberBrowser: false - }; - // } - //} - - callback(null, user, context); -} -``` - -If you choose to selectively apply MFA, you will need the appropriate `clientID` values, and the code will be executed as part of a [Rule](/rules) whenever a user logs in. - -More specifically, you will uncomment and populate the following line of the **Customize MFA** snippet with the appropriate client IDs: - -`var CLIENTS_WITH_MFA = ['REPLACE_WITH_CLIENT_ID'];` - -By setting `allowRememberBrowser: false`, the user will always be prompted for MFA when they login. This prevents the browser cookie from saving the credentials and helps make logins more secure, especially from untrusted machines. See [here](/multifactor-authentication/custom#change-the-frequency-of-authentication-requests) for details - -Once you have finished making your desired changes, click **Save**. - -## Customizing the Guardian Screen - -You may change the logo and the friendly name that is displayed to your users. To do so, make the appropriate changes to the Guardian page settings on the [Tenant Settings](${manage_url}/#/tenant) page. You may also reach the **Tenant Settings** page by clicking on your tenant name on the top right of the page and then selecting **Settings** from the dropdown menu that appears. - -![](/media/articles/mfa/guardian-logo-and-name-settings.png) - - * **Friendly Name**: the name of the app that you want displayed to users - * **Logo URL**: the URL that points to the logo image you want displayed to users - -Auth0 recommends using a logo image that is at least 100x100 pixels, although an image that is 200x200 pixels ensures quality viewing in devices with Retina or high DPI displays. - -## Tracking your Users MFA Events - -In the [Logs](${manage_url}/#/logs) section of the dashboard, you can see the various events related to your users signing up and signing in using MFA. - -![](/media/articles/mfa/logs.png) - -Here are all the possible events related to MFA: - -| Event Type | Description | -| --- | --- | -| `gd_unenroll` | When a device account is deleted | -| `gd_update_device_account` | When a device account is updated | -| `gd_send_pn` | When a push notification is sent | -| `gd_send_sms` | When a SMS is sent | -| `gd_sms_failure` | When a SMS failed to be sent. It usually means a configuration mistake for Twilio provider. You can check the provider error message and code as part of the details. | -| `gd_start_auth` | Start second factor authentication | -| `gd_start_enroll` | Second factor auth enrollment is started | -| `gd_enrollment_complete` | Second factor enrollment has been completed | -| `gd_module_switch` | When changing feature config | -| `gd_tenant_update` | When tenant info has been updated | -| `gd_user_delete` | When calling (user delete => unenroll) | -| `gd_auth_failed` | When second factor login has failed | -| `gd_auth_succeed` | When second factor authentication has succeeded | -| `gd_recovery_succeed` | Recovery succeeded | -| `gd_recovery_failed` | Failed recovery | -| `gd_otp_rate_limit_exceed` | When One Time Password fails validation because rate limit is exceeded | -| `gd_recovery_rate_limit_exceed` | When recovery validation fails because rate limit is exceeded | - -These events can also be searched using the [Management APIv2](/api/management/v2#!/Logs) using [query string syntax](/api/management/v2/query-string-syntax). You can search criteria using the `q` parameter or you can search by a specific log ID. - -### Examples searching with the `q` parameter - -To see the events for users who are enrolling with MFA: - -`type: gd_start_enroll` - -To see all the times an SMS is sent: - -`type: gd_send_sms` - -## Reset an MFA for a User - -If a user has lost their mobile device, they will need their recovery code to be able to log in. If they have also lost their recovery code, you, as an administrator, will need to reset their MFA. - -To reset a user's MFA: - -1. Find and select the user in the [Users](${manage_url}/#/users) section of the dashboard. -2. Once you have selected the affected user, click on the **Actions** button on the top right of the screen. -3. Select **Reset Multi-factor Authentication** from the dropdown. -4. There will be a pop up box to confirm your decision. Click **YES, RESET IT** to reset the user's MFA. - - ![](/media/articles/mfa/reset-mfa.png) - -The next time the user logs in they will need to re-setup their MFA just like a new user. - -## Disabling Guardian and other MFA - -Guardian, and other types of MFA, can be disabled from the [Multi-factor Auth](${manage_url}/#/guardian) section of the dashboard. Toggle the button to disabled for the type of MFA you wish to turn off. A confirmation popup will appear. - -By disabling a type of MFA, you will un-enroll all your current users of that type of MFA. They will be asked to re-enroll next time they try to login. This action cannot be reverted. diff --git a/articles/multifactor-authentication/guardian/dev-guide.md b/articles/multifactor-authentication/guardian/dev-guide.md deleted file mode 100644 index 4705df17f4..0000000000 --- a/articles/multifactor-authentication/guardian/dev-guide.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -description: How to implement multi-factor authentication with Guardian. -topics: - - mfa - - guardian - - push-notifications -contentType: - - how-to -useCase: - - customize-mfa ---- - -# Developer Guide to Configuring Guardian - -Guardian is Auth0's multi-factor authentication (MFA) application that provides a simple, safe way for you to implement MFA. The Guardian app is currently available for mobile devices running iOS or Android. - -For applications where Guardian MFA is enabled, the user will be required to sign in **and** confirm the login with a verified mobile device. You can find additional information on user login and sign-up process and common user questions at: [How to Use the Guardian App](/multifactor-authentication/guardian/user-guide). - -## Implementing Multi-factor Authentication - -Within Auth0, you may implement MFA via the [Multi-factor Auth](${manage_url}/#/guardian) page of the Management Dashboard. - -![](/media/articles/mfa/guardian-dashboard.png) - -::: panel MFA options -Auth0 provides [built-in support](/multifactor-authentication) for MFA using Google Authenticator or Duo. You may choose to use either of these providers, in lieu of Guardian, or any code generator application, on the **Multi-factor Auth** page of the Management Dashboard. -::: - -### Configuring Guardian in the Management Dashboard - -The first thing you will do when setting up Guardian is to decide whether you would like MFA to occur via push notifications, SMS, or both. - -* **Push Notifications**: the user receives, via the Guardian app, a push notification that requires their input prior to gaining access to the app. Or, instead, if the user chooses, they can use the Google Authenticator app in a similar way. -* **SMS**: the user receives, via SMS, a code that they are required to enter prior to gaining access to the app. - -To enable either Push Notifications or SMS verification, move the appropriate slider to the right. - -![](/media/articles/mfa/guardian-both.png) - -Once you have enabled either option, you will be presented with the **Customize MFA** code snippet that is applied automatically as a new [Rule](/rules). This rule will be executed in Auth0 as part of the transaction everytime a user authenticates to your application. By default, Auth0 enables Guardian for everything, but you may edit the rule so that MFA is applied only to some applications or users, as shown below. - - -```js -function (user, context, callback) { - - //var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - // run only for the specified applications - // if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // uncomment the following if clause in case you want to request a second factor only from user's that have user_metadata.use_mfa === true - // if (user.user_metadata && user.user_metadata.use_mfa){ - context.multifactor = { - provider: 'guardian', //required - - // optional, defaults to true. Set to false to force MFA authentication every time. - // See https://auth0.com/docs/multifactor-authentication/custom#change-the-frequency-of-authentication-requests for details - allowRememberBrowser: false - }; - // } - //} - - callback(null, user, context); -} -``` - -If you choose to selectively apply MFA, you will need the appropriate `clientID` values, and the code is executed as part of a [Rule](/rules) whenever a user logs in. - -More specifically, you will uncomment and populate the following line of the Customize MFA snippet with the appropriate application's client IDs: - -```js -var CLIENTS_WITH_MFA = ['REPLACE_WITH_CLIENT_ID']; -``` - -Once you have finished making your desired changes, click "Save" so that they persist. - -### Configuring Guardian for Select Users - -You may choose to enable Guardian only for select users. Within the Customize MFA code snippet, you may include the conditions for when Guardian is enabled. - -For example, suppose you want to disable MFA for all users signing in from the `foo.com` domain. - - -```js -function (user, context, callback) { - - if (context.connection !== 'foo.com'){ - context.multifactor = { - provider: 'guardian', //required - }; - } - - callback(null, user, context); -} -``` - -Once you have finished making your desired changes, click **Save** so that they persist. - -### Customizing the Guardian Screen - -You may change the logo and the friendly name that is displayed to your users. To do so, make the appropriate changes to the Guardian page settings on the [Tenant Settings](${manage_url}/#/tenant) page. You may also reach the **Tenant Settings** page by clicking on your tenant name on the top right of the page and then selecting **Settings** from the dropdown menu that appears. - -![](/media/articles/mfa/guardian-logo-and-name-settings.png) - -* **Friendly Name**: the name of the app that you want displayed to the users; -* **Logo URL**: the URL that points to the logo image you want displayed to your users. - -Auth0 recommends using a logo image that is at least 100x100 pixels, though an image that is 200x200 pixels ensures quality viewing in devices with Retina or high DPI displays. - -## Tracking and Searching MFA Events - -All MFA related events are recorded for audit purposes. For example, each time a new user enrolls with a form of MFA enabled, an **Enroll started** event is triggered. - -![](/media/articles/mfa/log-example.png) - -You can view events in the [Logs](${manage_url}/#/logs) sections of the dashboard. - -![](/media/articles/mfa/logs.png) - -Here are all the possible events related to MFA: - -| Event Name | Description | -| --- | --- | -| `gd_unenroll` | When a device account is deleted | -| `gd_update_device_account` | When a device account is updated | -| `gd_send_pn` | When a push notification is sent | -| `gd_send_sms` | When a SMS is sent | -| `gd_sms_failure` | When a SMS failed to be sent. It usually means a configuration mistake for Twilio provider. You can check the provider error message and code as part of the details. | -| `gd_start_auth` | Start second factor authentication | -| `gd_start_enroll` | Second factor auth enrollment is started | -| `gd_module_switch` | When changing feature config | -| `gd_tenant_update` | When tenant info has been updated | -| `gd_user_delete` | When calling (user delete => unenroll) | -| `gd_auth_failed` | When second factor login has failed | -| `gd_auth_succeed` | When second factor authentication has succeeded | -| `gd_recovery_succeed` | Recovery succeeded | -| `gd_recovery_failed` | Failed recovery | -| `gd_otp_rate_limit_exceed` | When One Time Password fails validation because rate limit is exceeded | -| `gd_recovery_rate_limit_exceed` | When recovery validation fails because rate limit is exceeded | - -These events can also be searched using the [Management APIv2](/api/management/v2#!/Logs) using [query string syntax](/api/management/v2/query-string-syntax). You can search criteria using the `q` parameter or you can search by a specific log ID. diff --git a/articles/multifactor-authentication/guardian/index.md b/articles/multifactor-authentication/guardian/index.md deleted file mode 100644 index 31dbe2bfbc..0000000000 --- a/articles/multifactor-authentication/guardian/index.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Auth0 Guardian -description: Links to Guardian documentation for each type of Guardian user role. -topics: - - mfa - - guardian - - push-notifications -contentType: - - index -useCase: - - customize-mfa ---- - -# Auth0 Guardian - -Guardian is Auth0's multi-factor authentication solution that provides a simple and secure way to implement MFA. When using Guardian with Auth0, users will be prompted for additional authentication from the Guardian mobile application, helping to provide a more secure login. - -**To learn more, click the link below that most suits your role:** - -[Guardian for Administrators](/multifactor-authentication/administrator) - information on how to enable and configure Guardian. - -[Guardian for Developers](/multifactor-authentication/developer) - learn how to customize Guardian to your needs, and use multi-factor within your applications. - -[Guardian for Users](/multifactor-authentication/guardian/user-guide) - this page is for users logging into your application using Guardian, Google Authenticator or SMS. It also has troubleshooting tips for any issues they may encounter. diff --git a/articles/multifactor-authentication/guardian/user-guide.md b/articles/multifactor-authentication/guardian/user-guide.md deleted file mode 100644 index 3c28412f24..0000000000 --- a/articles/multifactor-authentication/guardian/user-guide.md +++ /dev/null @@ -1,139 +0,0 @@ ---- -description: How to sign-up and login using the Guardian app. -toc: true -topics: - - mfa - - guardian - - push-notifications -contentType: - - how-to -useCase: - - customize-mfa ---- -# How to Use the Guardian App - -Guardian is an app that can be downloaded from the [App Store](https://itunes.apple.com/us/app/auth0-guardian/id1093447833) or from [Google Play](https://play.google.com/store/apps/details?id=com.auth0.guardian). The Guardian app is used for two-factor authentication when logging into an application, which helps create a more secure login. With two-factor authentication you will always need your mobile device when you log in. - -This page will help to explain how to sign up and log in using the Guardian app and using other forms of two-factor authentication. - -## Enroll for MFA - -Enrolling for MFA is a separate, distinct step from the initial sign-up for Auth0. Typically, the user is prompted to enroll the first time they attempt to sign-in to an application protected by MFA. Additionally, administrators have the ability to [invite users to enroll](multifactor-authentication/administrator/guardian-enrollment-email). - -If you choose to enroll from the Guardian widget, then following your initial authentication you will see the option to download the Auth0 Guardian app from the [App Store](https://itunes.apple.com/us/app/auth0-guardian/id1093447833) or from [Google Play](https://play.google.com/store/apps/details?id=com.auth0.guardian). - -Underneath that, there is the option to use [Google Authenticator](#google-authenticator) or [SMS](#sms) depending on the application's settings. - -![Guardian widget enroll](/media/articles/mfa/choose-mfa.png) - -Choose the type of two-factor to use: the Guardian app, the Google Authenticator app, or an SMS. - -### Guardian - -To use the Guardian app, first download either the [iOS](https://itunes.apple.com/us/app/auth0-guardian/id1093447833) or [Android](https://play.google.com/store/apps/details?id=com.auth0.guardian) app depending on the type of device you have. Once you have Guardian downloaded, click **I've already downloaded it**. - -Next, a code will appear, you will have five minutes to scan the code before it expires. Open the Guardian app and scan the code. - -![Guardian code](/media/articles/mfa/guardian-code.png) - -After the code has been successfully scanned, you will see a confirmation screen which includes a recovery code. If for some reason you do not have your mobile device, you will need this recovery code to login. Make sure to take note of this code and keep it somewhere safe. Check the box that you have recorded the code, and then you are logged in. - -![Guardian recover code](/media/articles/mfa/guardian-recover-code.png) - -::: panel Passphrase for Android Users -After first enrolling using the Guardian app for Android, you will be required to create a passphrase. This recovery passphrase will not be required every time you use the app, but could be required when your lock screen security options have been changed. You can use the suggested passphrase or create your own. - -
    Android Passphrase Example
    -::: - - -### Google Authenticator - -If you would prefer to use the Google Authenticator app, click on the link for Google Authenticator. You will need to download Google Authenticator for [Android](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) or [iOS](https://itunes.apple.com/us/app/google-authenticator/id388497605). - -A code will appear, and you will have five minutes to scan the code before it expires. After scanning the code, you will get a six digit code to enter. Once you enter this code, you will see a confirmation screen which has a recovery code. If for some reason you do not have your mobile device, you will need this recovery code to login. Make sure to take note of this code and keep it somewhere safe. Check the box that you have recorded the code, and then you are logged in. - -![Google Authenticator code](/media/articles/mfa/google-code.png) - -For more information about Google Authenticator, see [Install Google Authenticator](https://support.google.com/accounts/answer/1066447). - -### SMS - -Depending on the applications settings, SMS may be an option to use for two-factor authentication. Click on the the **SMS** link after entering your email and password. - -Then select your phone number's country code and enter your mobile phone number. You must be able to receive SMS to your device to use this option. - -![SMS enroll](/media/articles/mfa/sms.png) - -Then you should receive a six digit code in a message to your phone. Enter this code into the box. Then you will see a recovery code, make sure to note this code as you will need it to login if you do not have your device. Check the box that you have recorded the code, and then you are all set and logged in. - -## Log in - -Depending on the type of two-factor authentication you chose when you were signing up, this will affect how you login. - -### Guardian - -After entering your username and password, a push notification will be sent to the Guardian app on your mobile device. This notification is a login request, it includes the application name, the OS and browser of the request, the location and the date of the request. If you recognize this request as your own, tap the **Allow** button. You should now be logged in. - -If you are not currently connected to the internet on your mobile device to receive push notifications, you can enter the OTP (One-time password) manually by clicking "enter the code". - -![Enter code at Guardian widget](/media/articles/mfa/guardian-enter-code.png) - -To find this code, go into the Guardian app on your device, and click on the application you are trying to log into. Then you should see information on your last sign in and a 6-digit code at the bottom which is your OTP. - -
    Lock-iOS
    - -Enter this code to finish signing in. - -::: panel Rate Limits - -Each hour, you are allotted a maximum of ten failed SMS attempts. After that, Auth0 considers all OTP codes invalid, and any additional attempts to log in results in a `Too Many Attempts` error. - -More specifically, this means that if you enter in the code incorrectly ten or more times within an hour, you will need to wait six minutes to gain another attempt. If you attempt another code before sufficient time has elapsed, Auth0 will consider any OTP code you enter as invalid (even if they aren't expired). -::: - -If you do not have your mobile device available to you during sign in, you can enter the recovery code that was given when you signed up by clicking the "Use the Recovery Code" link. - -### Google Authenticator - -After entering your username and password, you will be prompted for a six digit code. Open the Google Authenticator app on your mobile device to find the correct code. If you use Google Authenticator for other applications as well, make sure you are using the code for the current application. After entering the six digit code you will be logged in. - -If you do not have your mobile device available to you during sign in, you can enter the recovery code that was given when you signed up by clicking the "Use Recovery Code" link. - -### SMS - -After entering you enter your email and password, a SMS message will be sent to the phone number you entered when you signed up. Enter the six digit code from the message into the box to complete your login. - -If you do not have your mobile device available to you during sign in, you can enter the recovery code that was given when you signed up by clicking the "Use Recovery Code" link. - -## Troubleshooting - -### If you do not have your mobile device or it is turned off - -If you have lost your device you can finish the two-step authentication with the recovery code from when you signed up. After entering your email and password to login, click the link that says "Use the recovery code" to access your account without using your device. - -If you don't have your recovery code you will not be able to login. Contact your system administrator for help accessing your account. - -### If you forgot your password - -If you forgot your password when you are trying to login, click **Don't remember your password?** underneath the login. Enter your email to receive an email that will contain a link to reset your password. - -### If your OTP is not being accepted - -If the 6-digit code in the Guardian or the Google Authenticator app are being rejected for sign in, first check that you are selecting the right application from the list on the landing page of each application. You should see the name of the application and the email you are using for sign in, make sure these are correct. - -If you know you are selecting the correct connection, make sure that your mobile device's clock settings are correct. One-time passwords are generated using Coordinated Universal Time(UTC) so your device time must be correct to generate the correct OTP. - -### Transaction Expiration - -For all types of multi-factor authentication types there is a five minute expiration. Check the timestamp on the messages to see if it is still valid when trying to login. If it has been longer than five minutes, you will need to try to login again and get a new code or notification. - -If using SMS, make sure you are not [exceeding rate limits](#sms-rate-limits). - -### If you did not receive a SMS - -If you did not receive your six digit code via SMS, check that the phone number you entered is correct. If it is the correct number, make sure you have a cellular signal. If you still are not receiving the messages, check with your service provider to confirm that messages are not getting blocked. - -### SMS Rate Limits - -If you attempt to send more than ten SMS to your device within an hour, you will see an error message about a rate limit exception. If you have exceeded the limit of ten, you will need to wait at least an hour from your first SMS send to send another message. Each hour after the first attempt you will gain one more message request maxing out at ten requests. diff --git a/articles/multifactor-authentication/index.md b/articles/multifactor-authentication/index.md deleted file mode 100644 index 18b6629044..0000000000 --- a/articles/multifactor-authentication/index.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: Multi-factor Authentication in Auth0 -description: The basics of multi-factor authentication and the different methods of implementing it with Auth0. -url: /multifactor-authentication -topics: - - mfa -contentType: - - index -useCase: - - customize-mfa ---- - -# Multi-factor Authentication in Auth0 - -Multi-factor Authentication (MFA) is a method of verifying a user's identity by requiring them to present more than one piece of identifying information. This method provides an additional layer of security, decreasing the likelihood of unauthorized access. The type of information required from the user is typically two or more of the following: - -* **Knowledge**: Something the user knows (such as a password) -* **Possession**: Something the user has (such as a cell phone) -* **Inheritance**: Something the user is (such as a fingerprint or retina scan) - -::: note -Currently, the [Universal Login Pages](/hosted-pages/login) support use of a single MFA method. - -If you're using the [Resource Owner Password Grant](/api-auth/tutorials/multifactor-resource-owner-password) and need support for multiple authenticators, you can implement [Embedded Login](/guides/login/universal-vs-embedded#embedded-login-with-auth0) and interface with the [MFA API](/multifactor-authentication/api). -::: - -## Implementing MFA with Auth0 - -Auth0 supports the following methods of implementing MFA: - -1. [Push Notifications (Auth0 Guardian)](/multifactor-authentication#mfa-using-push-notifications-auth0-guardian-) - Auth0's mobile application Guardian sends push notifications for MFA -2. [SMS (Auth0 Guardian)](/multifactor-authentication#mfa-with-sms) - Verification by sending a six-digit code via SMS -3. Support for one-time password authentication services [Google Authenticator](/multifactor-authentication#mfa-using-google-authenticator) and [Duo Security](/multifactor-authentication#mfa-using-duo-security). -4. [Configuring rules for custom processes](/multifactor-authentication#mfa-using-custom-rules) - such as Contextual MFA, which allows you to define the conditions that will trigger additional authentication challenges, such as changes in geographic location or logins from unrecognized devices. -5. Using a [custom provider](/multifactor-authentication#mfa-using-a-custom-provider), such as **Yubikey**. - -## MFA using Push Notifications (Auth0 Guardian) - -
    Guardian Push Screenshot
    - -Guardian is Auth0's MFA application. It is a frictionless approach to implementing MFA for your apps, and provides a full MFA experience without requiring integration with third-party utilities. - -[Click here to learn more about enabling push notifications with Guardian](/multifactor-authentication/guardian) - -## MFA with SMS - -
    MFA SMS Screenshot
    - -Auth0 supports sending an SMS with a one-time password code to be used for another step of verification. - -[Click here to learn more about enabling SMS](/multifactor-authentication/guardian/admin-guide#support-for-sms) - -## MFA Using Google Authenticator - -
    Screenshot of Google Authenticator
    - -Google Authenticator is a mobile app that generates 2-step verification codes. This creates a one-time use password that is used as the second factor after your user has attempted to log in with their Google credentials. - -[Click here to learn more about enabling Google Authenticator](/multifactor-authentication/google-authenticator) - -## MFA Using Duo Security - -
    DUO Screenshot
    - -Duo Security allows you to request either of the following as your second factor once the user has provided their initial login credentials: - -* A user response to a push notification sent to the appropriate device -* A passcode provided to the user via SMS - -[Click here to learn more about enabling Duo](/multifactor-authentication/duo) - -## MFA Using Custom Rules - -You may [configure rules](/rules) for custom MFA processes, which allow you to define the conditions that will trigger additional authentication challenges, such as changes in geographic location or logins from unrecognized devices. - -[Click here for sample code snippets](/multifactor-authentication/custom) to assist you in building your rules here. - -## MFA Using a Custom Provider - -For a detailed look at implementing a custom MFA provider, see [Multi-factor Authentication with YubiKey-NEO](/multifactor-authentication/yubikey) as an introduction. - -## User-initiated MFA - -For details on how to implement user-initiated MFA, so you can flag users for MFA as part of the user creation/login process, refer to [User-Initiated Multi-factor Authentication](/multifactor-authentication/user-initiated-mfa). diff --git a/articles/multifactor-authentication/step-up-authentication/index.md b/articles/multifactor-authentication/step-up-authentication/index.md deleted file mode 100644 index 69e2bb8fbc..0000000000 --- a/articles/multifactor-authentication/step-up-authentication/index.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Step-up Authentication -description: Describes using acr_values and acr claims to perform step-up authentication with Auth0 -topics: - - mfa - - step-up-authentication -contentType: - - how-to - - concept -useCase: - - customize-mfa ---- -# Step-up Authentication - -With step-up authentication, applications that allow access to different types of resources can require users to authenticate with a stronger authentication mechanism to access sensitive resources. - -For example, Fabrikam's Intranet requires users to authenticate with their username and password to access customer data. However, a request for access to employee data (which may contain sensitive salary information) triggers a stronger authentication mechanism like multi-factor authentication. - -You can add step-up authentication to your app with Auth0's extensible multi-factor authentication support. Your app can verify that the user has logged in using multi-factor authentication (MFA) and, if not, require the user to step-up to access certain resources. - -![Step-up flow](/media/articles/mfa/step-up-flow.png) - -## Step-up Authentication for APIs - -When your audience is an API, you can implement step-up authentication with Auth0 using [scopes](/scopes), [Access Tokens](/tokens/access-token) and [rules](/rules). - -::: note -An Access Token is a credential you can use to access an API. The actions that you can perform to that API are defined by the scopes your Access Token includes. The rules are JavaScript functions you can use to run custom logic when a user authenticates. -::: - -You can use a rule to trigger the step-up authentication mechanism (for example, prompt MFA) whenever the user requests scopes that map to sensitive resources. - -This is best explained with an example. - -A user signs into Fabrikam's web app. The standard login gives to this user the ability to interact with their API and fetch the users account list. This means that the Access Token that the application receives after the user authentication contains a scope like `read:accounts`. - -Now the user wishes to transfer funds from one account to another, which is deemed a high-value transaction. In order to perform this action, the API requires the scope `transfer:funds`. - -The Access Token that the user currently has does not include this scope and the application knows it since it knows the set of scopes it requested in the initial authentication call. - -The solution is that the application performs another authentication call, but this time it requests the required scope. The browser redirects to Auth0 and a rule is used to challenge the user to authenticate with MFA since a high-value scope was requested. - -Once the user successfully authenticates with MFA, a new Access Token which includes the high-value scope is generated and sent. The application will pass the Access Token to the API which will discard it after verification, thereby treating it like a single-use token. - -For details and sample code, see [Step-up Authentication for APIs](/multifactor-authentication/developer/step-up-authentication/step-up-for-apis). - -## Step-up Authentication for Web Apps - -If it is a web app that verifies the authentication level, and not an API, then you do not have an Access Token. In this case you can check if a user has logged in with MFA by reviewing the contents of their [ID Token](/tokens/id-token). You can then configure your application to deny access to pages with sensitive information if the ID Token indicates that the user did not log in with MFA, and use a rule to trigger the step-up authentication mechanism (for example, prompt MFA). - -For example, you might have an employee app that authenticates users with username and password, but if a user wants to access salary information, they have to provide a second factor, using for example a mobile push notification. - -You can implement this by checking the ID Token when the user tries to access that screen. If the claims show that the user has authenticated with MFA already then display the sensitive information. Otherwise, trigger authentication again, and using a rule, prompt the user to authenticate with MFA. - -For details and sample code, see [Step-up Authentication for Web Apps](/multifactor-authentication/developer/step-up-authentication/step-up-for-web-apps). - -## Keep reading - -::: next-steps -* [Step-up Authentication for Web Apps](/multifactor-authentication/developer/step-up-authentication/step-up-for-web-apps) -* [Step-up Authentication for APIs](/multifactor-authentication/developer/step-up-authentication/step-up-for-apis) -* [Authentication policy definitions](http://openid.net/specs/openid-provider-authentication-policy-extension-1_0.html#rfc.section.4) -::: diff --git a/articles/multifactor-authentication/step-up-authentication/step-up-for-apis.md b/articles/multifactor-authentication/step-up-authentication/step-up-for-apis.md deleted file mode 100644 index 4cbd564c46..0000000000 --- a/articles/multifactor-authentication/step-up-authentication/step-up-for-apis.md +++ /dev/null @@ -1,219 +0,0 @@ ---- -title: Step-up Authentication for APIs -description: Describes how an API can check if a user has logged in with Multi-factor Authentication by examining their Access Token -topics: - - mfa - - step-up-authentication - - apis -toc: true -contentType: - - how-to - - concept -useCase: - - customize-mfa ---- -# Step-up Authentication for APIs - -With step-up authentication, applications that allow access to different types of resources can require users to authenticate with a stronger mechanism to access sensitive information or perform certain transactions. - -For instance, a user may be allowed to transfer money only after they have confirmed their identity using Multi-factor Authentication (MFA). - -When your audience is an API, you can implement step-up authentication with Auth0 using [scopes](/scopes), [Access Tokens](/tokens/access-token) and [rules](/rules). In this article we will explain how you can do that and use a sample implementation to go through the process step-by-step. - -## How to check the Access Token - -When an application wants to access an API's protected resources it must provide an Access Token. The resources that it will have access to depend on the permissions that are included in the Access Token. These permissions are defined as **scopes**. - -For example, a banking API may accept two different levels of authorization: view account balance (scope `view:balance`) or transfer funds (scope `transfer:funds`). When an application asks the API to retrieve the user's balance, then the Access Token should contain the `view:balance` scope. In order to transfer money to another account the Access Token should contain the `transfer:funds` scope. - -A sample flow for this example is the following: -1. The user logs in to the application using username/password authentication. The standard login gives to this user the ability to interact with their API and fetch their balance. This means that the Access Token that the app receives after the user authentication contains the scope like `view:balance` -1. The application sends a request to the API to retrieve the balance, using the Access Token as credentials -1. The API validates the token and sends the balance info to the application -1. Now the user wishes to transfer funds from one account to another, which is deemed a high-value transaction. The application sends a request to the API using the same Access Token -1. The API validates the token and denies access since it's missing the required scope `transfer:funds` -1. The application redirects to Auth0 and a rule is used to challenge the user to authenticate with MFA since a high-value scope was requested. Once the user successfully authenticates with MFA, a new Access Token which includes this scope is generated and sent to the application as part of the response -1. The application sends again the transfer funds request using the new Access Token, which includes the `transfer:funds` scope. -1. The API validates the token, discards it (thereby treating it like a single-use token) and proceeds with the operation - -Note that the API needs to do more validations than just check the scope. These are: -- Verify the token's signature. The signature is used to verify that the sender of the token is who it says it is and to ensure that the message wasn't changed along the way. -- Validate the standard claims: `exp` (when the token expires), `iss` (who issued the token), `aud` (who is the intented recipient of the token) - -For details on how to do these validations, see the [Verify Access Tokens for Custom APIs](/api-auth/tutorials/verify-access-token) article. - -## Example - -In this section we will see how you would implement the scenario described in the previous paragraph. - -### Before you start - -This tutorial assumes that you have already done the following: - -- [Register an application](/applications#how-to-configure-an-application). For the purposes of this example we'll be using a single-page web app -- [Create a database connection](${manage_url}/#/connections/database) -- [Register the API](/apis#how-to-configure-an-api-in-auth0). It should include two scopes: `view:balance` and `transfer:funds` -- [Enable Multi-factor Authentication](/multifactor-authentication). For the purposes of this example we'll be using [Guardian push notifications](/multifactor-authentication/administrator/push-notifications) - - -### 1. Create the rule - -First we will create a rule that will challenge the user to authenticate with MFA when the `transfer:funds` scope is requested. - -Go to [Dashboard > Multi-factor Auth](${manage_url}/#/guardian) and modify the script as follows. - -```js -function (user, context, callback) { - - var CLIENTS_WITH_MFA = ['${account.clientId}']; - // run only for the specified clients - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // ask for MFA only if scope transfer:funds was requested - if (context.request.query.scope.indexOf('transfer:funds') > -1) { - context.multifactor = { - provider: 'guardian', - allowRememberBrowser: false - }; - } - } - - callback(null, user, context); -} -``` - -The `CLIENTS_WITH_MFA` variable holds the Cliend IDs of all the applications you want to use this rule. You can remove this (and the `if` statement that follows) if you don't need it. - -The `context.request.query.scope` property contains all the scopes that the authentication request asked for. If it includes the value `transfer:funds` then we ask for MFA by setting the `context.multifactor` property to the appropriate value. In this case we are asking for MFA using [Guardian](/multifactor-authentication/guardian). - -### 2. Configure your application - -Next you need to configure your application to send the appropriate authentication request, depending on the action that the user wants to perform. Notice that the only difference between the two authentication requests (with or without MFA) is the scope `transfer:funds`. - -
    - -
    -
    -
    -        
    -https://${account.namespace}/authorize?
    -  audience=https://my-banking-api
    -  &scope=openid%20view:balance
    -  &response_type=id_token%20token
    -  &client_id=${account.clientId}
    -  &redirect_uri=${account.callback}
    -  &nonce=CRYPTOGRAPHIC_NONCE
    -  &state=OPAQUE_VALUE
    -        
    -      
    -
    -
    -
    -        
    -https://${account.namespace}/authorize?
    -  audience=https://my-banking-api
    -  &scope=openid%20view:balance%20transfer:funds
    -  &response_type=id_token%20token
    -  &client_id=${account.clientId}
    -  &redirect_uri=${account.callback}
    -  &nonce=CRYPTOGRAPHIC_NONCE
    -  &state=OPAQUE_VALUE
    -        
    -      
    -
    -
    -
    - -- Set `audience` to the **Identifier** of your API (find it at [API Settings](${manage_url}/#/apis/)). We set ours to `https://my-banking-api` -- The `response_type` is set to `id_token token` so we get both an ID Token and an Access Token in the response -- Set `client_id` to the Client ID of your application (find it at [Application Settings](${manage_url}/#/applications/${account.clientId}/settings)) -- Set the `redirect_uri` to the URL of your application that Auth0 should redirect back to after authentication (find it at [Application Settings](${manage_url}/#/applications/${account.clientId}/settings)) -- Set `nonce` to a string value which will be included in the response from Auth0. This is [used to prevent token replay attacks](/api-auth/tutorials/nonce) and is required for `response_type=id_token token` -- Set `state` to an opaque value that Auth0 includes when redirecting back to the application. This value must be used by the application to [prevent CSRF attacks](/protocols/oauth2/oauth-state) - -### 3. Configure your API - -Finally, you need to make your API validate the incoming token and check the authorized permissions. - -For the purposes of this example we will configure two endpoints for our API: -- `GET /balance`: used to retrieve the current balance -- `POST /transfer`: used to transfer funds - -We will be using Node.js and a number of modules: -- [express](https://expressjs.com/): adds the Express web application framework -- [jwks-rsa](https://github.com/auth0/node-jwks-rsa): retrieves RSA signing keys from a **JWKS** (JSON Web Key Set) endpoint. Using `expressJwtSecret` we can generate a secret provider that will provide the right signing key to `express-jwt` based on the `kid` in the JWT header -- [express-jwt](https://github.com/auth0/express-jwt): lets you authenticate HTTP requests using JWT tokens in your Node.js applications. It provides several functions that make working with JWTs easier -- [express-jwt-authz](https://github.com/auth0/express-jwt-authz): checks if the Access Token contains a specific scope - -Start with installing the dependencies. - -```text -npm install express express-jwt jwks-rsa express-jwt-authz --save -``` - -Next define the API endpoints, create a middleware function to validate the Access Token, and secure the endpoints using that middleware. The code in your `server.js` file should look like the following sample script. - -```js -// set dependencies -const express = require('express'); -const app = express(); -const jwt = require('express-jwt'); -const jwksRsa = require('jwks-rsa'); -const jwtAuthz = require('express-jwt-authz'); - -// Create middleware for checking the JWT -const checkJwt = jwt({ - // Dynamically provide a signing key based on the kid in the header and the singing keys provided by the JWKS endpoint - secret: jwksRsa.expressJwtSecret({ - cache: true, - rateLimit: true, - jwksRequestsPerMinute: 5, - jwksUri: `https://${account.namespace}/.well-known/jwks.json` - }), - - // Validate the audience and the issuer - audience: 'https://my-banking-api', // replace with your API's audience, available at Dashboard > APIs - issuer: 'https://${account.namespace}/', - algorithms: [ 'RS256' ] // we are using RS256 to sign our tokens -}); - -// create retrieve balance endpoint -app.get('/balance', checkJwt, jwtAuthz(['view:balance']), function (req, res) { - // code that retrieves the user's balance and sends it back to the calling app - res.status(201).send({message: "This is the GET /balance endpoint"}); -}); - - -// create transfer funds endpoint -app.post('/transfer', checkJwt, jwtAuthz(['transfer:funds']), function (req, res) { - // code that transfers funds from one account to another - res.status(201).send({message: "This is the POST /transfer endpoint"}); -}); - -// launch the API Server at localhost:8080 -app.listen(8080); -console.log('Listening on http://localhost:8080'); -``` - -Each time the API receives a request the following will happen: -1. The endpoint will call the `checkJwt` middleware -1. `express-jwt` will decode the token and pass the request, the header and the payload to `jwksRsa.expressJwtSecret` -1. `jwks-rsa` will then download all signing keys from the JWKS endpoint and see if a one of the signing keys matches the `kid` in the header of the Access Token. If none of the signing keys match the incoming `kid`, an error will be thrown. If we have a match, we will pass the right signing key to `express-jwt` -1. `express-jwt` will the continue its own logic to validate the signature of the token, the expiration, audience and the issuer -1. `jwtAuthz` will check if the scope that the endpoint requires is part of the Access Token - -That's it, you're done! Now your application allows access to different types of resources using a stronger mechanism to perform certain high-value transactions. - -## Keep reading - -::: next-steps -* [Overview of Access Tokens](/tokens/access-token) -* [Overview of rules](/rules) -* [Overview of scopes](/scopes) -* [How to verify Access Tokens](/api-auth/tutorials/verify-access-token) -* [Step-up Authentication for Web Apps](/multifactor-authentication/developer/step-up-authentication/step-up-for-web-apps) -::: diff --git a/articles/multifactor-authentication/step-up-authentication/step-up-for-web-apps.md b/articles/multifactor-authentication/step-up-authentication/step-up-for-web-apps.md deleted file mode 100644 index 37ef8e8f80..0000000000 --- a/articles/multifactor-authentication/step-up-authentication/step-up-for-web-apps.md +++ /dev/null @@ -1,187 +0,0 @@ ---- -title: Step-up Authentication for Web Apps -description: Describes how to check if a user has logged in your web app with Multi-factor Authentication by examining their ID Token -topics: - - mfa - - step-up-authentication - - web-apps -toc: true -contentType: - - how-to - - concept -useCase: - - customize-mfa ---- -# Step-up Authentication for Web Apps - -With Step-up Authentication, applications that allow access to different types of resources can require users to authenticate with a stronger mechanism to access sensitive information or perform certain transactions. - -For instance, a user may be allowed to access views with sensitive data or reset their password only after confirming their identity using Multi-factor Authentication (MFA). - -When a user logs in you can get an [ID Token](/tokens/id-token) which is a [JSON Web Token](/jwt) that contains information relevant to the user's session, in the form of claims. - -The claim that is relevant to this scenario is `amr`. If it contains the value `mfa` then you know that the user has authenticated using MFA. Note the following: -- `amr` **must** be present in the ID Token's payload (if you log in with username/password the claim will not be included in the payload) -- `amr` **must** contain the value `mfa` (`amr` can contain claims other than `mfa`, so its existence is not a sufficient test, its contents must be examined for the value `mfa`) - -If the token shows that the user has not authenticated with MFA, then you can trigger again authentication, and using a rule, trigger MFA. Once the user provides the second factor, a new ID Token, that contains the `amr` claim, is generated and sent to the app. - -## How to check the ID Token for MFA - -In order to check if a user logged in with MFA follow these steps: - -1. Retrieve the ID Token -1. Verify the token's signature. The signature is used to verify that the sender of the token is who it says it is and to ensure that the message wasn't changed along the way. -1. Validate the standard claims: `exp` (when the token expires), `iss` (who issued the token), `aud` (who is the intented recipient of the token) -1. Verify that the token contains the `amr` claim. - - If `amr` **is not** in the payload or it does not contain the value `mfa`, the user did not log in with MFA - - If `amr` **is** in the payload and it contains the value `mfa`, then the user logged in with MFA - -For more information on the signature verification and claims validation, see [ID Token](/tokens/id-token). - -## Sample payloads - -In the snippet below you can see how an ID Token's payload is if the user has authenticated with MFA, and how it is if they have not. - -
    - -
    -
    -
    -        
    -{
    -  "iss": "https://${account.namespace}/",
    -  "sub": "auth0|1a2b3c4d5e6f7g8h9i",
    -  "aud": "${account.clientId}",
    -  "iat": 1522838054,
    -  "exp": 1522874054,
    -  "acr": "http://schemas.openid.net/pape/policies/2007/06/multi-factor",
    -  "amr": [
    -    "mfa"
    -  ]
    -}
    -        
    -      
    -
    -
    -
    -        
    -{
    -  "iss": "https://${account.namespace}/",
    -  "sub": "auth0|1a2b3c4d5e6f7g8h9i",
    -  "aud": "${account.clientId}",
    -  "iat": 1522838197,
    -  "exp": 1522874197
    -}
    -        
    -      
    -
    -
    -
    - -## Example - -Let's say that you have a web app that authenticates users with username and password. When a user wants to access a specific screen with sensitive information, for example, one that displays salary data, you want the user to authenticate with another factor, for example [Guardian push notifications](/multifactor-authentication#mfa-using-push-notifications-auth0-guardian-). - -### Before you start - -This tutorial assumes that you have already done the following: - -- [Register an application](/applications#how-to-configure-an-application). For the purposes of this example we'll be using a regular web app -- [Create a database connection](${manage_url}/#/connections/database) -- [Enable Multi-factor Authentication](/multifactor-authentication). For the purposes of this example we'll be using [Guardian push notifications](/multifactor-authentication/administrator/push-notifications) - -### 1. Create the rule - -First we will create a rule that will challenge the user to authenticate with MFA when the web app asks for it. - -Go to [Dashboard > Multi-factor Auth](${manage_url}/#/guardian) and modify the script as follows. - -```js -function (user, context, callback) { - - var CLIENTS_WITH_MFA = ['${account.clientId}']; - // run only for the specified clients - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - // ask for MFA only if the web app said so in the authentication request - if (context.request.query.acr_values === 'http://schemas.openid.net/pape/policies/2007/06/multi-factor'){ - context.multifactor = { - provider: 'guardian', - allowRememberBrowser: false - }; - } - } - - callback(null, user, context); -} -``` - -The `CLIENTS_WITH_MFA` variable holds the Cliend IDs of all the applications you want to use this rule. You can remove this (and the `if` statement that follows) if you don't need it. - -The `context.request.query.acr_values` property exists only if the web app included it in the authentication request, using the request parameter `acr_values=http://schemas.openid.net/pape/policies/2007/06/multi-factor`. The web app will only include this parameter in the authentication request (as we will see in a while) if the user tries to access salary information and has not authenticated with MFA. In this case we ask for MFA using [Guardian](/multifactor-authentication/guardian) by setting the `context.multifactor` property to the appropriate value. - -### 2. Configure your application - -If the user tries to access the salary information screen, then the web app must check the ID Token claims for MFA. If the user has already authenticated with MFA, then the screen is displayed, otherwise the web app sends a new authentication request to Auth0. This time the request parameter `acr_values` is included so the rule we saw in the previous paragraph triggers MFA. Once the user authenticates, a new token is sent to the app. - -#### Check the ID Token - -The web app must validate the token as described in [How to check the ID Token for MFA](#how-to-check-the-id-token-for-mfa). - -In this example, we do these validations, using the [JSON Web Token Sample Code](https://github.com/auth0/node-jsonwebtoken). - -The code verifies the token's signature (`jwt.verify`), decodes the token, and checks whether the payload contains `amr` and if it does whether it contains the value `mfa`. The results are logged in the console. - -```js -const AUTH0_CLIENT_SECRET = '${account.clientSecret}'; -const jwt = require('jsonwebtoken') - -jwt.verify(id_token, AUTH0_CLIENT_SECRET, { algorithms: ['HS256'] }, function(err, decoded) { - if (err) { - console.log('invalid token'); - return; - } - - if (Array.isArray(decoded.amr) && decoded.amr.indexOf('mfa') >= 0) { - console.log('You used mfa'); - return; - } - - console.log('you are not using mfa'); - }); -``` - -#### Ask for MFA - -If the output of the previous validations is that the user has not authenticated with MFA, then you must trigger authentication again. The request will include the `acr_values=http://schemas.openid.net/pape/policies/2007/06/multi-factor` parameter, which as a result will trigger the rule we wrote at [the first step](#1-create-the-rule). - -Our web app uses the [Authorization Code Grant](/api-auth/tutorials/authorization-code-grant) to authenticate, so the request is as follows. - -```text -https://${account.namespace}/authorize? - audience=https://${account.namespace}/userinfo& - scope=openid& - response_type=code& - client_id=${account.clientId}& - redirect_uri=${account.callback}& - state=YOUR_OPAQUE_VALUE& - acr_values=http://schemas.openid.net/pape/policies/2007/06/multi-factor -``` - -Once the user authenticates with Guardian, the web app receives in the response the authorization code which must be exchanged for the new ID Token, using the [Token endpoint](/api/authentication#authorization-code). For more details, and sample requests, see [Exchange the Authorization Code for a Token](/api-auth/tutorials/authorization-code-grant#2-exchange-the-authorization-code-for-an-access-token). - -That's it, you are done! - -## Keep reading - -::: next-steps -* [Overview of ID Tokens](/tokens/id-token) -* [Overview of JSON Web Tokens](/jwt) -* [OpenID specification](http://openid.net/specs/openid-connect-core-1_0.html) -* [Step-up Authentication for APIs](/multifactor-authentication/developer/step-up-authentication/step-up-for-apis) -::: diff --git a/articles/multifactor-authentication/touchid.md b/articles/multifactor-authentication/touchid.md deleted file mode 100644 index 164758b2ec..0000000000 --- a/articles/multifactor-authentication/touchid.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -description: Links to documentation for Touch ID. -topics: - - touch-id -contentType: - - index -useCase: - - customize-mfa ---- -# Touch ID Settings - -::: warning -Touch ID with Auth0 has been deprecated, however you can still use it on a native app to protect the Refresh Token and achieve the effect you see in banking apps. You have to at least login once using credentials. -::: - -Below you can find useful links in our documentation to handle Touch ID within Auth0. - -- [Authenticate users with Touch ID in iOS](/connections/passwordless/ios-touch-id-swift) -- [Touch ID Authentication](/libraries/lock-ios/touchid-authentication) -- [Passwordless authentication using Touch ID & JWT](https://github.com/auth0/TouchIDAuth) diff --git a/articles/multifactor-authentication/user-initiated-mfa.md b/articles/multifactor-authentication/user-initiated-mfa.md deleted file mode 100644 index 55b049ebf7..0000000000 --- a/articles/multifactor-authentication/user-initiated-mfa.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: User-Initiated Multi-factor Authentication (MFA) -description: How to set up user-initiated multi-factor authentication -toc: true -topics: - - mfa -contentType: - - how-to -useCase: - - customize-mfa ---- -# User-Initiated Multi-factor Authentication - -In this tutorial, we will show you how to implement and enable user-initiated multi-factor authentication (MFA). We will cover how to: - -* Enable MFA using Auth0's Management Dashboard -* Programmatically flag new users for MFA -* Set the users up to initiate MFA enrollment when logging in for the first time. - -## Enable Multi-factor Authentication - -You can enable Multi-factor Authentication (MFA) using the Dashboard. - -Log in to your Auth0 account and navigate to the [**Multi-factor Auth** page of the Management Dashboard](${manage_url}/#/guardian). - -![](/media/articles/mfa/mfa-home.png) - -You'll have the option to enable MFA that uses either **Push Notifications** or **SMS**. You can also use both. Click the slider(s) next to the option(s) you want enabled. - -Once you've enabled one or more types of MFA, you'll see the **Customize MFA** section, which is a text editor that allows you to write the code to determine when MFA is necessary. The code runs as part of your [rules](/rules) whenever a user logs in. - -![](/media/articles/mfa/mfa-template.png) - -To help you get started, you'll see a template you can modify. Additional templates that implement various MFA features are available under **Templates**, which is located to the top right of the code editor. - -As an example, the follow code snippet calls for MFA when: - -* The application specified is used -* The user's `app_metadata` has a `use_mfa` flag set to `true` - -Finally, if the two parameters above are met, MFA occurs every login. - -```js -function (user, context, callback) { - - // run only for the specified applications - var CLIENTS_WITH_MFA = ['REPLACE_WITH_YOUR_CLIENT_ID']; - - if (CLIENTS_WITH_MFA.indexOf(context.clientID) !== -1) { - if (user.app_metadata && user.app_metadata.use_mfa){ - - context.multifactor = { - // required - provider: 'guardian', - - // set to false to force Guardian authentication every login - allowRememberBrowser: false - }; - } - } - - callback(null, user, context); -} -``` - -## Flag New Users for MFA - -In this step, we'll add functionality within the user creation/login process that flags users for MFA. - -You'll need to [get an Access Token](/api/management/v2/tokens) to call the [Management API](/api/management/v2) during the user creation process. The only scope that you need to grant to the issued token is `update:users_app_metadata`. - -Using this token, you can place a flag on app_metadata that indicates whether MFA is needed whenever that user logs in. More specifically, you'll be programmatically setting their the user's `app_metadata` field with `use_mfa = true`. - -You can do this by making the appropriate `PATCH` call to the [Update a User endpoint of the Management API](/api/management/v2#!/Users/patch_users_by_id). Note that the body of the call omits most of the extra details (such as email and phone number) you might need to include. - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/api/v2/users/USER_ID", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [{ - "name": "Authorization", - "value": "Bearer MGMT_API_ACCESS_TOKEN" - }], - "queryString": [], - "postData": { - "mimeType": "application/json", - "text": "{ \"blocked\": false, \"email_verified\": false, \"email\": \"\", \"verify_email\": false, \"phone_number\": \"\", \"phone_verified\": false, \"verify_phone_number\": false, \"password\": \"\", \"verify_password\": false,\"user_metadata\": {},\"app_metadata\": { \"use_mfa\": true }, \"connection\": \"\", \"username\": \"\",\"client_id\": \"DaM8...rdyX\"}" - }, - "headersSize": -1, - "bodySize": -1, - "comment": "" -} -``` - -## Initiate Guardian Enrollment - -In this step, we'll initiate Guardian Enrollment for users who have been flagged for MFA. Note that you can use any MFA provider that integrates with Auth0 -- you do not necessarily have to use Guardian. - -You'll need to [get an Access Token](/api/management/v2/tokens) to call the [Management API](/api/management/v2). The only scope that you need to grant to the issued token is `create:guardian_enrollment_tickets`. You might consider adding both scopes to the Access Token when you make the initial request in the [previous step](#flag-new-users-for-mfa) in lieu of making two separate requests, each resulting in a token with a different scope. - -You can enroll a user in Guardian MFA by making the appropriate `POST` call to the [Create a Guardian Enrollment Ticket endpoint of the Management API](/api/management/v2#!/Guardian/post_ticket). - -```har -{ - "method": "POST", - "url": "https://${account.namespace}/api/v2/guardian/enrollments/ticket", - "httpVersion": "HTTP/1.1", - "cookies": [], - "headers": [{ - "name": "Authorization", - "value": "Bearer MGMT_API_ACCESS_TOKEN" - }], - "queryString": [], - "postData": { - "mimeType": "application/json", - "text": "{ \"user_id\": \"\", \"email\": \"\", \"send_mail\": false }", - "headersSize": -1, - "bodySize": -1, - "comment": "" - } -} -``` diff --git a/articles/multifactor-authentication/yubikey.md b/articles/multifactor-authentication/yubikey.md deleted file mode 100644 index 336ea7ed99..0000000000 --- a/articles/multifactor-authentication/yubikey.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -description: How to implement Multi-factor Authentication Using YubiKey NEO. -toc: true -topics: - - mfa - - yubikey -contentType: - - how-to -useCase: - - customize-mfa ---- -# Multi-factor Authentication with YubiKey NEO - -This tutorial shows you how to implement Multi-factor Authentication (MFA) using [YubiKey NEO](https://www.yubico.com/products/yubikey-hardware/yubikey-neo/). - -:::warning -Binding an OTP to an identity is outside the scope of this article. -::: - -Implementing MFA using YubiKey NEO requires use of the following Auth0 features for the described reasons: - -| Feature | Usage | -| - | - | -| [Webtask](https://webtask.io) | Hosts the website where the user undergoes the second authentication factor using YubiKey | -| The [Redirect Protocol](/rules/redirect) | Redirects the user to the website that performs the second authentication factor using YubiKey | -| [Rule](/rules) | Evaluates whether the conditions you set for triggering MFA have been met or not | - -In this tutorial, we will walk you through the configuration required for the Webtask, redirect protocol, and rules. - -## Configure the Webtask - -The first thing we'll do is create the website where the user completes the second authentication step using YubiKey. We'll use a Webtask, which allows you to run code using the Auth0 sandbox, to host the site. More specifically, the Webtask will: - -* **Render** the UI with the `otpForm` function -* **Capture** the YubiKey NEO code and validate it using the Yubico API -* **Return** the result of the validation to Auth0 -- if successful, Auth0 continues to process the login transaction - -### Step 1: Create the Webtask Code - -Webtask runs code you provide, so we'll begin by creating the code needed. We've provided you with a [fully-functional sample](https://github.com/auth0/rules/blob/master/redirect-rules/yubico-mfa.md), which you need to save locally in a file called `yubico-mfa-wt.js`. - -Within the code provided is a redirect URL to Auth0. It contains querystring parameters called `id_token` and `state`. The `id_token` parameter is used to transfer information back to Auth0. The `state` parameter is used to protect against CSRF attacks. - -No actual key values are hard-coded into the Webtask code. Your Yubico Client ID and Secret values are referred to using `context.data.yubico_clientid` and `context.data.yubico_secret`. These parameters are securely embedded in the Webtask token when you created the Webtask. - -### Step 2: Initialize the Webtask CLI - -::: warning -Tenants created after **July 16, 2018** will not have access to the underlying Webtask Sandbox via the Webtask CLI. Please contact [Auth0](https://auth0.com/?contact=true) to request access. -::: - -Now that we have the code for our Webtask, we'll need to create the Webtask itself. We do this using the Webtask CLI. - -To use the Webtask CLI, you'll need to install it using instructions that can be found under [Tenant Settings > Webtasks](${manage_url}/#/tenant/webtasks) on the Auth0 Dashboard. - -![](/media/articles/mfa/yubi-1.png) - -Once you've installed the Webtask CLI, run the following code after you've replaced the placeholders with your Yubico Client ID and Secret values (make sure that the Webtask CLI can access to location where you have your `yubico-mfa-wt.js` file): - -```txt -wt create --name yubikey-mfa --secret yubikey_secret={YOUR YUBIKEY SECRET} --secret yubikey_clientid={YOUR YUBIKEY CLIENT ID} --secret returnUrl=https://${account.namespace}/continue --profile {WEBTASK PROFILE} yubico-mfa-wt.js -``` - -::: note -You can get your `WEBTASK PROFILE` value (needed for the-p parameter shown at the end of the code above) in **Step 2** of the Webtask installation instructions shown on the [Tenant Settings > Webtasks](${manage_url}/#/tenant/webtasks) page. -::: - -Running the `create` command as shown above will generate a URL that looks like this: - -```txt -https://sandbox.it.auth0.com/api/run/${account.tenant}/yubikey-mfa?webtask_no_cache=1 -``` - -Keep a copy of this URL. - -## Create the Rule - -This sample uses a single rule that handles: - -* The initial redirect to the Webtask -* The returned result - -Here is what the rule looks like: - -```js -function (user, context, callback) { - var jwt = require('jsonwebtoken@5.7.0'); - var yubikey_secret = configuration.YUBIKEY_SECRET; - - //Returning from OTP validation - if(context.protocol === 'redirect-callback') { - var decoded = jwt.verify( - context.request.query.id_token, - new Buffer(yubikey_secret,'base64') - ); - if (!decoded) { return callback(new Error('Invalid OTP')); } - if (decoded.status !== 'OK') { return callback(new Error('Invalid OTP Status')); } - - return callback(null,user,context); - } - - //Trigger MFA - context.redirect = { - url: configuration.WEBTASK_URL + "?user=" + user.name - }; - - callback(null,user,context); -} -``` - -You also need to create two new settings on [Rules](${manage_url}/#/rules): - -* One using `WEBTASK_URL` as the key, and the URL returned by the `create` command as the value. -* Another using `YUBIKEY_SECRET` as the key, and `{YOUR YUBIKEY SECRET}` passed to `create` as the value. - -::: note -The returning section of the rule validates the JWT issued by the Webtask. This prevents the result of the MFA part of the transaction from being tampered with because the payload is digitally signed with a shared secret. -::: - -Some notes regarding the rule code: - -* The `context.redirect` statement instructs Auth0 to redirect the user to the Webtask URL instead of calling back to the app -* The return is indicated by the `protocol` property of the `context` object -* The section handling the return validates the JWT issued by the Webtask to ensure that the result of MRA hasn't been tampered by an unauthorized party - -You'll [create the rule using the Management Dashboard](${manage_url}/#/rules). - -![](/media/articles/mfa/yubi-2.png) - -Click **Create Your First Rule** (or **Create Rule** if you've already created rules before). Choose **empty rule**. - -![](/media/articles/mfa/yubi-3.png) - -You'll see the following editor window where you can paste in the rule code above. - -![](/media/articles/mfa/yubi-4.png) - -You can test your code for correctness using **Try This Rule**. When done, click **Save** to proceed. - -You also need to create two new Settings for your [Rules](${manage_url}/#/rules): - -| Setting | Value | -| - | - | -| `WEBTASK_URL` | The URL you saved after running the `CREATE` command in the Webtask CLI | -| `YUBIKEY_SECRET` | Your YubiKey client secret | - -With these settings, you can access the provded values in your rules code using the configuration global object (such as `configuration.WEBTASK_URL`). - -![](/media/articles/mfa/yubi-5.png) - -With this rule in place, the user will be redirected to the Webtask after every login. They will see the following prompt for their second factor: - -![](/media/articles/mfa/yubico-mfa.png) - -### Customize the Rule - -You can add logic to the rule to determine which conditions the challenge will be triggered based on: - -You can add logic to the rule to set the conditions under which the MFA challenge will be triggered. Some examples include: - -* The IP address or location of the user -* The application the user is logging into -* The type of authentication used (such as AD, LDAP, or Social) - -## Keep Reading - -::: next-steps -* [Rules](/rules) -* [Multi-factor in Auth0](/multifactor-authentication) -* [Auth0 Webtask](https://webtask.io/) -::: diff --git a/articles/onboarding/appliance-sprint.md b/articles/onboarding/appliance-sprint.md index 956356a113..1beb874949 100644 --- a/articles/onboarding/appliance-sprint.md +++ b/articles/onboarding/appliance-sprint.md @@ -11,7 +11,6 @@ useCase: - appliance applianceId: appliance64 --- - # PSaaS Appliance Deployment Project PSaaS Appliance Sprint is Auth0’s onboarding program for enterprise customers choosing an PSaaS Appliance. It helps you achieve value quickly with your Auth0 enterprise subscription. @@ -56,4 +55,4 @@ The following sections describe what happens during each step of the PSaaS Appli ## What's next? -Once the PSaaS Appliance is deployed, an Auth0 Customer Success Manager will work with you to complete the rest of the [Sprint onboarding program](https://auth0.com/docs/onboarding/sprint) - the end result being a joint success plan to drive value throughout the subscription lifecycle. +Once the PSaaS Appliance is deployed, an Auth0 Technical Account Manager will work with you to build a joint success plan to drive value throughout the subscription lifecycle. \ No newline at end of file diff --git a/articles/onboarding/cloud-sprint.md b/articles/onboarding/cloud-sprint.md deleted file mode 100644 index 06ede5e04e..0000000000 --- a/articles/onboarding/cloud-sprint.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -sitemap: false -description: An overview of the steps in the Cloud Sprint onboarding program. -topics: - - appliance - - onboarding -contentType: - - concept -useCase: - - appliance -applianceId: appliance65 ---- - -# Cloud Sprint - -## Auth0 Customer Onboarding Program - -Cloud Sprint is Auth0’s onboarding program for enterprise customers. It helps you achieve value quickly with your Auth0 enterprise cloud subscription. The 6 steps in the onboarding program set both you and Auth0 up for success. - -## Cloud Sprint Overview - -![Cloud Sprint Program Overview](/media/articles/onboarding/cloud-sprint-program-overview.png) - -[Download the Cloud Sprint PDF here.](/media/articles/onboarding/cloud-sprint-onboarding.pdf) - -Hours allocated as consulting, are delivered by our services team of system architects and software engineers for the purpose of guiding you through the common technical requirements, questions, advice and best practices to get successfully started with Auth0. - -If you have complex requirements needing deeper consulting and advice from our experts than the time allocated here will allow then ask your Sales Executive about purchasing [Professional Services](/services) hours. These hours can be used for services including: -- Systems architecture design consulting -- Software development assistance related to integration of your application to Auth0 -- Data migration from 3rd party/proprietary databases -- Performance & load testing - -## Cloud Sprint: Details & Resources - -### Step 1. Welcome & Orientation - -**When?** This session is generally booked within 5 days of signing your subscription agreement. - -**What?** Our Customer Success team are devoted to learning more about your business and what you want to achieve with Auth0. In this short, casual session our Customer Success Managers will ask lots of questions and do lots of listening. - -[Cloud Sprint - Get Started Form](https://docs.google.com/a/auth0.com/forms/d/1R0vq5DQxdbgdE0kkJPcruKXiFdZpddLV_P5wlTQwOfE/viewform) - Spend 5 minutes to fill out this form. This can help speed up the process of your subscription being applied your correct Auth0 account or help us provision a new one so you can access it ASAP! - -[Auth0 support resources and guidance for enterprise customers.](/onboarding/enterprise-support) - Already developing? No need to wait, you can plug in to our support resources immediately! - -### Step 2. Technical Discovery & Guidance - -**When?** This session is generally booked within 14 days of signing your subscription agreement. - -**What?** The goal of this technical session is to send you forward on the best path. It’s an opportunity for our Customer Success Engineers to understand your software architecture and integration plans and for your team to ask questions or seek advice. - -[Common Architecture and Scenarios](/architecture-scenarios) - Quick guidance on common Business Scenarios and Application Configurations and the things you need to know to get started. - -[Auth0 Learn Resources](https://auth0.com/learn/) - Explore these resources for guidance on topics including Refresh Tokens, 2FA, implementing SSO and migrating existing user data. - -### Step 3. Management Dashboard Guidance -**When?** You can access self service resources immediately. A live session is generally booked soon after the Technical Discovery & Guidance session. - -**What?** The goal of this light technical session is to familiarize your team with the Auth0 Management Dashboard to understand both some of the administrative elements (such as setting up new Dashboard Admin users) as well as functional elements. - -[Comprehensive Dashboard Walkthrough](https://youtu.be/hkMHBXRImPk?t=8m9s) - This 40 minute video walks you through many elements of the Auth0 Dashboard in a practical manner. - -### Step 4. Customer Integration -**When?** Varies by customer and project. - -**What?** This is where it all comes together and your team integrates Auth0 with your application/project. Our support resources are always there to help and our Customer Success Managers will be following your progress and removing any blockers. - -[Auth0 support resources and guidance for enterprise customers.](/onboarding/enterprise-support) - Our support resources are there to help during implementation and integration. - -### Step 5. Integration Best Practice Review -**When?** Soon after your initial implementation or integration and before you move to beta/UAT or production. - -**What?** In this technical session, our Customer Success Engineers will review your implementation and integration to ensure best practices are applied. This often includes reviewing rules you’ve written, how you’re calling our APIs and answering any questions you may have. - -[Auth0 Learn Resources](https://auth0.com/learn/) - Explore these resources for guidance on topics including Refresh Tokens, 2FA, implementing SSO and migrating existing user data. - -Pre-Production Checklist: This list will walk through basic checks to make in Auth0 to ensure a smooth production launch (Coming soon). - -### Step 6. Achieve First Value Goal -**When?** 30-45 days after signing your subscription agreement. - -**What?** Ultimately, this is the goal our team will be focused on moving towards as the outcome of the onboarding process. It’s something we’ll agree on with you in Step 1. diff --git a/articles/onboarding/enterprise-support.md b/articles/onboarding/enterprise-support.md index b29f1a4950..1a2979c5fe 100644 --- a/articles/onboarding/enterprise-support.md +++ b/articles/onboarding/enterprise-support.md @@ -22,7 +22,7 @@ Refer to your subscription agreement to confirm which support offering is includ For general queries related to functionality, integration, best practice, or advice, you can use the following resources: - The [Auth0 Community](https://community.auth0.com/): Post questions to our audience of Customer Success Engineers, as well as other Auth0 users, or search and read existing posts for useful information. -- Your __Customer Success Manager__: Your Auth0 Customer Success Manager is always available for general queries and helping you navigate to the right Auth0 resource. The orientation information you received during onboarding should have the contact details for your Customer Success Manager. +- Your __Technical Account Manager__: Your Auth0 Technical Account Manager is always available for general queries and helping you navigate to the right Auth0 resource. The orientation information you received during onboarding should have the contact details for your Technical Account Manager. - The [Auth0 Docs](/search#gsc.tab=0) ## For Issues Impacting Production Environments (SLA Applicable) @@ -81,9 +81,9 @@ To speed resolution, please check the following before logging an issue: * Is the issue experienced by all users or just a few? * All? - Could be a service or configuration issue * Check status of Auth0 service - * Americas: (http://status.auth0.com) - * EU Region: (http://status.eu.auth0.com) - * APAC Region: (http://status.au.auth0.com) + * Americas: (https://status.auth0.com) + * EU Region: (https://status.auth0.com/?region=EU) + * APAC Region: (https://status.auth0.com/?region=AU) * You can subscribe to updates via the button on those pages * Check authentication services (connections) are up and reachable * Check application components - make sure they are functioning @@ -114,10 +114,10 @@ To speed resolution, please provide the following when logging an issue: * Issue experienced by users every time or just some times? * Issue experienced with all browsers or just one? * Screenshot of error message (if any) -* HTTP trace in the form of a [.har file](/har) +* HTTP trace in the form of a [HAR file](/troubleshoot/guides/generate-har-files) -*For PSaaS Appliance Customers*: +*For Private Cloud Customers*: -* PSaaS Appliance version/build number (top left hand corner of configuration screen on config tenant, such as https://yourmanage.yourdomain.com/configuration#/) +* Private Cloud version/build number (top left hand corner of configuration screen on config tenant, such as https://yourmanage.yourdomain.com/configuration#/) * Status of nodes (https://yourmanage.yourdomain.com/configuration#/nodes) * Status of health check (https://yourmanage.yourdomain.com/configuration#/troubleshoot) \ No newline at end of file diff --git a/articles/onboarding/sprint.md b/articles/onboarding/sprint.md deleted file mode 100644 index fe15ae9185..0000000000 --- a/articles/onboarding/sprint.md +++ /dev/null @@ -1,140 +0,0 @@ ---- -sitemap: false -description: An overview of Auth0’s onboarding program for enterprise customers. -topics: - - appliance - - onboarding -contentType: - - concept -useCase: - - appliance -applianceId: appliance67 ---- -# Auth0 Sprint Onboarding - -Sprint is Auth0’s enterprise customer onboarding program. It helps you achieve value quickly by ensuring your setup for success with your Auth0 subscription. - -All customer's who subscribe to a qualifying 12 month+ subscription agreement obtained through our enterprise sales team will be offered access to Sprint Onboarding. However, the engagement varies slightly based on your subscription value, additions and support option. - -## Sprint Onboarding Overview - -### Goal - -During the onboarding process, the Auth0 Customer Success Team’s goal is to fulfill our obligation to: - -* Have your subscription tenant correctly provisioned and setup in our systems (including the [PSaaS Appliance deployment project](/onboarding/appliance-sprint) in the case of on-premise/private-cloud managed service customers) -* Receive information from you that our Customer Success Managers will use to engage with you, measure success and manage your subscription throughout its various lifecycles -* Provide information to you around accessing and utilizing informational, training and support resources to meet your success goals -* Offer high level initial technical architecture guidance and plug you in to our Professional Services offerings if deeper guidance or hands-on development/implementation assistance is desired - -The outcome of these obligations is a Success Plan that will be co-managed by your lead contact and the Auth0 Customer Success Management team. - -### Sprint Onboarding Activities by Subscription - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Sprint StarterSprint BusinessSprint Jumpstart
    Qualifying CustomersEnterprise planEnterprise plan over USD$25k annual subscriptionEnterprise plan with Jumpstart or Preferred Support additions
    Customer Success engagementCustomer Success teamAllocated Customer Success ManagerAllocated Customer Success Manager
    Orientationdelivered via online assetsLive 1:1 orientation session* and online assetsLive 1:1 orientation session* and online assets
    Architecture guidanceDelivered via online assets and webinarsDelivered via online assets and webinars, with CSM able to co-ordinate other limited guidanceDelivered in Jumpstart services engagement
    Auth0 foundations trainingDelivered via online assets and webinarsDelivered via online assets and webinars, with CSM able to co-ordinate other limited trainingDelivered in Jumpstart services engagement
    Auth0 advanced trainingLimited online assets and optional Services Engagement for additional feeLimited online assets and optional Services Engagement for additional feeLimited online assets and optional Services Engagement for additional fee
    Success PlanTemplated, self-serve. Completed plan reviewed with Customer Success TeamCustom, built in consultation with Success ManagerCustom, built in consultation with Success Manager
    - -* *Live sessions are delivered remotely via web conference.* - -### Timing - -The Sprint program isn’t bound by a specific time restriction, but rather it’s considered completed on delivery of the obligations and the Success Plan. For customers with a Cloud subscription, this usually takes between 1 and 3 weeks. For customers with an on-premise or private cloud managed service it can take up to 6 weeks. Sprint onboarding ends when the final Success Plan is shared with you. - -### What happens next? - -At the conclusion of the Sprint program, our Customer Success Management team will continue to monitor your progress against the Success Plan and work with you throughout different stages of the subscription lifecycle or when things are not moving to plan. This can mean a number of different activities and interactions depending on where you’re at in the development lifecycle and based on your subscription. - -Aside from engagement with our Customer Success Management team, you’ll have many other resources to move you along the journey as introduced to you in the Sprint program - this includes our support team, community forums, documentation, videos and webinars. - -The table below outlines examples of the different ongoing engagement delivered by the Customer Success Management team based on your subscription. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Enterprise planEnterprise plan over USD$25k annual subscriptionEnterprise plan over USD$100k annual subscription
    Customer Success engagementCustomer Success team, predominantly digital engagementAllocated Customer Success ManagerAllocated Customer Success Manager with small subscriber management ratio and more strategic engagement
    Pre-launch best practices reviewdelivered via online assetsLive 1:1 session* and online assetsLive 1:1 session* and online assets
    Success Plan management and reviewWhen off planAt key subscription milestones, annual reviews and when off planOngoing with allocated Customer Success Manager
    Executive business reviewsNAAnnualQuarterly or as required
    - -* *Live sessions are delivered remotely via web conference.* diff --git a/articles/policies/billing.md b/articles/policies/billing.md index ac9bc63ae0..2de85a2518 100644 --- a/articles/policies/billing.md +++ b/articles/policies/billing.md @@ -86,9 +86,15 @@ Please note that you have to be a Tenant admin to do this request. Also, more than often the email which receives the receipt is the one that created the Auth0 tenant. Please make sure that you are in touch with the owner of that email. That person can also forward you the receipt of the payment. If you want to change this setting, please let us know through our [Support Center](${env.DOMAIN_URL_SUPPORT}). +## Do you charge sales tax? + +For US-based customers, we will charge sales tax where applicable. This is dependent on your state's sales tax laws and requirements. For non-US customers, we will not charge sales tax. + +You can determine if you will be responsible for sales tax during the checkout process after you provide your billing address. If the billing address provided is tax-eligible, you'll see the sales tax added to your total. You will also see the sales tax amount on all of your Auth0 invoices and receipts. + ## In our pricing, what is the difference between internal and external users? Are they different technically? -An active user is a user that has authenticated with a username/password combination, a Passwordless connection, or any social provider in a given calendar month. +An active user is a user that has authenticated with a username/password combination, a Passwordless connection, or any social provider in a given calendar month. Auth0 counts users on a per-tenant basis. That means that somebody who logs in to multiple applications still counts as one user as long as you've created all of the applications using a single tenant. diff --git a/articles/policies/dashboard-authentication.md b/articles/policies/dashboard-authentication.md index 80e73a893f..23d1a8d253 100644 --- a/articles/policies/dashboard-authentication.md +++ b/articles/policies/dashboard-authentication.md @@ -24,7 +24,7 @@ To enable multi-factor authentication for your account: 2. Scroll down to the **Multi-factor** section. 3. Click the **Enroll Your Device Now** link to get started. -The process for setting up each form of authentication is the same as using MFA with an application, [click here for more information on each type of authentication.](/multifactor-authentication) +The process for setting up each form of authentication is the same as using MFA with an application, [click here for more information on each type of authentication.](/mfa) ### Unenrolling a Device from Multi-factor @@ -34,8 +34,6 @@ To stop using multi-factor authentication to log in to your dashboard: 2. Scroll down to the **Multi-factor** section and click the **REMOVE** button next to the enrolled device. 3. To verify this request you will need to login once more with multi-factor authentication. -If you have lost your device after enrolling in MFA or are having trouble logging in after enabling MFA, [click here for troubleshooting tips.](/multifactor-authentication/guardian/user-guide#troubleshooting) - ## Other forms of authentication At this time, other forms of authentication for dashboard authentication are not supported. @@ -46,4 +44,4 @@ This policy is effective April 4, 2016 This policy may be revised when we are able to make configuration and troubleshooting visibility available on a self-service basis for other forms of authentication. -Any accounts with special dashboard authentication implemented before the effective date of this policy shall be grandfathered and allowed to continue. +Any accounts with special dashboard authentication implemented before the effective date of this policy shall be allowed to continue. diff --git a/articles/policies/data-export.md b/articles/policies/data-export.md index 66fc5e9f38..e4442cef34 100644 --- a/articles/policies/data-export.md +++ b/articles/policies/data-export.md @@ -11,7 +11,7 @@ useCase: --- # Data Export Policy -If you would like to export your data from Auth0 there are a several ways you can do this. +If you would like to export your data from Auth0 there are a several ways you can do this. Please note these tools do not export password hashes of your [Auth0-hosted database users](/connections/database). You can still request this information by opening a [support ticket](https://support.auth0.com/). Please note that in order to make this request you must be signed in to the Developer plan for one month. ## Use the Import/Export Extension @@ -21,6 +21,6 @@ You can use our [Import/Export Extension](/extensions/user-import-export) to exp If you want to export certain sets of data programmatically, the **Management API** can assist you with this. For more information on using the Management API, you can: -* Browse the [Management API documentation](/api/management/v2) -* Read about [obtaining a token](/api/management/v2/tokens) which you can use to call the Management API -* Read about [searching for users](/api/management/v2/user-search) as well as the [query syntax](/api/management/v2/query-string-syntax) that can be used +* Browse the [Management API documentation](/api/management/v2). +* Read about [obtaining a token](/api/management/v2/tokens) which you can use to call the Management API. +* Read about [searching for users](/users/search) as well as the [query syntax](/users/search/v3/query-syntax) that can be used. diff --git a/articles/policies/data-transfer.md b/articles/policies/data-transfer.md index ccc2254e3e..e3cd3206a9 100644 --- a/articles/policies/data-transfer.md +++ b/articles/policies/data-transfer.md @@ -12,7 +12,7 @@ useCase: # Data Transfer Policy -At this time, Auth0 will not transfer data from one Auth0 tenant to another. This applies to both Cloud and PSaaS Appliance customers. +At this time, Auth0 will not transfer data from one Auth0 tenant to another. This applies to both Public Cloud and Private Cloud customers. All data in your Auth0 tenant is always under your control and is [available through the Management API](/api/v2) at any time. The only information which is not available through the API are the password hashes of your [Auth0-hosted database users](/connections/database) and private keys, for security reasons. @@ -22,5 +22,6 @@ If you are opting to move out from our service, then you might want to check [th * Transfer data from a non-production tenant to a production tenant * Rename a tenant +* Re-use the name of a previously deleted tenant * Rename a connection * Migrate a tenant from one region to another (for example, from US to EU) diff --git a/articles/policies/endpoints.md b/articles/policies/endpoints.md index 1b60980eb9..0ad9cc03ba 100644 --- a/articles/policies/endpoints.md +++ b/articles/policies/endpoints.md @@ -9,24 +9,24 @@ useCase: - support --- -# Endpoints used by Auth0 public cloud service +# Auth0 Public Cloud Service Endpoints The following endpoints are used by Auth0 public cloud service: -## US Region +## United States Region * https://manage.auth0.com * https://auth0.com -* https://login.auth0.com -* https://cdn.auth0.com -* https://{YOUR ACCOUNT}.auth0.com -* https://{YOUR ACCOUNT}.guardian.auth0.com +* https://login.us.auth0.com +* https://cdn.us.auth0.com (or https://cdn.auth0.com if your tenant was created prior to 11 June 2020) +* https://{YOUR ACCOUNT}.us.auth0.com +* https://{YOUR ACCOUNT}.guardian.us.auth0.com -## EU & AU Regions +## Europe and Australia Regions * https://manage.auth0.com * https://auth0.com * https://login.[eu|au].auth0.com * https://cdn.[eu|au].auth0.com * https://{YOUR ACCOUNT}.[eu|au].auth0.com -* https://{YOUR ACCOUNT}.[eu|au].guardian.auth0.com +* https://{YOUR ACCOUNT}.guardian.[eu|au].auth0.com diff --git a/articles/policies/entity-limits.md b/articles/policies/entity-limits.md new file mode 100644 index 0000000000..24f00d44c1 --- /dev/null +++ b/articles/policies/entity-limits.md @@ -0,0 +1,52 @@ +--- +title: Entity Limit Policy +description: Describes Auth0's tenant entity limit policy for subscribers. +topics: + - auth0-policies + - rate-limits + - entity-limits +contentType: + - reference +useCase: + - support +--- +# Entity Limit Policy + +::: note +This policy is effective for all Developer, Developer Pro, and free subscriptions made on or after May 19, 2020. Starting on **June 18, 2020**, the policy will apply to all Developer, Developer Pro, and free subscriptions. +::: + +Entities in Auth0 are tenant configuration elements such as applications, connections, rules, and API resource servers. + +Auth0 limits the number of entities you can have depending on your subscription level. Auth0 provides notifications to you when you are approaching (80%) and when you have reached your respective entity limits (100% or higher). We will also provide messages to prevent you from attempting to configure entities that would be rejected because they would put you over your limit. Here is an example of a message you would see if you reached your connection limit: + +![Entity Limit Reached](/media/articles/policies/entity-limit-reached.png) + +::: note +Entity counts may take a few seconds to update. If you see a warning that you believe is in error, try again after a few seconds or contact support if the issue persists. +::: + +## Developer and Developer Pro subscription limits + +| Entity | Maximum | +| - | - | +| Applications | 100 | +| Connections | 100 | +| Rules | 100 | +| API Resource Servers | 100 | + +## Free subscription limits + +| Entity | Maximum | +| - | - | +| Applications | 10 | +| Connections | 10 | +| Rules | 10 | +| API Resource Servers | 10 | + +## Keep reading + +* [Rate Limit Policy](/policies/rate-limits) +* [Management API Endpoint Rate Limits](/policies/rate-limits-mgmt-api) +* [Authentication API Endpoint Rate Limits](/policies/rate-limits-auth-api) +* [Legacy Rate Limits](/policies/legacy-rate-limits) diff --git a/articles/policies/index.md b/articles/policies/index.md index 645fc57580..f404b79512 100644 --- a/articles/policies/index.md +++ b/articles/policies/index.md @@ -1,6 +1,6 @@ --- url: /policies -description: This page lists all of Auth0's established operational policies. +description: List of all of Auth0's established operational policies. topics: - auth0-policies contentType: @@ -21,5 +21,6 @@ Auth0 has established the following operational policies. - [Penetration Testing](/policies/penetration-testing) - [Migrations](/migrations) - [Rate Limits](/policies/rate-limits) -- [Restoration of a Deleted Tenant](/policies/restore-deleted-tenant) -- [Support Requests](/policies/requests) \ No newline at end of file +- [Entity Limits](/policies/entity-limits) +- [Tenant Restoration](/policies/restore-deleted-tenant) +- [Unsupported Requests](/policies/unsupported-requests) \ No newline at end of file diff --git a/articles/policies/legacy-rate-limits.md b/articles/policies/legacy-rate-limits.md new file mode 100644 index 0000000000..a1ddda609d --- /dev/null +++ b/articles/policies/legacy-rate-limits.md @@ -0,0 +1,173 @@ +--- +description: Describes Auth0's rate limit policy for subscriptions created before 05-21-2020 when working with Auth0 API endpoints. +topics: + - auth0-policies + - rate-limits +contentType: + - reference +useCase: + - support +--- +# Management API Endpoint Rate Limits before May 19, 2020 + +**This policy is effective for all paid and free subscriptions made before May 19, 2020.** + +::: warning +All subscriptions made on or after **May 19, 2020** are subject to the [updated rate limits](/policies/rate-limits-mgmt-api). +Starting on **June 18, 2020**, the new limits will apply to all tenants. You will be notified of the new limits through a **Dashboard Notification**. If the changes will impact your tenant, you will be notified directly via email with additional information about minimizing API calls and upgrading plans. +::: + +The rate limits for Auth0 Management API differ depending on whether your tenant is free or paid, production or not. + +| Tenant Type | Limit | +| - | - | +| Free or Trial | 2 requests per second (and bursts up to 10 requests) | +| Non-Production (Paid) | 2 requests per second (and bursts up to 10 requests) | +| Production (Paid) | 15 requests per second (and bursts up to 50 requests) | + +The aforementioned rate limits include calls made via [Rules](/rules) and are set **by tenant** and not by endpoint. + +The following Auth0 Management API endpoints return rate limit-related headers. For additional information about these endpoints, please consult the [Management API explorer](/api/management/v2). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    EndpointGETPOSTDELETEPATCHPUT
    Application Grants/client-grants/client-grants/client-grants/{id}/client-grants/{id}
    Signing Keys/keys/signing
    /keys/signing/{id}
    /keys/signing/rotate
    Limited to 5 requests per day
    /keys/signing/{kid}/revoke
    Applications/client
    /client/{id}
    /client/client/{id}/client/{id}
    Connections/connections
    /connections/{id}
    /connections/connections/{id}
    /connections/{id}/users
    /connections/{id}
    Device Credentials/device-credentials/device-credentials/device-credentials/{id}
    Logs/logs
    /log/{id}
    Rules/rules
    /rules/{id}
    /rules/rules/{id}/rules/{id}
    User Blocks/user-blocks
    /user-blocks/{id}
    /user-blocks
    /user-blocks/{id}
    Users/users
    /users/{id}
    /users/{id}/logs
    /users/{id}/enrollments
    /users
    /users/{id}/identities
    /users/{id}
    /users/{id}/identities
    /users/{id}/multifactor/{provider}
    /users/{id}
    Emails/emails/provider/emails/provider/emails/provider
    Jobs/jobs/{id}
    /jobs/{id}/errors
    /jobs/verification-email
    /jobs/users-imports
    /jobs/users-exports
    Resource Servers/resource-servers
    /resource-servers/{id}
    /resource-servers/resource-servers/{id}/resource-servers/{id}
    Stats/stats/active-users
    /stats/daily
    Tenants/tenants/settings/tenants/settings
    + +#### Concurrent import users jobs + +The [create import users job](/api/management/v2#!/Jobs/post_users_imports) endpoint has a limit of two concurrent import jobs. Requesting additional jobs while there are two pending returns a `429 Too Many Requests` response: + +```json +{ + "statusCode": 429, + "error": "Too Many Requests", + "message": "There are 2 active import users jobs, please wait until some of them are finished and try again +} +``` + +#### Access tokens for SPAs + +If you obtain Access Tokens for your SPAs, note that there are rate limits that are applicable when working with the available `current_user`-related [scopes and endpoints](/api/management/v2/get-access-tokens-for-spas#available-scopes-and-endpoints). You are allowed a maximum of **10 requests per minute per user**. diff --git a/articles/policies/load-testing.md b/articles/policies/load-testing.md index 2508ce8e54..fe8a00fbdb 100644 --- a/articles/policies/load-testing.md +++ b/articles/policies/load-testing.md @@ -9,58 +9,63 @@ contentType: useCase: - support --- - # Load Testing Policy -Load testing against the Auth0 production cloud service is not permitted at any time, as stated in our [Terms of Service](https://auth0.com/terms). +Auth0 recognizes that customers may occasionally need to perform load tests against its production cloud service. In order to ensure a successful test and maintain a high quality of service for all customers, Auth0 has established the following guidelines. Any load testing in Auth0 must be conducted in accordance with this Policy. -However, customers who have purchased an Enterprise subscription may request one load test (with up to 2 repeats) to conduct load testing against an Auth0 test instance. For load tests that require more than 100 RPS a separate environment will have to be created and it will have a different time schedule than normal load tests. +Only customers who have purchased an Enterprise subscription may conduct load testing. Free, Developer, Developer Pro and other non-Enterprise customers may not conduct load testing. Customers with an Enterprise subscription may request one load test (with up to 2 repeats) per year against an Auth0 production tenant. Performance and load testing is only allowed with Auth0's prior written approval. Once approved, testing can only target tenants that we have approved. -Note that Auth0 reserves the right to reject the load test request, or ask for modifications to the load test plans. -## How to request +::: note +Auth0 reserves the right to reject the load test request or ask for modifications. Failure to abide by this policy may result in temporary blocking of access to a tenant until the issue is remediated. +::: -* Customers **must** file a load testing request via the [Auth0 Support Center](${env.DOMAIN_URL_SUPPORT}). Under the **Issue type** field, select **Public Cloud Support Incident**. -* Requests must be filed at least two (2) weeks in advance of the desired test date. -* Requests must be approved in writing before any load/performance testing is conducted. +## How to request -## Test windows -Approved load testing windows are subject to availability of testing windows on a first-come first-served basis. Customers are encouraged to submit requests well in advance of the 2-week advance notice period. +Customers must file a load testing request via the Auth0 Support Center. Under the Issue typefield, select Public Cloud Support Incident. -Testing windows will have a scheduled start and end time assigned by Auth0 and all testing must begin and complete during the window. +To be considered for approval, the request must: -It is common for an initial load test to experience some unexpected issues, resulting in a need for repeat tests. Customers should plan in advance and allow sufficient time for repeat tests before any planned golive. +* Be filed at least two (2) weeks prior to the desired test date; in many cases, Auth0 encourages one (1) month of advance notice to ensure time for a thorough review and any required modifications. +* Be approved in writing before any testing is conducted. +* Stay within our [published production rate limits](/policies/rate-limits). +* Include all information described below. ## Information to include in requests -The load testing request must include the following information: + +The load testing request must include the following: * A description of the test to be done -* The name of the Auth0 tenant to be used during the test -* The date and time when the test will be performed +* The name and region of the Auth0 tenant to be used during the test +* The requested date and time of the test, including time zone * The requested duration of the test (2 hour maximum) -* The Auth0 features, such as rules, email, used during the test -* The Auth0 API methods and endpoints to be used, for example `GET /api/v2/clients` +* The platforms to be used for the test (desktop/laptop, iOS, Android, other) +* The Auth0 features (such as rules or email) used during the test +* The Auth0 API methods and endpoints to be used (for example `GET /api/v2/clients`) +* The maximum requests per second for each type of request or endpoint * The types of Auth0 connections involved in the test * Which Auth0 Rules, if any, will execute during the test * Which Custom DB, if any, will be used * Which Auth0 Webtasks, if any, will be used * Whether verification, welcome or other emails will be sent -* The peak load, specified in requests-per-second, expected for each API endpoint or Auth0 feature involved in the test. -* An explanation/justification for the peak load numbers. The justification should include the size of the target user population and realistic estimates of logins per hour to justify TPS numbers. +* The peak load, specified in requests-per-second, expected for each API endpoint or Auth0 feature involved in the test +* An explanation/justification for the peak load numbers, including the size of the target user population and realistic estimates of logins per hour * The ramp-up rate for the test * Contacts who will be available during the test and how to reach them +* Number of unique users participating in the load test -## Test requirements -Note that load testing will require customer to: +## Email considerations + +Before any testing, customers must: * Configure their own email provider in Auth0 * Receive approval from their email provider to send the expected volume of email * Make arrangements for bounced emails * Establish a mechanism for testing that emails arrived -## Limitations -Auth0 reserves the right to reject the load testing request, or ask for modifications to load test plans. +## Test requirements + +Load testing windows are subject to availability so advance notice is highly recommended. Once approved, load testing windows will have a scheduled start and end time not to exceed two (2) hours in duration. All testing must begin and end during this window. -A load testing approval will specify pre-arranged dates/times in which load testing can be performed. All load testing must be limited to those pre-arranged dates/times. Load testing windows will be a maximum of 2 hours in duration. Failure to abide by this policy may result in temporary blocking of access to an tenant until the issue is remediated. +Auth0 strongly recommends including a brief "ramp up" period to the desired load test target numbers. For example, a load test request of 100 RPS might be preceded by three five minute periods: 5 minutes at 25 RPS, 5 minutes at 50 RPS, and 5 minutes at 75 RPS. This ramp up period allows Auth0 and the customer to observe and compare effects at increasing RPS levels prior to peak RPS. If a ramp up period is not possible, please indicate why. -## Effectivity -This policy is effective April 4, 2016. It has been updated on September 17th, 2018. +_Updated February 4, 2019_ diff --git a/articles/policies/penetration-testing.md b/articles/policies/penetration-testing.md index 87d530bc0b..850efd2fc0 100644 --- a/articles/policies/penetration-testing.md +++ b/articles/policies/penetration-testing.md @@ -11,13 +11,17 @@ useCase: --- # Penetration Testing Policy -::: warning -This policy is effective August 1, 2017. -::: +**This policy is effective July 1, 2019.** -While conducting a security test of your own application it is **not** permitted to directly test Auth0 infrastructure (such as `tenant.auth0.com`) without prior approval. Please notify us in advance via the [Auth0 support center](${env.DOMAIN_URL_SUPPORT}). Auth0 requires at least **1 week** (7 days) notice prior to the test's planned start date. +If you have a *paid* Auth0 subscription, you may conduct a security test of your application involving Auth0 infrastructure (e.g. `your-tenant.auth0.com`) with **prior approval**. -Please provide the following information in the support ticket: +To conduct a security test, please notify us in advance via the [Auth0 Support Center](${env.DOMAIN_URL_SUPPORT}). Auth0 requires at least **1 week's (7 days')** notice prior to your test's planned start date. + +If the test is isolated to your infrastructure (that is, there will be no testing of Auth0 services), you do not need to notify Auth0. + +## Information required + +Please provide the following information in the support ticket when requesting approval for testing: 1. The specific dates/times of the test and timezone 2. The high level scope of the test @@ -25,13 +29,20 @@ Please provide the following information in the support ticket: 4. The Auth0 tenant(s) involved 5. Two (2) contacts who will be available during the entire test period in case we need to contact you. If we have any questions, we will make a reasonable attempt to contact you. If you cannot be reached, we reserve the right to take measures to protect the service, which may include shutting down or blocking your tenant and/or the source of the intrusion traffic. +## Requirements + Auth0 requires that: -* The test be restricted to only your tenant +* The test be restricted to only your tenant * You disclose any suspected findings to the Auth0 Security team for explanation/discussion +* You understand that your tenant will be moved between environments during testing. Auth0 will move your tenant from the Production environment to the Preview environment before the testing commences. Auth0 will then return your tenant to the Production environment once the testing period ends. Note that while your tenant is on the Preview environment it may receive updates more rapidly. -Private SaaS Appliance customers should also request permission to run a penetration test via the [Auth0 support center](${env.DOMAIN_URL_SUPPORT}). Please include the information listed above with your support request. +## Private Cloud customers -If the test is isolated to your infrastructure (that is, there will be no testing of Auth0 services), you do not need to notify Auth0. +Private Cloud customers should also request permission to run a penetration test via the [Auth0 support center](${env.DOMAIN_URL_SUPPORT}). Please include the [information listed above](/policies/penetration-testing#information-required) with your support request. + +## Restrictions -You may not conduct any [load testing](/policies/load-testing) (such as Denial of Service testing) per the load testing policy. +* You may not conduct any [load testing](/policies/load-testing) (such as Denial of Service testing) per the load testing policy. +* You may not conduct any penetration testing targeting our management dashboard. Management and Authentication APIs are allowed. +* You may not conduct any penetration testing targeting tenants that we have not approved. diff --git a/articles/policies/rate-limits-auth-api.md b/articles/policies/rate-limits-auth-api.md new file mode 100644 index 0000000000..546658f45a --- /dev/null +++ b/articles/policies/rate-limits-auth-api.md @@ -0,0 +1,297 @@ +--- +title: Authentication API Endpoint Rate Limits +description: Describes Auth0's rate limit policy when working with Auth0 Authentication API endpoints. +toc: true +topics: + - auth0-policies + - rate-limits +contentType: + - reference +useCase: + - support +--- +# Authentication API Endpoint Rate Limits + +Each Authentication API endpoint is configured with a bucket that defines: + +- Request limit +- Rate limit window (per second, per minute, per day, etc.) + +```text +bucket: + size: x + per_minute: y +``` + +For example, the above states that, for the given bucket, there is a maximum request limit of `x` per minute, and for each minute that elapses, permissions for `y` requests are added back. In other words, for each `60 / y` seconds, one additional request is added to the bucket. This occurs automatically until the bucket contains the maximum permitted number of requests. + +For some API endpoints, the rate limits are defined per bucket, so the origins of the call do not influence the rate limit changes. For other buckets, the rate limits are defined using different keys, so the originating IP address is considered when counting the number of received API calls. + +::: note +If you are using an API endpoint **not** listed below and you receive rate limit headers as part of your response, see [Anomaly Detection](/anomaly-detection) for more information. +::: + +## Limits for production tenants of paying customers + +| Endpoint | Path | Limited By | Rate Limit | +| - | - | - | - | +| All Endpoints | [All Authentication API endpoints](/api/authentication) | Sum of all combined requests to any Authentication API endpoint | 100 requests per second | +| User Profile | `/tokeninfo` (Legacy) | IP Address | 800 requests per minute | +| | `/userinfo` | User ID | 5 requests per minute with bursts up to 10 requests | +| Delegation | `/delegation` | User ID, IP Address | 10 requests per second | +| Change Password | `/dbconnections/change_password` | User Email, IP Address | 1 request per minute with bursts up to 10 requests | +| Signup | `/dbconnections/signup` | IP Address | 50 requests per minute | +| Get Passwordless Code or Link | `/passwordless/start` | IP Address | 50 requests per hour when using non-authenticated calls. It's considered an Authentication API endpoint otherwise. | + +## Limits for non-production tenants of paying customers and all tenants of free customers + +| Endpoint | Path | Limited By | Rate Limit | +| - | - | - | - | +| User Profile | `/tokeninfo` (Legacy) | IP Address | 800 requests per minute | +| | `/userinfo` | User ID | 5 requests per minute with bursts up to 10 requests | +| Delegation | `/delegation` | User ID, IP Address | 10 requests per second | +| Change Password | `/dbconnections/change_password` | User Email, IP Address | 1 request per minute with bursts up to 10 requests | +| Signup | `/dbconnections/signup` | IP Address | 50 requests per minute | +| Get Passwordless Code or Link | `/passwordless/start` | IP Address | 50 requests per hour | +| Get Token | `/oauth/token` | Any request | 30 requests per second | +| Cross Origin Authentication | `/co/authenticate` | Any request | 5 requests per second | +| Authentication | `usernamepassword/login` | Any request | 5 requests per second | +| Resource Owner (Legacy) | `/oauth/ro` | Any request | 10 requests per second | +| JSON Web Token Keys | `/.well-known/jwks.json` | Any request | 20 requests per second | + +## Free tenant global limits + +To ensure Auth0's quality of service, the Authentication API is subject to several levels of rate limiting for free subscribers. Auth0's Authentication API has a global limit of **300 requests per minute** for free tenants. + +::: note +The limit is global for the tenant and not per endpoint. +::: + +### Affected endpoints + +The global rate limit applies to all [Authentication API](/api/authentication) endpoints. A complete list of endpoints that are affected by this limit, along with the associated response if the rate limit is exceeded, is a follows: + +Endpoint | Response +---------|--------- +`GET /authorize` | [Error Page](#error-page) +`GET /passwordless/verify_redirect` | [Error Page](#error-page) +`POST /dbconnections/change_password` | [JSON Error](#json-error) (`too_many_requests`) +`GET /dbconnections/change_password` | [JSON Error](#json-error) (`too_many_requests`) +`POST /dbconnections/self_change_password` | [JSON Error](#json-error) (`too_many_requests`) +`POST /co/authenticate` | [JSON Error](#json-error) (`access_denied`) +`POST /delegation` | [JSON Error](#json-error) (`too_many_requests`) +`GET /delegation` | [JSON Error](#json-error) (`too_many_requests`) +`GET /activate` | [Error Page](#error-page) +`POST /activate` | [Error Page](#error-page) +`POST /oauth/device/code` | [JSON Error](#json-error) (`access_denied`) +`POST /oauth/ro` | [JSON Error](#json-error) (`access_denied`) +`GET /oauth/ro` | [JSON Error](#json-error) (`access_denied`) +`POST /oauth/token` | [JSON Error](#json-error) (`access_denied`) +`POST /oauth/introspect` | [JSON Error](#json-error) (`access_denied`) +`GET /passwordless/start` | [JSON Error](#json-error) (`too_many_requests`) +`POST /passwordless/start` | [JSON Error](#json-error) (`too_many_requests`) +`POST /u/reset-password/request/:connection` | [Error Page](#error-page) +`GET /u/consent` | [Error Page](#error-page) +`POST /u/consent` | [Error Page](#error-page) +`GET /u/login` | [Error Page](#error-page) +`POST /u/login` | [Error Page](#error-page) +`GET /u/mfa-country-codes` | [Error Page](#error-page) +`POST /u/mfa-country-codes` | [Error Page](#error-page) +`GET /u/mfa-email-challenge` | [Error Page](#error-page) +`POST /u/mfa-email-challenge` | [Error Page](#error-page) +`GET /u/mfa-email-enrollment` | [Error Page](#error-page) +`POST /u/mfa-email-enrollment` | [Error Page](#error-page) +`GET /u/mfa-email-enrollment-verify` | [Error Page](#error-page) +`POST /u/mfa-email-enrollment-verify` | [Error Page](#error-page) +`GET /u/mfa-email-list` | [Error Page](#error-page) +`POST /u/mfa-email-list` | [Error Page](#error-page) +`GET /u/mfa-enroll-options` | [Error Page](#error-page) +`POST /u/mfa-enroll-options` | [Error Page](#error-page) +`GET /u/mfa-guardian-list` | [Error Page](#error-page) +`POST /u/mfa-guardian-list` | [Error Page](#error-page) +`GET /u/mfa-guardian-welcome` | [Error Page](#error-page) +`POST /u/mfa-guardian-welcome` | [Error Page](#error-page) +`GET /u/mfa-login-options` | [Error Page](#error-page) +`POST /u/mfa-login-options` | [Error Page](#error-page) +`GET /u/mfa-otp-challenge` | [Error Page](#error-page) +`POST /u/mfa-otp-challenge` | [Error Page](#error-page) +`GET /u/mfa-otp-enrollment` | [Error Page](#error-page) +`POST /u/mfa-otp-enrollment` | [Error Page](#error-page) +`GET /u/mfa-push-challenge` | [Error Page](#error-page) +`POST /u/mfa-push-challenge` | [Error Page](#error-page) +`GET /u/mfa-push-enrollment` | [Error Page](#error-page) +`POST /u/mfa-push-enrollment` | [Error Page](#error-page) +`GET /u/mfa-recovery-code-challenge` | [Error Page](#error-page) +`POST /u/mfa-recovery-code-challenge` | [Error Page](#error-page) +`GET /u/mfa-recovery-code-challenge-new-code` | [Error Page](#error-page) +`POST /u/mfa-recovery-code-challenge-new-code` | [Error Page](#error-page) +`GET /u/mfa-recovery-code-enrollment` | [Error Page](#error-page) +`POST /u/mfa-recovery-code-enrollment` | [Error Page](#error-page) +`GET /u/mfa-sms-challenge` | [Error Page](#error-page) +`POST /u/mfa-sms-challenge` | [Error Page](#error-page) +`GET /u/mfa-sms-enrollment` | [Error Page](#error-page) +`POST /u/mfa-sms-enrollment` | [Error Page](#error-page) +`GET /u/mfa-sms-enrollment-verify` | [Error Page](#error-page) +`POST /u/mfa-sms-enrollment-verify` | [Error Page](#error-page) +`GET /u/mfa-sms-list` | [Error Page](#error-page) +`POST /u/mfa-sms-list` | [Error Page](#error-page) +`GET /u/reset-password` | [Error Page](#error-page) +`POST /u/reset-password` | [Error Page](#error-page) +`GET /u/reset-password/request/:connection` | [Error Page](#error-page) +`GET /u/signup` | [Error Page](#error-page) +`POST /u/signup` | [Error Page](#error-page) +`GET /tokeninfo` | Text: "Rate limit exceed" +`POST /tokeninfo` | Text: "Rate limit exceed" +`POST /userinfo` | Text: "Rate limit exceed" +`GET /userinfo` | Text: "Rate limit exceed" +`POST /usernamepassword/login` | [JSON Error](#json-error) (`too_many_requests`) +`GET /usernamepassword/login` | [JSON Error](#json-error) (`too_many_requests`) +`GET /.well-known/jwks.json` | Text: "Rate limit exceed" +`GET /.well-known/openid-configuration` | [JSON Error](#json-error) (`access_denied`) +`GET /cer/:clientID?` | Text: "Rate limit exceed" +`GET /pb7/:clientID?` | Text: "Rate limit exceed" +`GET /pem/:clientID?` | Text: "Rate limit exceed" +`GET /rawpem/:clientID?` | Text: "Rate limit exceed" +`GET /samlp/:clientID` | Text: "Rate limit exceed" +`POST /samlp/:clientID` | Text: "Rate limit exceed" +`GET /samlp/metadata` | Text: "Rate limit exceed" +`GET /samlp/metadata/:clientID` | Text: "Rate limit exceed" +`GET /:clientID/trust/mex` | XML Error (`wst:RequestFailed`) +`POST /:clientID/trust/usernamemixed` | XML Error (`wst:RequestFailed`, Status Code: 500) +`GET /decision` | [Error Page](#error-page) +`POST /decision` | [Error Page](#error-page) +`POST /drwatson` | Text: "Rate limit exceed" +`POST /mfa/associate` | [JSON Error](#json-error) (`access_denied`) +`GET /mfa/authenticators` | [JSON Error](#json-error) (`access_denied`) +`DELETE /mfa/authenticators/:authenticator_id` | [JSON Error](#json-error) (`access_denied`) +`POST /mfa/challenge` | [JSON Error](#json-error) (`access_denied`) +`GET /oauth/access_token` | [JSON Error](#json-error) (`access_denied`) +`POST /oauth/access_token` | [JSON Error](#json-error) (`access_denied`) +`GET /p/:strategy/:ticket` | Text: "Rate limit exceed" +`POST /p/:strategy/:ticket` | Text: "Rate limit exceed" +`GET /p/:strategy/:ticket/info` | Text: "Rate limit exceed" +`GET /passwordless/verify` | [JSON Error](#json-error) (`too_many_requests`) +`POST /passwordless/verify` | [JSON Error](#json-error) (`too_many_requests`) +`GET /rms` | [Error Page](#error-page) +`GET /rms/:clientID/adfs/fs/federationserverservice.asmx` | XML Error (`fed:BadRequest`) +`POST /rms/:clientID/adfs/fs/federationserverservice.asmx` | XML Error (`fed:BadRequest`) +`GET /rms/:clientID/FederationMetadata/2007-06/FederationMetadata.xml` | [JSON Error](#json-error) (`too_many_requests`) +`GET /samlp/:clientID/logout` | [Error Page](#error-page) +`POST /samlp/:clientID/logout` | [Error Page](#error-page) +`GET /samlp/idp/slo` | Text: "Rate limit exceed" +`GET /sso_dbconnection_popup/:clientID` | [JSON Error](#json-error) (`access_denied`) +`GET /wsfed` | [Error Page](#error-page) +`GET /wsfed/:clientID` | [Error Page](#error-page) +`GET /wsfed/:clientID/FederationMetadata/2007-06/FederationMetadata.xml` | [Error Page](#error-page) +`GET /wsfed/FederationMetadata/2007-06/FederationMetadata.xml` | [Error Page](#error-page) +`GET /.well-known/apple-app-site-association` | [JSON Error](#json-error) (`access_denied`) +`GET /.well-known/assetlinks.json` | [JSON Error](#json-error) (`access_denied`) +`GET /adfs/fs/federationserverservice.asmx` | XML Error (`fed:BadRequest`) +`POST /adfs/fs/federationserverservice.asmx` | XML Error (`fed:BadRequest`) +`GET /apple-app-site-association` | [JSON Error](#json-error) (`access_denied`) +`GET /aws-saml/metadata` | Text: "Rate limit exceed" +`GET /changepwd/completed` | [JSON Error](#json-error) (`too_many_requests`) +`GET /changepwd/form` | [Error Page](#error-page) +`POST /changepwd/reset` | [JSON Error](#json-error) (`too_many_requests`) +`POST /co/verify` | Text: "Rate limit exceed" +`GET /continue` | [Error Page](#error-page) +`POST /continue` | [Error Page](#error-page) +`GET /custom-login/preview` | [JSON Error](#json-error) (`too_many_requests`) +`POST /dbconnections/delete` | [JSON Error](#json-error) (`too_many_requests`) +`GET /dbconnections/login` | [JSON Error](#json-error) (`too_many_requests`) +`POST /dbconnections/login` | [JSON Error](#json-error) (`too_many_requests`) +`GET /dbconnections/signup` | [JSON Error](#json-error) (`too_many_requests`) +`POST /dbconnections/signup` | [JSON Error](#json-error) (`too_many_requests`) +`POST /dbconnections/verify_email` | [JSON Error](#json-error) (`too_many_requests`) +`GET /FederationMetadata/2007-06/FederationMetadata.xml` | XML Error (`fed:BadRequest`) +`GET /i/login` | [Error Page](#error-page) +`GET /i/login/sso/:provider` | Text: "Rate limit exceed" +`GET /i/oauth2/authorize` | [JSON Error](#json-error) (`access_denied`) +`GET /login` | [Error Page](#error-page) +`GET /login/callback` | [Error Page](#error-page) +`POST /login/callback` | [Error Page](#error-page) +`GET /logout` | [Error Page](#error-page) +`POST /logout` | [Error Page](#error-page) +`GET /mf` | [Error Page](#error-page) +`POST /mf` | [Error Page](#error-page) +`POST /oauth/reverse` | [JSON Error](#json-error) (`access_denied`) +`POST /oauth/revoke` | [JSON Error](#json-error) (`access_denied`) +`POST /state/introspect` | [JSON Error](#json-error) (`too_many_requests`) +`GET /unblock` | [Error Page](#error-page) +`POST /unlink` | [JSON Error](#json-error) (`too_many_requests`) +`GET /user/ssodata` | Text: "Rate limit exceed" +`GET /users/:id/impersonate` | [JSON Error](#json-error) (`too_many_requests`) +`POST /users/:id/impersonate` | [JSON Error](#json-error) (`too_many_requests`) +`GET /v2/logout` | [Error Page](#error-page) + +## Exceeding the Rate Limit + +If you exceed the rate limit for a given API endpoint, you'll receive an [HTTP 429 (Too Many Requests)](http://tools.ietf.org/html/rfc6585#section-4) response (except for the cases documented in the [previous section](#affected-endpoints)). The response will also contain [HTTP Response Headers](/policies/rate-limits#http-response-headers) that provide additional information on the rate limits applicable to that endpoint. + +If you exceed the global rate limit, the following example log entry will be emitted to your logs: **You have reached the global limit for your account**. There will be a single log entry per hour while your account exceeds the rate limit. + +To view the log entries for a subscription, navigate the to [Logs](${manage_url}#/logs) page in the [Dashboard](${manage_url}). + +### Reducing the number of calls to Auth0 + +When you exceed your rate limits, you'll need to reduce the number of calls you make to Auth0. The specifics depend on your use case, but here are some recommendations: + + * Cache `/.well-known/*` responses: This information does not change frequently, so you can usually cache it to reduce the number of times you need to call Auth0. + + * Consider requesting an `id_token` instead of calling `/userinfo` to get information about the user. + +### Response body + +The response body you receive depends on the endpoint. Each endpoint typically provides a return value in a different format (for example, some return an HTTP response, while others redirect to a URL and pass values in the query string). If the endpoint typically provides the response expected as JSON in the HTTP body, then a JSON error response will be sent if a rate limit is reached (exceptions are documented above). + +To view the particular response per endpoint, see [Affected endpoints](#affected-endpoints). Descriptions of each possible error are listed below. + +#### Error Page + +The Error Page response is sent for endpoints that render HTML content to the end user. When you exceed the rate limit, Auth0 renders the [Error Page](/universal-login/custom-error-pages) instead of the expected content. + +#### JSON Error + +Endpoints that usually provide JSON-formatted responses will return a JSON object containing an error code and description. + +```json +{ + "error": "access_denied or too_many_requests", + "error_description": "Global rate limit exceeded", + "error_uri": "https://.../... documentation url" +} +``` + +The error you receive depends on the type of endpoint you're calling: + +* `access_denied`: for OAuth endpoints +* `too_many_requests`: for endpoints that return JSON + +#### XML Error + +XML Errors are returned for endpoints that normally return XML. + +```xml + + + + + env:Sender + + fed:BadRequest or wst:RequestFailed + + + + Global rate limit exceeded + + + + + + +``` + +The error you receive depends on the type of endpoint you're calling: + +- `fed:BadRequest` will be sent for WSFed-related endpoints. +- `wst:RequestFailed` will be used in for WSTrust-related endpoints. diff --git a/articles/policies/rate-limits-mgmt-api.md b/articles/policies/rate-limits-mgmt-api.md new file mode 100644 index 0000000000..6c8340b61b --- /dev/null +++ b/articles/policies/rate-limits-mgmt-api.md @@ -0,0 +1,100 @@ +--- +title: Management API Endpoint Rate Limits +description: Describes Auth0's rate limit policy when working with Auth0 Management API endpoints. +toc: true +topics: + - auth0-policies + - rate-limits +contentType: + - reference +useCase: + - support +--- +# Management API Endpoint Rate Limits + +**This policy is effective May 19, 2020.** + +::: warning +If you subscribed before **May 19, 2020**, the [previous rate limit policy](/policies/legacy-rate-limits) applies to you until **June 18, 2020**. Starting on **June 18, 2020**, these limits will apply to all tenants. You will be notified of the new limits through a **Dashboard Notification**. If the new limits impact your tenant, you will be notified directly via email with additional information about minimizing API calls and upgrading plans. +::: + +The rate limits for this API differ depending on whether your tenant is free or paid, production or not. + +| Tenant Type | Rate Limit (per second) | Rate Limit (per minute) | +| - | - | - | +| Free or Trial | 10 | 120 | +| Developer or Developer Pro (created before May 19, 2020) | 50 | 1000 | +| Enterprise (Production) | 50 | 1000 | +| Enterprise (Non-production) | 10 | 120 | + +The rate limits include calls made via [Rules](/rules) and are set **by tenant** and not by endpoint. + +Each endpoint is configured with a bucket that defines: + +- Request limit +- Rate limit window (per second, per minute, per day, etc.) + +```text +bucket: + size: x + per_minute: y +``` + +For example, the above states that, for the given bucket, there is a maximum request limit of `x` per minute, and for each minute that elapses, permissions for `y` requests are added back. In other words, for each `60 / y` seconds, one additional request is added to the bucket. This occurs automatically until the bucket contains the maximum permitted number of requests. + +For some API endpoints, the rate limits are defined per bucket, so the origins of the call do not influence the rate limit changes. For other buckets, the rate limits are defined using different keys, so the originating IP address is considered when counting the number of received API calls. + +::: note +If you are using an API endpoint **not** listed below and you receive rate limit headers as part of your response, see [Anomaly Detection](/anomaly-detection) for more information. +::: + +The following Auth0 Management API endpoints return rate limit-related headers. For additional information about these endpoints, please consult the [Management API explorer](/api/management/v2). + +## Developer and Developer Pro subscription limits + +| Endpoint Group | Path | Rate Limit (per second) | Rate Limit (per minute) | +| - | - | - | - | +| Read users | `GET /api/v2/users` | 40 | 500 | +| | `GET /api/v2/users-by-email` | | | +| | `GET /api/v2/users/{id}` | | | +| Write users | `POST /api/v2/users` | 20 | 200 | +| | `POST /api/v2/users/{id}/identities` | | | +| | `PATCH /api/v2/users/{id}` | | | +| | `DELETE /api/v2/connections/{id}/users` | | | +| | `DELETE /api/v2/users/{id}/identities/{provider}/{user_id}` | | | +| | `DELETE /api/v2/users/{id}` | | | +| Read logs | `GET /api/v2/logs` | 10 | 100 | +| | `GET /api/v2/logs/{id}` | | | +| | `GET /api/v2/users/{id}/logs` | | | +| Read clients | `GET /api/v2/clients` | 5 | 100 | +| | `GET /api/v2/clients/{id}` | | | +| Read connections | `GET /api/v2/connections` | 10 | 100 | +| | `GET /api/v2/connections/{id}` | | | +| Write device credentials | `POST /api/v2/device-credentials` | 5 | 100 | +| | `DELETE /api/v2/device-credentials/{id}` | | | +| All other endpoints combined | | 10 | 150 | + +## Endpoint limits for all subscriptions + +| Endpoint | Path | Rate Limit (per second) | Rate Limit (per minute) | Rate Limit (per day) | +| - | - | - | - | - | +| Verify custom domain | `POST /api/v2/custom-domains{id}/verify` | n/a | 5 | n/a | +| Register dynamic client | `POST /oidc/register` | 5 | n/a | n/a | +| Read connection status | `GET /api/v2/connections/{id}/status` | 15 | n/a | n/a | +| Rotate signing keys | `POST /api/v2/keys/signing/rotate` | n/a | n/a | 5 | + +## Concurrent import users job limits + +The [create import users job](/api/management/v2#!/Jobs/post_users_imports) endpoint has a limit of 2 concurrent import jobs. If you request additional jobs while there are 2 pending returns, the following response occurs: + +```json +{ + "statusCode": 429, + "error": "Too Many Requests", + "message": "There are 2 active import users jobs, please wait until some of them are finished and try again +} +``` + +## Access token limits for SPAs + +If you obtain Access Tokens for your SPAs, there are rate limits that are applicable when working with the available `current_user`-related [scopes and endpoints](/api/management/v2/get-access-tokens-for-spas#available-scopes-and-endpoints). You are allowed a maximum of **10 requests per minute per user**. diff --git a/articles/policies/rate-limits.md b/articles/policies/rate-limits.md index 5dc6b45bde..3c86e92079 100644 --- a/articles/policies/rate-limits.md +++ b/articles/policies/rate-limits.md @@ -1,292 +1,79 @@ --- -title: Rate Limit Policy For Auth0 APIs -description: This page details Auth0's Rate Limit Policy with hitting Auth0 API endpoints. -toc: true +title: Rate Limit Policy +description: Describes Auth0's rate limit policy. +toc: true topics: - auth0-policies - rate-limits - - testing contentType: - reference useCase: - support --- -# Rate Limit Policy For Auth0 APIs +# Rate Limit Policy -To ensure the quality of Auth0's services, the Auth0 APIs are subject to rate limiting. +Actions such as rapidly updating configuration settings, aggressive polling, or making highly concurrent API calls may result in your app being rate limited. -::: warning -Auth0 reserves the right to modify the rate limits at any time. For the up-to-date information on rate limits, please review the headers returned from rate limited endpoints. -::: +Auth0's rate limits vary based on the tenant type you have. The tenants that have no credit card associated in the [Dashboard](${manage_url}/#/tenant/billing/payment) are free. There are also variations in terms of paid tenant types (e.g., non-production, production). To set an environment for your tenant (development, staging or production), go to [Support Center > Tenants](${env.DOMAIN_URL_SUPPORT}/tenants/public), find your tenant, select __Assign Environment Tag__, set the environment and save changes. -## Limits +## API endpoint limits -Depending on the API endpoint, the request limit and the rate limit window in which the request limit resets, varies. +To ensure the quality of Auth0's services, the Auth0 APIs are subject to rate limiting. Depending on the API endpoint, the request limit and the rate limit window in which the request limit resets, varies. -Each endpoint is configured with a bucket that defines: +Using the Management API for free and trial tenants is restricted to **2 requests per second** (with bursts of up to **10 requests**). Exceeding these values triggers an HTTP 429 error, but the error message states, "Global limit has been reached." These are in addition to those indicated in the rate limit response headers. -- the request limit, and -- the rate limit window (per second, per minute, per hour, and so on) - -```text -bucket: - size: x - per_minute: y -``` - -For example, the above states that, for the given bucket, there is a maximum request limit of `x` per minute, and for each minute that elapses, permissions for `y` requests are added back. In other words, for each `60 / y` seconds, one additional request is added to the bucket. This occurs automatically until the bucket contains the maximum permitted number of requests. - -::: warning -For some API endpoints, the rate limits are defined per bucket, so the origins of the call do not influence the rate limit changes. For other buckets, the rate limits are defined using different keys, so the originating IP address is considered when counting the number of received API calls. -::: - -## Exceeding the Rate Limit - -If you exceed the provided rate limit for a given API endpoint, you will receive a response with [HTTP Status Code 429 (Too Many Requests)](http://tools.ietf.org/html/rfc6585#section-4). You can refer to the [HTTP Response Headers](#http-response-headers) for more information on the rate limits applicable to that endpoint. +If your app triggers the rate limit, please refrain from making additional requests until the appropriate amount of time has elapsed. -Actions such as rapidly updating configuration settings, aggressive polling, or making highy concurrent API calls may result in your app being rate limited. +See the rate limits for [Management API Endpoints](/policies/rate-limits-mgmt-api) and [Authentication API Endpoints](/policies/rate-limits-auth-api) for complete details on each endpoint limitation. -If your app triggers the rate limit, please refrain from making additional requests until the appropriate amount of time has elapsed. +### Review HTTP response headers -## HTTP Response Headers +Auth0 reserves the right to modify the rate limits at any time. For the up-to-date information on rate limits, you can review the HTTP response headers returned from rate limited endpoints. -API requests to selected [Authentication](/api/authentication) or [Management API](/api/management/v2) endpoints will return HTTP Response Headers that provide relevant data on the current status of your rate limits for that endpoint. If you receive a rate limit-related response header, it will include numeric information detailing your status. +API requests to selected [Authentication](/api/authentication) or [Management API](/api/management/v2) endpoints will return HTTP response headers that provide relevant data on the current status of your rate limits for that endpoint. If you receive a rate limit-related response header, it will include numeric information detailing your status. * **X-RateLimit-Limit**: The maximum number of requests available in the current time frame. * **X-RateLimit-Remaining**: The number of remaining requests in the current time frame. * **X-RateLimit-Reset**: A [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time) of the expected time when the rate limit will reset. -## Endpoints with Rate Limits - -::: note -If you are using an API endpoint **not** listed below and you receive rate limit headers as part of your response, please see the page on [Anomaly Detection](/anomaly-detection) for additional information. -::: - -### Management API v2 - -The rate limits for this API defer depending on whether your tenant is free or paid, production or not. +### Handle rates limitations in code -::: note -- The tenants that have no credit card associated in the [Dashboard](${manage_url}/#/tenant/billing/payment) are free. -- To set an environment for your tenant (development, staging or production), go to [Support Center > Tenants](${env.DOMAIN_URL_SUPPORT}/tenants/public), find your tenant, select __Assign Environment Tag__, set the environment and save changes. -::: +You should add logic to handle cases in which you exceed the provided rate limits and receive the HTTP Status Code 429 (Too Many Requests). In this case, if a retry is needed, it is best to allow for a back-off to avoid going into an infinite retry loop. -The following rate limits apply: +For scripts and rules that call Auth0 APIs, you should always handle rate limiting by checking the `X-RateLimit-Remaining` header and acting appropriately when the number returned nears 0. -- For all __free tenants__, usage of the Management API is restricted to 2 requests per second (and bursts up to 10 requests). -- For __non-production tenants__ of enterprise customers, usage of the Management API is restricted to 2 requests per second (and bursts up to 10 requests). -- For __paid__ tenants, usage of the Management API is restricted to 15 requests per second (and bursts up to 50 requests). +## Database login limits -The aforementioned rate limits include calls made via [Rules](/rules). +For database connections, Auth0 limits certain types of repeat login attempts depending on the user account and IP address. For more information, see [Rate Limits on User/Password Authentication](/policies/rate-limit-policy/database-connections-rate-limits). -Note, that the limit is set by tenant and not by endpoint. +## SMS/Voice message limits for multi-factor authentication -The following Auth0 Management API endpoints return rate limit-related headers. For additional information about these endpoints, please consult the [Management API explorer](/api/management/v2). +There's a limit of 10 SMS or Voice messages/hour per user for MFA. For more information, see [Configure SMS or Voice Notifications for MFA](/mfa/guides/configure-phone). - +## Native social login limits - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    EndpointGETPOSTDELETEPATCH
    Application Grants/client-grants/client-grants/client-grants/{id}/client-grants/{id}
    Applications/client
    /client/{id}
    /client/client/{id}/client/{id}
    Connections/connections
    /connections/{id}
    /connections/connections/{id}
    /connections/{id}/users
    /connections/{id}
    Device Credentials/device-credentials/device-credentials/device-credentials/{id}
    Logs/logs
    /log/{id}
    Rules/rules
    /rules/{id}
    /rules/rules/{id}/rules/{id}
    User Blocks/user-blocks
    /user-blocks/{id}
    /user-blocks
    /user-blocks/{id}
    Users/users
    /users/{id}
    /users/{id}/logs
    /users/{id}/enrollments
    /users
    /users/{id}/identities
    /users/{id}
    /users/{id}/identities
    /users/{id}/multifactor/{provider}
    /users/{id}
    Emails/emails/provider/emails/provider/emails/provider
    Jobs/jobs/{id}
    /jobs/{id}/errors
    /jobs/verification-email
    /jobs/users-imports
    Resource Servers/resource-servers
    /resource-servers/{id}
    /resource-servers/resource-servers/{id}/resource-servers/{id}
    Stats/stats/active-users
    /stats/daily
    Tenants/tenants/settings/tenants/settings
    +Limits are only applied to requests related to the Native Social Login flows, which are identified based on the body of the requests with the following initial criteria: -### Authentication API +| Request Type | Body | +| - | - | +| `grant_type` | `urn:ietf:params:oauth:grant-type:token-exchange` | +| `subject_token_type` | `http://auth0.com/oauth/token-type/apple-authz-code` | -The following Auth0 Authentication API endpoints return rate limit-related headers. +### Limits for production tenants of paying customers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +| Endpoint | Path | Limited By | Rate Limit | +| - | - | - | - | +| Get Token | `/oauth/token` | Any native social login request | 50 per minute with bursts up to 500 requests | - - - - - - - - - - - - - - - - - - - - - - -
    EndpointPathLimited ByAffected TenantsRate Limit
    User Profile/tokeninfo (legacy)IPAll800 requests per minute
    /userinfoUser IDAll5 requests per minute with bursts of up to 10 requests
    Delegated Authentication (legacy)/delegationUser ID and IPAll1 request per minute with bursts of up to 10 requests
    (any request)Free (*)10 requests per second
    Change Password/dbconnections/change_passwordUser ID and IPAll1 request per minute with bursts of up to 10 requests
    Get Passwordless Code or Link/passwordless/startIPAll50 requests per hour
    Get Token/oauth/token(any request)Free30 requests per second
    Cross Origin Authentication/co/authenticate(any request)Free5 requests per second
    Authentication/usernamepassword/login(any request)Free5 requests per second
    Resource Owner (legacy)/oauth/ro(any request)Free10 requests per second
    JSON Web Token Keys/.well-known/jwks.json(any request)Free20 requests per second
    +### Limits for non-production tenants of paying customers and all tenants of free customers -:::note -(*) In all instances above, **Free** includes tenants on the Free plan, as well as the non-production tenants of enterprise customers. -::: +| Endpoint | Path | Limited By | Rate Limit | +| - | - | - | - | +| Get Token | `/oauth/token` | Native social login requests and IP | 30 per minute | -## Limits on Database Logins +## Keep reading -For database connections Auth0 limits certain types of repeat login attempts depending on the user account and IP address. For more information, see [Rate Limits on User/Password Authentication](/connections/database/rate-limits). +* [Management API Endpoint Rate Limits](/policies/rate-limits-mgmt-api) +* [Authentication API Endpoint Rate Limits](/policies/rate-limits-auth-api) +* [Legacy Rate Limits](/policies/legacy-rate-limits) +* [Entity Limit Policy](/policies/entity-limits) diff --git a/articles/policies/requests.md b/articles/policies/requests.md deleted file mode 100644 index 62a11bbf32..0000000000 --- a/articles/policies/requests.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -description: The following is a list of requests Auth0 currently doesn't support. -topics: - - auth0-policies - - support -contentType: - - reference -useCase: - - support ---- - -# Unsupported Requests - -Our support team strives to assist you to the best of our ability. However, we are currently unable to grant the following requests: - -* Transferring data from a non-production to a production account - -* Renaming a tenant - -* Renaming a connection \ No newline at end of file diff --git a/articles/policies/restore-deleted-tenant.md b/articles/policies/restore-deleted-tenant.md index cf898b2a4c..a9e135d7c6 100644 --- a/articles/policies/restore-deleted-tenant.md +++ b/articles/policies/restore-deleted-tenant.md @@ -12,12 +12,12 @@ useCase: # Tenant Restoration Policy -::: note -If you are considering deleting your tenant, please see our [Resetting/Deleting Tenant](/tutorials/delete-reset-tenant) page for alternative options. +::: warning +**Deleted tenants cannot be restored** and the **tenant name may not be used again** when creating new tenants. ::: -As explicitely noted during the tenant deletion process, **deleted tenants cannot be restored** at this time. +**Before you delete your tenant, please check out the following resources for alternative options:** +* [Updating a Tenant Admin](https://auth0.com/docs/dashboard/manage-dashboard-admins#update-admin) **for changing ownership of the tenant** +* [Delete or Reset Tenants](/tutorials/delete-reset-tenant) for reseting tenant configuration. -::: note -If you have deleted your tenant and you require a certain domain or unique domain for branding purposes, we recommend configuring a [custom domain](/custom-domains) for your new tenant. -::: +If you've deleted your tenant, and you require the use of a particular domain name, we recommend configuring a [custom domain name](/custom-domains) for your new tenant. diff --git a/articles/policies/unsupported-requests.md b/articles/policies/unsupported-requests.md new file mode 100644 index 0000000000..793fd7ff2f --- /dev/null +++ b/articles/policies/unsupported-requests.md @@ -0,0 +1,41 @@ +--- +description: The following is a list of requests Auth0 currently doesn't support. +topics: + - auth0-policies + - support +contentType: + - reference +useCase: + - support +--- + +# Unsupported Requests + +Our support team strives to assist you to the best of our ability. However, we are currently unable to grant the following requests: + +* Transferring data from a non-production to a production account + +* Renaming a tenant + +* Renaming a connection + +* Re-using the name of a previously deleted tenant + +* Migrating a tenant from one region to another (for example, from US to EU) + +* Ad hoc usage data reports. + +* Restore any deleted or modified data or settings in tenants, including: + + * Database connections and their users and passwords + * Users, their profile information, metadata, roles membership + * Roles and permissions + * Applications + * SSO Integrations + * APIs + * Connections + * Rules + * Hooks + * Extensions + * Email templates + * Tenant logs once the [standard retention time](/logs/references/log-data-retention) passed diff --git a/articles/pre-deployment/how-to-run-test.md b/articles/pre-deployment/how-to-run-test.md index 948a5299d5..f06bf5038a 100644 --- a/articles/pre-deployment/how-to-run-test.md +++ b/articles/pre-deployment/how-to-run-test.md @@ -57,7 +57,7 @@ Under each set of check results, Auth0 tells you how many checks your Applicatio ![](/media/articles/support/pre-deployment-tests/reading-results.png) -If your Application **failed** one or more checkss, Auth0 provides: +If your Application **failed** one or more checks, Auth0 provides: * The name of the check * Information on what the check is looking for diff --git a/articles/pre-deployment/prelaunch-tips.md b/articles/pre-deployment/prelaunch-tips.md index c698b44558..c82eac9222 100644 --- a/articles/pre-deployment/prelaunch-tips.md +++ b/articles/pre-deployment/prelaunch-tips.md @@ -42,9 +42,9 @@ Here is a list of tips our customers have found most useful when first getting s * Adequately protect any client secret values. -* Check your [grant types](/applications/application-grant-types) for your applications. Make sure you have the right ones enabled and more importantly, disable any grant types that aren't needed. +* Check your [grant types](/applications/concepts/application-grant-types) for your applications. Make sure you have the right ones enabled and more importantly, disable any grant types that aren't needed. -* If you make use of [user_metadata](/metadata) confirm that this is data that users should be able to change on their own (eg. not “payment status”). +* If you make use of [user_metadata](/users/concepts/overview-user-metadata) confirm that this is data that users should be able to change on their own (eg. not “payment status”). * Review your [Anomaly Detection settings](${manage_url}/#/anomaly) and read the [Anomaly Detection doc](/anomaly-detection) to understand how to unblock users that have been blocked. @@ -58,7 +58,7 @@ Here is a list of tips our customers have found most useful when first getting s * Configure your application name, support URL and support email in the [Tenant Settings General](${manage_url}/#/tenant) section so when an error occurs your end users will be directed to an appropriate page. -* Make sure that your application is [dynamically obtaining a management API token](/api/management/v2/tokens) and make sure to read the [FAQ about API tokens](/api/management/v2/tokens#frequently-asked-questions). +* Make sure that your application is [dynamically obtaining a management API token](/api/management/v2/tokens) and make sure to read the [Management API Access Token FAQs](/api/management/v2/faq-management-api-access-tokens). * Remove any `console.log` statements from your rules or custom DB scripts. Especially those that might leak user identifiable information such as email, username or password. diff --git a/articles/pre-deployment/tests/best-practice.md b/articles/pre-deployment/tests/best-practice.md index 897b703a93..ff5bd52ff9 100644 --- a/articles/pre-deployment/tests/best-practice.md +++ b/articles/pre-deployment/tests/best-practice.md @@ -20,8 +20,8 @@ The following checks cannot be automated, so we recommend manually checking thes | ---- | ----------- | | [Anomaly Detection](/anomaly-detection) | Review your account's [Anomaly Detection capability and configuration](${manage_url}/#/anomaly). | | Externalize [Configuration Parameters](/connections/database/mysql#4-add-configuration-parameters) | [Externalize, instead of hard code, all configuration parameters](${manage_url}/#/connections/database), such as credentials, connection strings, API keys, and so on, when developing Rules, Hooks, or custom database connections. | -| [Restrict Delegation](/applications/application-settings/single-page-app#oauth) | If not using Delegation, set the Allowed Apps and APIs field of your Application Settings to the current Client ID. | -| SSO Timeout Values | Review the default [SSO cookie timeout values](${manage_url}/#/account/advanced) and ensure they align with your requirements. | +| [Restrict Delegation](/dashboard/reference/settings-application#advanced-settings) | If not using Delegation, set the Allowed Apps and APIs field of your Application Settings to the current Client ID. | +| Single Sign-on (SSO) Timeout Values | Review the default [SSO cookie timeout values](${manage_url}/#/account/advanced) and ensure they align with your requirements. | | Tenants and Administrators | Review all tenants and tenant administrators to ensure they are correct. Decommission tenants that are no longer in use. Ensure that tenant administrators are limited to the necessary users. | | Verify Client IDs in App Code | Ensure that the Client IDs in your application code align with their Auth0 Application configurations. | | Whitelist Auth0 Public IPs | Whitelist Auth0 IPs if you're connecting to internal services or services behind a firewall when using Rules, Hooks, or custom databases. You can get a list of IP addresses in the tool tip when configuring any of these items. | diff --git a/articles/pre-deployment/tests/recommended.md b/articles/pre-deployment/tests/recommended.md index afc34f7747..77969efda4 100644 --- a/articles/pre-deployment/tests/recommended.md +++ b/articles/pre-deployment/tests/recommended.md @@ -24,12 +24,10 @@ See [How to Read Your Results Set](/pre-deployment/how-to-run-test#how-to-read-y | ---- | ----------- | | [Authorization Extension](/extensions/authorization-extension/v2) | Evaluate the [Authorization Extension if you have authorization requirements](${manage_url}/#/extensions). | | [Custom Domain](/custom-domains) is configured | Use [custom domains with Universal Login](${manage_url}/#/tenant/custom_domains) for the most seamless and secure experience for your end users. | -| [Custom Error Page](/hosted-pages/custom-error-pages) is configured | [Configure a Custom Error Page](${manage_url}/#/account) with your application-specific details and corporate branding. | +| [Custom Error Page](/universal-login/custom-error-pages) is configured | [Configure a Custom Error Page](${manage_url}/#/account) with your application-specific details and corporate branding. | | [Email Templates](/email/custom) are configured | [Configure custom email templates](${manage_url}/#/emails) with your application specific details and corporate branding. | -| [Guardian Multi-factor](/multifactor-authentication) or other Multi-factor Authentication Providers | Consider [multi-factor authentication](${manage_url}/#/guardian) as part of the authentication strategy. | -| [Guardian Multi-factor Page](/hosted-pages/guardian) is customized | If you're using Guardian Multi-factor Authentication, [configure a Custom Hosted Page for Guardian Multi-factor](${manage_url}/#/guardian_mfa_page) with your application details and corporate branding. | -| [Hosted Login Page](/hosted-pages/login) is customized | [Configure a Custom Hosted Page for Universal Login](${manage_url}/#/login_page) with your application details and corporate branding. | +| [Guardian Multi-factor](/mfa) or other Multi-factor Authentication Providers | Consider [multi-factor authentication](${manage_url}/#/guardian) as part of the authentication strategy. | | [MFA for Tenant Administrators](/tutorials/manage-dashboard-admins) is enabled | [Enable multi-factor authentication](${manage_url}/#/account/admins) for tenant administrators. | -| [Password Reset Page](/hosted-pages/password-reset) is customized | [Configure a Custom Hosted Page for Password Reset](${manage_url}/#/password_reset) with your application details and corporate branding. | +| [Universal Login Password Reset Page](/universal-login/password-reset) is customized | [Configure a Custom Universal Login Page for Password Reset](${manage_url}/#/password_reset) with your application details and corporate branding. | | [Redirect Logout URL](/logout#set-the-allowed-logout-urls-at-the-account-level) | Review the [Allowed Redirect Logout URLs](${manage_url}/#/account/advanced) for your Application. | | Use RS256 Instead of HS256 | Set the JSONWebToken [Signature Algorithm](/apis#signing-algorithms) to RS256 instead of HS256. | diff --git a/articles/pre-deployment/tests/required.md b/articles/pre-deployment/tests/required.md index 1900e9b11c..848f2ea432 100644 --- a/articles/pre-deployment/tests/required.md +++ b/articles/pre-deployment/tests/required.md @@ -22,13 +22,13 @@ See [How to Read Your Results Set](/pre-deployment/how-to-run-test#how-to-read-y | Check | Description | | ---- | ----------- | -| [Allow ID Tokens for Management API v2 Authentication](/migrations/guides/calling-api-with-idtokens) is disabled | The capabilities for using ID Tokens to authorize some of the Users and Device Credentials endpoints of the Management API are being deprecated. After completing migration to Access Tokens, make sure the [`Allow ID Tokens for Management API v2 Authentication` toggle is turned off](${manage_url}/#/account/advanced). | -| [Allowed Callback URLs](/tutorials/redirecting-users) are not Localhost | Validates the [Application Allowed Callback URLs do not point to localhost](${manage_url}/#/applications), 127.0.0.1, and so on. | +| [Allow ID Tokens for Management API v2 Authentication](/migrations/guides/calling-api-with-idtokens) is disabled | The capabilities for using ID Tokens to authorize some of the Users and Device Credentials endpoints of the Management API are being deprecated. After completing migration to Access Tokens, make sure the [`Allow ID Tokens for Management API v2 Authentication` toggle is turned off](${manage_url}/#/tenant/advanced). If you can't see this setting, then your tenant was created after this feature was deprecated, so it is already disabled by default. | +| [Allowed Callback URLs](/protocols/oauth2/redirect-users) are not Localhost | Validates the [Application Allowed Callback URLs do not point to localhost](${manage_url}/#/applications), 127.0.0.1, and so on. | | [Allowed Origins (CORS)](/cross-origin-authentication) is not Localhost | Validates that the [Location URL for the page does not point to localhost](${manage_url}/#/applications). | -| [Allowed Web Origins are not Localhost](/applications/application-settings) | Validates that the [Allowed Web Origins URLs do not point to localhost](${manage_url}/#/applications). | +| [Allowed Web Origins are not Localhost](/dashboard/reference/settings-application) | Validates that the [Allowed Web Origins URLs do not point to localhost](${manage_url}/#/applications). | | [Email Provider](/email/providers) is configured | Verifies that the [custom email provider has been configured](${manage_url}/#/emails/provider). | -| [Guardian SMS Provider](/multifactor-authentication/administrator/twilio-configuration) is configured (Dependency: Guardian is configured) | Ensures that [Twilio SMS is configured](${manage_url}/#/guardian) if you're using Guardian MFA. | -| [Legacy Lock Migration](/libraries/lock/v11/migration-guide#disabling-legacy-lock-api) is disabled | The `/usernamepassword/login` and `/ssodata` endpoints will be removed from service on July 16th, 2018. These are used by Lock.js v8, v9, v10, and auth0.js v6, v7 and v8. After completing the migration to the latest versions, make sure the [`Legacy Lock Migration` toggle is turned off](${manage_url}/#/account/advanced). | +| [SMS or Voice Provider](/mfa/guides/configure-phone) is configured (Dependency: MFA is configured) | Ensures that [Twilio SMS is configured](${manage_url}/#/mfa) if you're using MFA with SMS or Voice. | +| Legacy Lock Migration is disabled | The `/usernamepassword/login` and `/ssodata` endpoints will be removed from service on July 16th, 2018. These are used by Lock.js v8, v9, v10, and auth0.js v6, v7 and v8. After completing the migration to the latest versions, make sure the [`Legacy Lock Migration` toggle is turned off](${manage_url}/#/account/advanced). | | [Legacy User Profile](/guides/migration-legacy-flows#user-profiles) is disabled | The legacy authentication flows that allow ID Tokens and the `/userinfo` endpoint to include the complete user profile are being deprecated. After completing the migration to the new OIDC-conformant APIs, make sure the [`Legacy User Profile` toggle is turned off](${manage_url}/#/account/advanced). | | [Social Connections](/connections/social/devkeys) are not using Auth0 Developer Keys | Verifies that [Social Connections are not using the default Auth0 developer keys](${manage_url}/#/connections/social). | | Support Email is configured | Ensures the [Support Email is configured](${manage_url}/#/account) in Tenant Settings. | diff --git a/articles/private-cloud/add-ons.md b/articles/private-cloud/add-ons.md new file mode 100644 index 0000000000..5e5ec04cab --- /dev/null +++ b/articles/private-cloud/add-ons.md @@ -0,0 +1,90 @@ +--- +section: private-cloud +description: Overview of the add-on options available to Private Cloud customers +topics: private-cloud +contentType: concept +useCase: private-cloud +sitemap: false +--- +# Private Cloud Add-On Options + +The follow add-on options are available to Private Cloud customers: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Customer-Hosted MPCAuth0-Hosted MPCPrivate CloudPublic Cloud
    Enhanced Uptime Guarantee (SLA)
    Yes
    Yes
    Yes
    No
    High Capacity +
    Yes
    Yes
    Yes
    No
    PCI Certified +
    No
    Yes
    Yes
    No
    GEO-HA
    Yes
    Yes
    No
    No
    Additional Pre-Production Environment
    Yes
    Yes
    No
    No
    + +## Enhanced Uptime Guarantee (SLA) + +The Enhanced Uptime Guarantee (SLA) increases the Private Cloud standard SLA of 99.95% to 99.99%. + +While Auth0's Public Cloud offers a 99.9% uptime guarantee, the Private Cloud's single tenant instances with dedicated resources can offer a higher SLA of 99.95%. For an additional cost, you can request the highest SLA of 99.99% uptime. + +## High Capacity + +The High Capacity add-on increases the maximum requests per second (RPS) the Private Cloud can handle from 500 RPS to 1500 RPS. + +Auth0 guarantees that the Private Cloud can handle up to 500 requests per second (RPS), but if you are looking for greater scalability for the most demanding applications, the High Capacity add-on increases this number to 1500 RPS. This is recommended for large-scale production operations supporting over 1 million users or to support your business requirements. + +## PCI Certified + +Auth0's dedicated deployments are ISO27001, SOC 2 Type II, ISO27018 and HIPAA BAA compliant, but the PCI Certified add-on ensures that your deployment is compliant with PCI-DSS requirements as well. + +## GEO-HA + +With the Geographic High Availability (GEO-HA) add-on, you will have the highest form of dedicated deployment availability offered by Auth0. + +The standard dedicated deployment is a single-region, high availability solution, but the GEO-HA add-on extends the cluster with a geographically-distributed region where the maximum round-trip latency does not exceed 100 milliseconds. This is referred to as a high-availability GEO cluster, which is a warm standby configuration with failure handling for rapid recovery during a regional outage. + +## Additional Pre-Production Environment + +The Managed Private Cloud includes a fully-isolated and independently-updated instance for development and testing. You can add additional Pre-Production Environments to meet your business requirements. + +::: note +Guaranteed Requests per Second and SLA do not apply to Pre-Production Environments. +::: diff --git a/articles/private-cloud/custom-domain-migration.md b/articles/private-cloud/custom-domain-migration.md new file mode 100644 index 0000000000..7922c55bae --- /dev/null +++ b/articles/private-cloud/custom-domain-migration.md @@ -0,0 +1,79 @@ +# Custom Domain Migration + +Beginning with Private Cloud release 1906, dedicated deployments will include the ability to fully utilize the [Auth0 Custom Domains](/custom-domains) feature. + +Existing Private Cloud customers using Custom Domains must complete a migration of their Private Cloud Custom Domains to the Auth0 Custom Domains features. New customers/deployments will automatically use the Auth0 Custom Domains features. + +::: note +The Auth0 Custom Domains feature will be available in release 1905 for those who wish to opt-in early. +::: + +## Background + +Auth0 added support for custom domains in the Private Cloud platform in January 2016. This implementation allowed Private Cloud administrators to create one or more custom domains per tenant and invoke the Authentication API endpoints using those domains. + +In March 2018, Auth0 added support for custom domains for those deploying on the Public Cloud. However, the feature included additional capabilities not included on the Private Cloud implementation. The following table summarizes the differences. + +| Feature | New Custom Domains | Legacy Custom Domains | +| - | - | - | +| Use of custom domain in emails | Yes | No | +| Custom domain protection via API keys | Yes | No | +| Custom domain registration | Yes | Yes | +| Token issuer used as custom domain | Yes | No | +| Auth0-managed certificates | Yes | No | +| Use of multiple domains | No | Yes | + +## Requirements + +* A new DNS domain dedicated to the Custom Domain's origin server hostname. This could be a subdomain of your existing Auth0 Domain (i.e., if your domain name is `*.auth.mydomain.com`, the new subdomain would be `*.cd.auth.mydomain.com`). +* A wildcard public SSL certificate for the new DNS domain. +* A layer 4 network load balancer. This could be the existing one used by your Private Cloud deployment. Please note that if you are using a layer 7 load balancer, you **must** add a layer 4 load balancer. +* A DNS record pointing to the layer 4 load balancer. + +## Migration + +Current Private Cloud customers using the existing Private Cloud Custom Domains functionality **must migrate to the Auth0 Custom Domains** feature to fully benefit from the features available. + +## Migration process + +The Custom Domains migration process involves three phases, each of which requires several steps. + +### Communication Phase + +Before beginning the migration process, Auth0 will reach out to you to explain the migration process and discuss the following: + +* The certificate management model you would like to use + + Auth0 offers [two certificate management models](/custom-domains/#certificate-management). To simplify the migration process, we suggest using one model for all of your tenants (though you can use a different certificate model for each tenant if necessary). + +* The type of load balancer you're using (i.e. network (layer 4) or application (layer 7)) + + If your dedicated deployment is AWS-hosted, we will need to confirm the type of load balanced you're using. If you are using an application load balancer, you will need to provision an additional network load balancer. + +* Allocating new DNS resources to meet stated requirements (if necessary) + + You will need to have ready the **edge domain name** and accompanying **SSL certificate**, the **CNAME host name**, and the **email address** to be used as the Let's Encrypt contact. + +### Infrastructure preparation phase + +::: note +If your Private Cloud deployment resides in an Auth0-hosted environment, Auth0 will prepare your environment for migration on your behalf. +::: + +During this stage, you will need to: + +1. Set up the network load balancer +2. Set up your new DNS records +3. Validate and verify that your set up is correct + +### Migration phase + +The goal of the migration phase is to create custom domains that have all the new functionality and to update all dependencies to function correctly with your newly-created domain names. + +The first step is to create new domains using the Auth0 [Custom Domains](/custom-domains) feature. + +Once done, you may have [additional configuration steps](/custom-domains/additional-configuration#configure-social-identity-providers), depending on the Auth0 features you use. + +#### Final configuration + +One you have completed all of the required modifications on your applications, a Managed Services Engineer will assist you in completing the migration process. diff --git a/articles/private-cloud/index.md b/articles/private-cloud/index.md new file mode 100644 index 0000000000..044901fc2b --- /dev/null +++ b/articles/private-cloud/index.md @@ -0,0 +1,94 @@ +--- +section: private-cloud +description: Overview of the Private Cloud deployment options +classes: topic-page +topics: + - private-cloud + - managed-private-cloud +contentType: concept +useCase: private-cloud +title: Private Cloud Deployment +--- +
    +
    +

    Private Cloud Deployment

    +

    + A low-friction, dedicated Auth0 deployment that exists in Auth0's Private Cloud or a Customer-Hosted Cloud. +

    +
    + +Users with requirements not met by the Auth0 Public Cloud may instead opt for a Private Cloud deployment option. + +Auth0 currently offers two Private Cloud deployment models: + +* [**Standard** Private Cloud](/private-cloud/standard-private-cloud) +* [**Managed** Private Cloud](/private-cloud/managed-private-cloud), either hosted by Auth0 or hosted by you on an AWS environment and operated by Auth0 as a managed service + +Private Cloud deployments are single-subscriber, isolated instances where none of a customer's resources (software and infrastructure) are shared with any other tenants. This offers increased performance, stability, and availability. + +## Private Cloud options and comparison + +Here is how the two Private Cloud deployment options compare to each other, as well as how they compare to the Enterprise (Public Cloud) option. + +| | Managed | Standard | Public Cloud (Enterprise Subscription Plan) | +| - | - | - | - | +| Instance Type | **Dedicated** Cloud Instance | **Dedicated** Cloud Instance | **Shared** Cloud Instance | +| Deployment Location | Auth0 Private Cloud *or* Customer-Owned AWS Cloud | Auth0 Private Cloud | Auth0 Public Cloud | +| Pre-Production Environment | Includes fully-isolated and independently updated instance for development and testing | Additional tenants within the same instance as the production tenant available | Additional tenant within the shared environment | +| Updates | Choice of update frequency to be coordinated with Auth0. Update cycle begins with the Pre-Production Environment | Automatic Monthly Updates | Automatic Updates | +| Uptime Guarantee | 99.95% SLA with optional upgrade to 99.99% | 99.95% SLA with optional upgrade to 99.99% | 99.90% (no upgrade option available) | +| Requests per Second | 500 requests per second with optional upgrade to 1500 requests per second | 500 requests per second with optional upgrade to 1500 requests per second | See [Rate Limit Policy for Auth0 APIs](/policies/rate-limits) | +| [Data Residency](#data-residency) | Region of Choice | Region of Choice | Varies based on tenant location | +| PCI Certified | Add-on available | Add-on available | No | +| Geographic High Availability (GEOHA) | Add-on available | No | No | + +## Data residency + +Private Cloud customers can choose the region where their data is stored -- any region with three (3) availability zones can be used for the Private Cloud. All data will remain and be stored in the chosen region. This is crucial in instances where regulations prevent data from being sent outside the origin region. + +For Auth0-hosted Private Cloud customers: + +* Backups will be processed and stored in the US +* Service logs will be processed in the region closest to where the customer hosts their Private Cloud; the current options include Japan, Germany, United Kingdom, United States, Canada, or Australia. + +If you are a **Private Cloud** customer with data sovereignty requirements, Auth0 supports Private Cloud deployments in the following regions: USA, Europe, Australia, Canada, and Japan. Otherwise, the Private Cloud can be supported in other regions (except China). Furthermore, Auth0 can: + +* Deploy backups to AWS' S3 service in the same region that hosts the Private Cloud +* Send service logs to Japan, Germany, United Kingdom, United States, Canada, or Australia (regardless of which region you've chosen to host the Private Cloud). You may also opt to not send any service logs + +We are currently unable to offer deployments to China. + +## Additional information + + \ No newline at end of file diff --git a/articles/private-cloud/managed-private-cloud/index.md b/articles/private-cloud/managed-private-cloud/index.md new file mode 100644 index 0000000000..085561e65e --- /dev/null +++ b/articles/private-cloud/managed-private-cloud/index.md @@ -0,0 +1,49 @@ +--- +section: private-cloud +description: Overview of the Managed Private Cloud deployment option +topics: managed-private-cloud +contentType: concept +useCase: private-cloud +--- +# Managed Private Cloud + +Auth0's **Managed Private Cloud** (MPC) is a specially customized Auth0 deployment that gives you greater flexibility and increased input when it comes to day-to-day operations. + +## Benefits of the Managed Private Cloud + +With a Managed Private Cloud, we work closely with you to make sure that all aspects of your Auth0 environment and deployment are tuned to best meet the needs of your business. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    BenefitDetails
    On-Demand BalancingIf you're expecting a usage spike, contact us and we'll scale your environment so that you have the capacity you need to handle the your traffic load
    Annual Load TestingYou may choose to load test your Auth0 environment if desired. While not required, Auth0 appreciates notification of such tests ahead of time.
    Scheduled UpdatesScheduled updates to create a release cadence to fit your team and your business' schedule
    Staging EnvironmentDedicated environment to test new releases and changes
    GEO-HAOptional. Add-on available for Geographic High Availability.
    Customer-HostingOptional. Can host your Auth0 deployment in an AWS cloud owned by you
    diff --git a/articles/private-cloud/managed-private-cloud/raci.md b/articles/private-cloud/managed-private-cloud/raci.md new file mode 100644 index 0000000000..8c343a461b --- /dev/null +++ b/articles/private-cloud/managed-private-cloud/raci.md @@ -0,0 +1,157 @@ +--- +section: private-cloud +description: Differences between the two Managed Private Cloud deployment options and the Customer-Hosted RACI +topics: managed-private-cloud +contentType: concept +useCase: private-cloud +--- +# Customer-Hosted Differences and RACI + +The customer-hosted Managed Private Cloud provides you with everything you need to run Auth0 in your Amazon Web Services environment. + +## Differences between the Auth0-Hosted and the Customer-Hosted Managed Private Cloud + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Auth0-HostedCustomer-Hosted on AWS
    Public-Facing?YesCan be configured to be public-facing or not
    Service and Uptime ReportingAuth0 responsible for monitoringCustomer responsible for monitoring
    Infrastructure and Backup ResponsibilityAuth0 responsible for backupsCustomer responsible for backups
    PCI Compliance Add-OnAvailableNot available
    Breached Password DetectionAvailableNot available
    AWS CostsNot applicableCustomer responsible for all AWS costs associated with running the infrastructure required for a customer-hosted deployment
    + +## Responsibilities regarding the Customer-Hosted Private Cloud + +Auth0 is responsible for: + +* The initial installation +* General maintenance +* Installation of patches and updates + +The subscriber/customer is responsible for supplying and monitoring the infrastructure on which the Private Cloud runs. This includes, but is not limited to: + +* The EC2 hosts +* Data storage +* Network resources +* Any required dependencies + +### Detailed Division of Responsibilities + +The following RACI Matrix provides an in-depth summary of the roles and responsibilities that will be allocated between Auth0 and the customer/subscriber. + +**RACI**: + +* **Responsible**: the assigned party who is responsible for executing the task +* **Accountable**: the assigned party who is accountable for the task being completed +* **Consulted**: the party/parties whose opinions are requested and with whom there is two-way communication +* **Informed**: the party/parties who are kept up-to-date with regards to progress and with whom there is one-way communication + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Private Cloud-Related Tasks or DeliverablesAuth0Customer/SubscriberNotes
    Preparing AWS Infrastructure (including memory, storage, processors, load balances, networks, SSL certificates, DNS records, SMTP servers, enabling Auth0 access via Jumphost/VPN)CR, A (the subscriber's infrastructure engineer)The subscriber will contact Auth0 when the AWS environment is ready and the infrastructure requirements are met
    Set up Development and Production environmentsR, A (the Managed Services Engineer (MSE))IThe Auth0 Managed Service Engineer will SSH into the AWS environment and deploy the Auth0 Private Cloud
    Configure Development and Production environmentsCRThe Auth0 Managed Service Engineer will show the subscriber's infrastructure engineer how to upload the SSL certificates, enter the SMTP credentials, and add administrators
    Operations HandoverRCThe Auth0 Managed Service Engineer and Technical Account Managers will hold an Operations Handover meeting to review information regarding Private Cloud monitoring, backup, and updates and to answer questions
    MonitoringIR, AThe subscriber is responsible for monitoring the Private Cloud Deployment
    Backing UpI (in the event there are issues)R, AThe subscriber is responsible for backing up the Private Cloud deployment using the Command-Line Tools
    User Migration (if required)C, I (in the event there are issues)R, AThe subscriber is responsible for migrating users where appropriate
    UpdatesRR, AThe Auth0 Managed Service Engineers will partner with the subscriber's infrastructure engineers to update the Private Cloud Deployment on an agreed-upon basis. The subscriber is responsible for taking AMI snapshot(s) prior to the update, providing access to the Private Cloud deployment, and being present during the update. Auth0 is responsible for running manual scripts (if required) and informing the subscriber on the status of the update
    Testing Updates in Non-Production Environment(s)C, I (in the event that there are questions/issues)R, AThe subscriber will test the Private Cloud after the Development node has been updated and inform Auth0 of any issues
    Testing Updates in ProductionC, I (in the event that there are questions/issues)R, AThe subscriber will test the Private Cloud after the Production node has been updated and inform Auth0 of any issues
    Issue Identification and Support Ticket SubmissionCR, AThe subscriber is responsible for submitting issues via the Support Center
    Issue ResolutionR, CCAuth0 will provide support for issues within the *core* of the Auth0 product. Auth0 will consult on issues pertaining to integration with the Auth0 product
    \ No newline at end of file diff --git a/articles/private-cloud/managed-private-cloud/zones.md b/articles/private-cloud/managed-private-cloud/zones.md new file mode 100644 index 0000000000..d7452081aa --- /dev/null +++ b/articles/private-cloud/managed-private-cloud/zones.md @@ -0,0 +1,95 @@ +--- +section: private-cloud +description: Configuring Parameters for a Group of Auth0 Nodes +topics: managed-private-cloud +contentType: concept +useCase: private-cloud +--- +# Work with Zones in the Managed Private Cloud + +Beginning with **Managed** Private Cloud Release **1910.0**, you will be able to: + +* Group your Auth0 nodes into **zones** +* Uniquely configure each zone so that each zone has its own parameters and configuration settings + +## Zones 101 + +If you have multiple nodes, you can group the nodes into zones. For example, you might group six nodes as follows: + +* **Region 1** consists of nodes `a0-1`, `a0-2`, and `a0-3`. +* **Region 2** consists of nodes `a0-4`, `a0-5`, and `a0-6`. + +Each zone has its own configuration, which informs the base configuration for a zone (therefore, the configuration for a node is inherited from the zone). + +## How to create zones + +You can create new zones via the Private Cloud Dashboard. + +Go to **/psaas/dashboard** (replace **manage_url** with your specific URL). In the left-hand navigation bar, click **Zones**. + +![](/media/articles/private-cloud/zones/zones-1.png) + +In the top-right corner, click **Create Zone**. Auth0 will create for you a new, inactive zone. + +![](/media/articles/private-cloud/zones/zones-2.png) + +Click on the downward pointing arrow to reveal the zones creation screen. You'll be asked to provide a **Name** for the zone, as well as the nodes you want to be **Members** of the zone. + +![](/media/articles/private-cloud/zones/zones-3.png) + +Once you provide a **Name** and indicate the **Members** of the zone, you can click **Save Zones** to persist your changes. Your zone remains inactive until you switch the toggle to **Active** (only one zone may be active at any given time). + +![](/media/articles/private-cloud/zones/zones-4.png) + +Once you have a zone created, you will see a new drop-down menu in the left-hand navigation bar. + +![](/media/articles/private-cloud/zones/zones-6.png) + +This new drop-down menu allows you to switch between zones for configuration. + +![](/media/articles/private-cloud/zones/zones-5.png) + +## Configure zones + +To change the configuration for your zone, go to **Cloud Resources** using the left-hand navigation bar. + +Recall that the drop-down menu on the left-hand navigation bar allows you to switch between zones for configuration. Make sure that this area shows the zone for which you are adjusting the configuration. + +![](/media/articles/private-cloud/zones/zones-7.png) + +Once you've made sure that you're adjusting the settings for the correct zone, you can change the **Credentials**, information about the **PostgreSQL instance**, and **Listener** information. + +### Configuration notes + +By default, the **Base Configuration**, which contains the configuration parameters all nodes that don't belong to a zone get, is propagated to all nodes and is the default selection. + +Any changes you make to the configuration when you have a specific zone selected will be propagated **only to the nodes that are members of that zone**. + +When working with zones, modify parameters on a per-zone basis. Any parameters that are shared between multiple nodes should be specified at the Base Configuration level. + +### A configuration example + +If your **Base Configuration** for your PostgreSQL instance is: + +```code +PostgreSQL: + **host**: foo.bar + **username**: auth0 + **password**: password +``` + +And you change, for a given zone, the **host**: + +```code +PostgreSQL: + **host**: bar.baz +``` + +Then the specific configuration applied to a node that's a member of the zone is: + +```code +PostgreSQL: + **host**: bar.baz + **username**: auth0 + **password**: password +``` diff --git a/articles/private-cloud/onboarding/index.md b/articles/private-cloud/onboarding/index.md new file mode 100644 index 0000000000..d3dbb390a2 --- /dev/null +++ b/articles/private-cloud/onboarding/index.md @@ -0,0 +1,13 @@ +--- +section: private-saas-deployment +description: Onboarding +topics: private-cloud +contentType: concept +useCase: private-saas-deployment +--- +# Onboarding + +To provide clarity around the onboarding and implementation processes for the Private SaaS Deployment options, Auth0 has created the following documentation: + +* [Private Cloud](/private-saas-deployment/onboarding/private-cloud) +* [Managed Private Cloud](/private-saas-deployment/onboarding/managed-private-cloud) \ No newline at end of file diff --git a/articles/private-cloud/onboarding/managed-private-cloud/index.md b/articles/private-cloud/onboarding/managed-private-cloud/index.md new file mode 100644 index 0000000000..68f9de8246 --- /dev/null +++ b/articles/private-cloud/onboarding/managed-private-cloud/index.md @@ -0,0 +1,85 @@ +--- +section: private-cloud +description: Overview of the Private Cloud onboarding process +topics: private-cloud +contentType: concept +useCase: private-cloud +--- +# Managed Private Cloud Onboarding + +This article will cover all facets of the **Managed Private Cloud** (both Auth0-hosted and customer-hosted) onboarding process, including timelines, information about future updates, technical requirements, and implementation instructions for key Managed Private Cloud features. + +::: note +If you are a Private Cloud customer, please see [Private Cloud Onboarding](/private-cloud/onboarding/private-cloud). +::: + +## Timeline + +After your purchase of the Managed Private Cloud, Auth0 will host a **kickoff meeting** with you to begin the implementation process. We strongly recommend that this meeting occur no later than **five (5) days** after the contract signing. + +### Auth0-Hosted Managed Private Cloud + +Implementation begins immediately after the kickoff meeting, and the process takes **two (2) weeks**. At this point, you're ready for the **Environment Handover**, where your Private Cloud deployment is ready for Production use. + +### Customer-Hosted Managed Private Cloud + +Implementation begins immediately after the kickoff meeting, and the process takes between **three (3) to four (4) weeks**. The specific amount of time required is highly dependent on the amount of time you need to provision your infrastructure per Auth0 requirements. + +At the end of the implementation process, you're ready for the **Environment Handover**. Your Managed Private Cloud deployment is, at this point, ready for Production use. + +## Infrastructure + +Customers hosting Auth0 using Amazon Web Services should review the [infrastructure requirements](/private-cloud/onboarding/managed-private-cloud/infrastructure), as well as the [IP/Domain and Port List](/private-cloud/onboarding/managed-private-cloud/ip-domain-port-list) required for Private Cloud deployments. + +## Updates + +Auth0 provides monthly releases to the Managed Private Cloud, of which the four most recent are considered *active*. Updating to an active release is mandatory and ensures that you receive: + +* The latest features +* Security fixes and enhancements +* Bug fixes + +Auth0 will reach out to you to coordinate the specific dates and times during which updates are applied to your deployment. + +The [Private Cloud Release Notes](https://auth0.com/releases/) will contain full details on the changes made to your deployment. + +## Custom domains + +See [Custom Domains](/custom-domains) for instructions on how to map your tenant domain to a custom domain of your choosing, as well as how to manage the required certificates. + +If you are a customer-hosted Managed Private Cloud customer using the legacy custom domains feature, you will need to migrate your custom domains to the Auth0 Custom Domains feature. Please consult Auth0 for additional assistance. + +## Tenant logging + +Auth0 provides [logs](/logs) that are accessible via the Dashboard of the Management API's [`logs` endpoint](/api/v2#!/Logs/get_logs). + +You can also choose to send the data logged by Auth0 to an external service. To help with this, there are Auth0 extensions that support automatic log export to services like Sumo Logic or Loggly. The following is a list of Auth0 log export extensions currently available: + +* [Auth0 Logs to Application Insights](/extensions/application-insight) +* [Auth0 Logs to Azure Blob Storage](/extensions/azure-blob-storage) +* [Auth0 Logs to Loggly](/extensions/loggly) +* [Auth0 Logs to Papertrail](/extensions/papertrail) +* [Auth0 Logs to Sumo Logic](/extensions/sumologic) +* [Auth0 Logs to Splunk](/extensions/splunk) +* [Auth0 Logs to Logstash](/extensions/logstash) +* [Auth0 Logs to Mixpanel](/extensions/mixpanel) +* [Auth0 Logs to Logentries](/extensions/logentries) + +## Rate limits + +To ensure the quality of Auth0's services, the APIs are subject to rate limiting. + +## Support + +You can reach out to the Auth0 [Support](${env.DOMAIN_URL_SUPPORT}) team with any questions or concerns you might have. To help expedite your request, please provide as much information as possible in the [Support ticket you open](/support/tickets). + +## Remote Access Options + +The Managed Private Cloud requires regular access by our Managed Services Engineering team to install patches, updates, and upgrades, troubleshoot and fix issues, and optimize security and performance. See [Remote Access Options](/private-cloud/onboarding/managed-private-cloud/remote-access-options) for information on the options available. + +## Create Dashboard administrators + +To create additional Dashboard administrators, an *existing* administrator must reach out to Auth0 [Support](${env.DOMAIN_URL_SUPPORT}) requesting that an additional administrative account be made. Please include in your request: + +* The name(s) of the tenant(s) for which the new administrator should have access +* The email addresses of those to be invited diff --git a/articles/private-cloud/onboarding/managed-private-cloud/infrastructure.md b/articles/private-cloud/onboarding/managed-private-cloud/infrastructure.md new file mode 100644 index 0000000000..ad68965f76 --- /dev/null +++ b/articles/private-cloud/onboarding/managed-private-cloud/infrastructure.md @@ -0,0 +1,137 @@ +--- +section: private-cloud +description: Infrastructure requirements for the customer-hosted Managed Private Cloud +topics: private-cloud +contentType: concept +useCase: private-cloud +--- +# Infrastructure Requirements for the Customer-Hosted Managed Private Cloud + +If you are a Managed Private Cloud customer hosting Auth0 using Amazon Web Services, the following are the requirements you should be aware of when setting up your cloud environment. + +## Choosing your AWS regions + +The AWS Region(s) in which your deployments are hosted must support: + +* At least **three (3)** availability zones +* Cross-LAN availability zones +* M4 or M4 instance types +* RDS for PostgreSQL + +## AWS instance types + +The size of your AWS instance must be, at minimum, **M4.2xlarge**, though the **M5.2xlarge** size is preferred. + +We ask that the individual volumes have the following resource allocation: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    System / Operating SystemDatabaseUser SearchBackup
    a0-1 (PROD)60 GB100 GB100 GB--
    a0-2 (PROD)60 GB100 GB100 GB--
    a0-3 (PROD)60 GB100 GB100 GB100 GB
    DEV (non-PROD)60 GB50 GB50 GB50 GB
    + +Please note that you may have a different number of instances based on your specific deployment type. + +## Network + +All servers in the cluster must: + +* Have outbound access +* Be on the same subnet +* Be able to communicate over ports 7777, 27017, 8721, and 8701 +* Listen for and accept traffic from the load balancer over ports 443 and 4443 + +For a complete listing of IP addresses and ports used, see the [IP/Domain and Port List](/private-cloud/onboarding/managed-private-cloud/ip-domain-port-list). + +## Internet connectivity + +Internet connectivity is required for all servers in the cluster. + +All servers in the cluster require outbound access to: +* **docker.it.auth0.com** (**52.9.124.234**) on port 443. +* **cdn.auth0.com** on port 443. +* Social providers and third-party APIs (as needed) + +## DNS records + +Each environment (e.g., Development, Staging, Production), which are represented by ``, requires a separate namespace when it comes to DNS records. + +You will need DNS records for the following namespaces: + +| **Namespace/Environment | Notes | +| - | - | +| **Auth0 environment Namespace** (e.g., `*..customer.com`)| You can choose to use a catch-all CNAME record that represents all of your tenants and Dashboard endpoints **or** individual CNAME records for each tenant. The following `env-names` cannot be used: **manage** (reserved for the Dashboard), **config** (reserved for the root tenant authority), **webtask** (reserved for extensibility) | +| **Auth0 Webtask with Dedicated Domains Namespace** (e.g., `*.wt..customer.com`) | You can choose to use a catch-all CNAME record to represent all of your tenants **or** you can use an individual CNAME record for each tenant pointing to the balanced endpoint | +| **Custom Domains Namespace** | Requires a catch-all CNAME record redirecting custom domains to the custom domains balanced endpoint **and** an alias record using `edge..customer.com ` that points to the custom domains balanced endpoint | + +## Load balancers + +You must use either an ALB or ELB. For HTTP health check monitoring, you can use the `testall` endpoint provided by Auth0. + +### Software Load Balancers + +You can use either NGINX or HA Proxy as the software load balancer in front of the Auth0 environment or for IP whitelisting and/or endpoint filtering (only authentication endpoints are publicly available). If you are using NGINX or HA Proxy as the software load balancer, you must: + +* Use TCP mode with Proxy Protocol or HTTPS mode (SSL offloading). In HTTPS mode the connector will not work. +* Forward the incoming hostname to the nodes + +## SSL Certificates + +Your SSL certificates must: + +* Be signed by a public certificate authority +* Contain all of the required DNS names (if the certificate is not a wildcard certificate) +* Be in the PFX or PKCS12 formats +* Contain the full chain + +## TLS + +Auth0 requires TLS 1.1 or later. + +## SMTP + +You must set up and configure a SMTP provider (or a global default email provider) to send emails. Optionally,, you can set up transactional email providers (e.g., SendGrid, Amazon SES, Mandrill) for individual tenants. + +STARTTLS is supported by Auth0, but is not required. + +## Amazon RDS for PostgreSQL + +Amazon RDS for PostgreSQL is currently used to support the Authorization Roles-Based Access Control functionality, but it will be used to support other functionality in the future. + +We ask that, at minimum, you use **postgres10, db.r3.xlarge** with 10 GB of storage. You should also allow automated snapshots with seven-day snapshot retention and multi-AZ deployments with automated failover. + +## Remote Access + +Forthcoming. \ No newline at end of file diff --git a/articles/private-cloud/onboarding/managed-private-cloud/ip-domain-port-list.md b/articles/private-cloud/onboarding/managed-private-cloud/ip-domain-port-list.md new file mode 100644 index 0000000000..a86e9c3097 --- /dev/null +++ b/articles/private-cloud/onboarding/managed-private-cloud/ip-domain-port-list.md @@ -0,0 +1,201 @@ +--- +section: private-cloud +description: Infrastructure requirements for the customer-hosted Managed Private Cloud +topics: private-cloud +contentType: concept +useCase: private-cloud +--- +# Private Cloud IP/Domain and Port List + +Private Cloud deployments require certain ports within the cluster to be open and able to communicate with one another, as well as selected external sites. + +## Between Cluster Nodes + +When possible, instances within a cluster should have full connectivity to each other so that you do not need to introduce new firewall rules if Auth0 adds new features. However, since this isn't possible in every environment, the following table lists the ports that are required to be open and accessible to other Private Cloud instances in the same cluster: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    PortUseRequired?Notes
    27017DatabaseYes
    7777ControlYes
    9001Rate LimitingYesRequired if rate limiting is used
    8721Webtask Logging/ControlYesRequired for logging and debugging
    8701Webtask Logging/ControlYesRequired for logging and debugging
    9200, 9300-9400Elastic SearchYesRequired for Elastic Search
    3000Grafana instrumentationNoRequired if you are using Grafana instrumentation
    22MaintenanceNoEnables maintenance tasks to be done between nodes
    ICMPHealthcheckNoAllows healthchecks between nodes
    + +## External Connectivity + +Auth0 strives to keep these IP addresses stable, though this is not a given. From time to time, Auth0 may add IP addresses or additional servers. During updates and metrics, you must allow your Private Cloud instances to connect to these addresses. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    UseDirectionIP/DNSPortNotesRequired?
    AllInboundYour load balancer IP address (often on internal network)80/(443 or 4443)For clusters with more than one node, a load balancer is required for resiliency and performanceYes
    WebtaskOutboundYour load balancer IP address (often on internal network)443Allows rules, webtasks, and extensions to call back to Auth0 endpointsYes
    Command Line InterfaceInbound and OutboundCLI Applications (often on the internal network)10121Allows use of the Private Cloud Command Line InterfaceNo
    UpdatesOutboundapt-mirror.it.auth0.com (52.8.153.197)443Provides update packages for Private Cloud deploymentsYes
    UpdatesOutbounddocker.it.auth0.com (52.9.124.234)443Provides updates for Private Cloud Docker PackagesYes
    Web extensions, Hooks, and Management DashboardOutboundcdn.auth0.com443Required to run web extensions and Hooks; also required for admins to browse to the Management DashboardYes
    ExamplesOutboundgithub.com443Source to download and repackage example applicationsNo
    Usage & TelemetryOutboundapp-gateway.it.auth0.com (52.40.103.203)443Provides usage and telemetry statisticsYes
    MaintenanceInboundJump Host22Allows access to Private Cloud instances for support purposesNo
    Healthcheck InboundMonitoring Endpoint9110Allows access to Healthcheck endpointsNo
    DNSInbound and OutboundLocal domain servers53Required by the Private Cloud deployment to resolve host names internal and external to your environmentYes
    SMTPOutboundSMTP Server(s)25/587Allows sending of emails from the Private Cloud deploymentNo
    + +## Notes + +* If you are using social providers for logins, the cluster must be able to connect to the social providers' endpoints. +* The Jump Host IP is stable and provided at the time of setup. diff --git a/articles/private-cloud/onboarding/managed-private-cloud/remote-access-options.md b/articles/private-cloud/onboarding/managed-private-cloud/remote-access-options.md new file mode 100644 index 0000000000..ecc40318ff --- /dev/null +++ b/articles/private-cloud/onboarding/managed-private-cloud/remote-access-options.md @@ -0,0 +1,56 @@ +--- +section: private-cloud +description: Remote access options for the Managed Private Cloud +topics: private-cloud +contentType: concept +useCase: private-cloud +--- +# Remote Access Options for the Managed Private Cloud + +This article covers the remote access options available to you as a Managed Private Cloud customer. + +The Managed Private Cloud requires regular access by our Managed Services Engineering team to install patches, updates, and upgrades, troubleshoot and fix issues, and optimize security and performance. + +::: panel Jumphost +A Jumphost is a security-hardened virtual machine (VM) that acts as a secure communication relay using SSH. The Jumphost initiates the connection from an Auth0 (using a whitelisted IP address) to the Managed Private Cloud VMs. (You would open access to the Jumphost to allow Auth0 access when necessary). + +Auth0's connections originate from a VPN-secured network using public key access to your Jumphost so that only authorized Managed Service Engineers can access connect to your environment. +::: + +## Option 1: Jumphost + Firewall Whitelist + +In this configuration, an external Auth0-managed Jumphost is permitted sole SSH management access to the Managed Private Cloud. + +![](/media/articles/private-cloud/one-jumphost.png) + +*Benefits*: + +* Jumphost provides a single point of access and auditing +* Auth0 handles tasks related to auditing, session recording, VPN access to Jumphost, and Identity Management +* Access could be disabled via firewall rules or security groups + +## Option 2: Two Jumphosts + +Similar to [option 1](#option-1-jumphost--firewall-whitelist), this configuration permits an external Auth0 Jumphost to connect via firewall whitelist to an internal, customer-managed Jumphost. This second Jumphost then provides actual access to the Managed Private Cloud nodes. + +![](/media/articles/private-cloud/two-jumphosts.png) + +*Benefits*: + +* Jumphost provides a single point of access and auditing +* Auth0 handles tasks related to auditing, session recording, VPN access to Jumphost, and Identity Management +* Disabling Auth0 access is as simple as shutting down a server +* Can be installed in DMZ (if necessary) + +*Concerns*: + +* Additional virtual Jumphost required in your infrastructure + +## Unsupported configurations + +Auth0 does not support other remote access options, such as VDI or Screen Sharing mechanisms. The alternative options introduce compliance concerns, including (but not limited to): + +* Not being able to internally audit connections and SSH sessions +* Not being able to enforce identity management on Auth0 employee accounts +* Potential exposure to untrusted systems running non-standard software (from where the connections are generated to Auth0 VMs) +* Inability to verify the identity of participants on the other end diff --git a/articles/private-cloud/onboarding/private-cloud.md b/articles/private-cloud/onboarding/private-cloud.md new file mode 100644 index 0000000000..807ed16c83 --- /dev/null +++ b/articles/private-cloud/onboarding/private-cloud.md @@ -0,0 +1,63 @@ +--- +section: private-cloud +description: Overview of the Private Cloud onboarding process +topics: private-cloud +contentType: concept +useCase: private-cloud +--- +# Private Cloud Onboarding + +This article will cover all facets of the **Private Cloud** onboarding process, including timelines, information about future updates, technical requirements, and implementation instructions for key Private Cloud features. + +::: note +If you are a **Managed** Private Cloud customer, please see [Managed Private Cloud Onboarding](/private-cloud/onboarding/managed-private-cloud). +::: + +## Timeline + +After your purchase of the Private Cloud, Auth0 will host a **kickoff meeting** with you to begin the implementation process. We strongly recommend that this meeting occur no later than **five (5) days** after the contract signing. + +Implementation begins immediately after the kickoff meeting, and the process takes **two (2) weeks**. At this point, you're ready for the **Environment Handover**, where your Private Cloud deployment is ready for Production use. + +## Updates + +Auth0 will issue monthly updates to the Private Cloud automatically. The [Private Cloud Release Notes](https://auth0.com/releases/) will contain full details on the changes made to your deployment. + +::: note +The four most recent Private Cloud releases are considered to be the **Active Releases**. +::: + +## Custom domains + +See [Custom Domains](/custom-domains) for instructions on how to map your tenant domain to a custom domain of your choosing, as well as how to manage the required certificates. + +## Tenant logging + +Auth0 provides [logs](/logs) that are accessible via the Dashboard of the Management API's [`logs` endpoint](/api/v2#!/Logs/get_logs). + +You can also choose to send the data logged by Auth0 to an external service. To help with this, there are Auth0 extensions that support automatic log export to services like Sumo Logic or Loggly. The following is a list of Auth0 log export extensions currently available: + +* [Auth0 Logs to Application Insights](/extensions/application-insight) +* [Auth0 Logs to Azure Blob Storage](/extensions/azure-blob-storage) +* [Auth0 Logs to Loggly](/extensions/loggly) +* [Auth0 Logs to Papertrail](/extensions/papertrail) +* [Auth0 Logs to Sumo Logic](/extensions/sumologic) +* [Auth0 Logs to Splunk](/extensions/splunk) +* [Auth0 Logs to Logstash](/extensions/logstash) +* [Auth0 Logs to Mixpanel](/extensions/mixpanel) +* [Auth0 Logs to Logentries](/extensions/logentries) + +## Rate limits + +To ensure the quality of Auth0's services, the APIs are subject to rate limiting. + +## Support + +You can reach out to the Auth0 [Support](${env.DOMAIN_URL_SUPPORT}) team with any questions or concerns you might have. To help expedite your request, please provide as much information as possible in the [Support ticket you open](/support/tickets). + +## Create Dashboard administrators + +To create additional Dashboard administrators, an *existing* administrator must reach out to Auth0 [Support](${env.DOMAIN_URL_SUPPORT}) requesting that an additional administrative account be made. Please include in your request: + +* The name(s) of the tenant(s) for which the new administrator should have access +* The email addresses of those to be invited \ No newline at end of file diff --git a/articles/private-cloud/standard-private-cloud/index.md b/articles/private-cloud/standard-private-cloud/index.md new file mode 100644 index 0000000000..39b3ccb2c8 --- /dev/null +++ b/articles/private-cloud/standard-private-cloud/index.md @@ -0,0 +1,14 @@ +--- +section: private-cloud +description: Overview of the Private Cloud deployment option +topics: private-cloud +contentType: concept +useCase: private-cloud +--- +# Private Cloud + +Auth0's **Private Cloud** option provides you with a dedicated (or single-subscriber) environment. You'll get enhanced performance, security, and compliance over what we include in our standard Public Cloud offering. + +With the Private Cloud, Auth0 will handle a majority of the requirements for initial setup and maintenance. Afterward, you'll be on a set update pattern, typically no more frequent than every 30 days. + +You'll get the ease of management that comes with using our Public Cloud combined with the power and security of our [Managed Private Cloud](/private-cloud/managed-private-cloud). diff --git a/articles/product-lifecycle/index.md b/articles/product-lifecycle/index.md new file mode 100644 index 0000000000..c2e91485da --- /dev/null +++ b/articles/product-lifecycle/index.md @@ -0,0 +1,38 @@ +--- +toc: true +classes: topic-page +title: Product Lifecycle +description: Learn about the Auth0 product lifecycle, including product release stages, deprecations, end-of-life, the migration process, and active migrations. +topics: + - deprecations + - migrations + - product-lifecycle +contentType: + - index + - reference +useCase: + - migrate +--- + +
    +
    +

    Product Lifecycle

    +

    + We apply an iterative approach to product delivery, including an iterative product release lifecycle that allows us to introduce and improve upon new functionality. +

    +
    + +When building Auth0 products, we resolve to + +* deliver value to customers early and often, iterating based on their feedback +* seek a deep understanding of our customers and consider them in every decision +* relentlessly acquire and analyze data, so we can make better choices +* visualize and design for current, idealized, and future versions of our whole product when adding features + +To best serve these goals, we apply an iterative approach to product delivery, including an iterative product release lifecycle that allows us to introduce and improve upon new functionality. + +<%= include('../_includes/_topic-links', { links: [ +'product-lifecycle/product-release-stages', +'product-lifecycle/migration-process', +'product-lifecycle/migrations', +] }) %> diff --git a/articles/product-lifecycle/migration-process.md b/articles/product-lifecycle/migration-process.md new file mode 100644 index 0000000000..8443e5a533 --- /dev/null +++ b/articles/product-lifecycle/migration-process.md @@ -0,0 +1,41 @@ +--- +toc: true +title: Migration Process +description: Learn about the migration process at Auth0, including End of Life announcements, migration windows, and migration guides. +topics: + - migrations + - product-lifecycle + - breaking-changes +contentType: + - reference +useCase: + - migrate +--- + +# Migration Process + +To keep our platform stable and secure, we must occasionally modify or remove features or behaviors. These changes will sometimes result in a breaking change. + +When we must introduce a breaking change, we first deprecate the affected feature or behavior and announce the Deprecation to our customers. When a new Deprecation is announced, customers should engage in a Migration to move away from the deprecated feature or behavior. + +For a list of all Deprecations with active Migrations, see [Active Migrations](/product-lifecycle/migrations). + +To learn more about Auth0 product release stages, see [Product Release Stages](/product-lifecycle/product-release-stages). + +## End of Life announcement + + When we announce a Deprecation, we typically include the date that the feature or behavior will be moved into the End of Life product release stage and removed from the platform. In some cases, we will immediately deprecate a feature to prevent further adoption and will determine the End of Life date at a later time. End of Life dates can vary between plan types. + +## Migration window + +When we make an End Of Life announcement, we will also open a migration window to allow customers to prepare for the End of Life date. + +Whenever possible, we provide at least a six-month migration window between the End Of Life announcement and the End Of Life date. In case of emergency (for example, critical vulnerabilities that require remediation or changes required by applicable law or third-party certification standards), we may accelerate this time frame. In such cases, we will provide as much prior notice as is reasonable under the circumstances. + +## Migration guides + +Auth0 Deprecations usually involve replacing deprecated behavior with substantially comparable functionality (although at times, we may elect to discontinue support for some functionality entirely). + +To help you migrate to the new functionality and determine the impact on your tenants, we will publish a migration guide, which will detail any necessary modifications to your application's code, inform you of any other required actions, and instruct you about how you opt in to the new behavior prior to the End of Life date. + + Once the End of Life date is reached, the new behavior will automatically be enabled for tenants that did not opt in during the migration window. \ No newline at end of file diff --git a/articles/product-lifecycle/migrations.md b/articles/product-lifecycle/migrations.md new file mode 100644 index 0000000000..253d55524d --- /dev/null +++ b/articles/product-lifecycle/migrations.md @@ -0,0 +1,112 @@ +--- +title: Active Migrations +description: View all Deprecations with active Migrations that may impact your tenant. +topics: + - migrations +contentType: + - reference +useCase: + - migrate +--- + +# Active Migrations + +We are actively migrating customers to new behaviors for all Deprecations listed below. Please review these carefully to ensure you've taken any necessary steps to avoid service disruption. To learn more, see [Migration Process](/product-lifecycle/migration-process). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Feature/BehaviorDeprecatedEnd Of Life DateDetails
    Unpaginated Managment API v2 Request deprecation21 July 2020 (Public Cloud)26 January 2021 + After 26 January 2021, requests to the following Management API v2 endpoints will return a maximum of 50 items for Public Cloud tenants. To retrieve more items, you must include the page and per_page parameters. Beginning on 21 July 2020, Auth0 will display tenant logs and a migration toggle to help you prepare for this change. +
      +
    • GET /api/v2/clients +
    • GET /api/v2/client-grants +
    • GET /api/v2/grants +
    • GET /api/v2/connects +
    • GET /api/v2/device-crecentials (when type query parameter is used) +
    • GET /api/v2/resource-servers +
    • GET /api/v2/rules +
    + All Public Cloud tenants are affected that are created before 21 July 2020 and are actively calling affected endpoints without passing the per_page parameter for queries that can return more than 1 result. + Tenants are not affected if they are created after 21 July 2020, are not using the affected endpoints, are using the affected endpoints and passing the per_page parameter, or are making queries that always return only 1 result. +
    Node.js v8 Extensibility Runtime15 April 2020TBA + The Webtask engine powering Auth0 extensibility points currently uses Node 8. Beginning 31 December 2019, Node.js v8 was no longer under long-term support (LTS). This means that critical security fixes were no longer back-ported to this version. As such, Auth0 is migrating the Webtask runtime from Node.js v8 to Node.js v12.

    On 15 April 2020, we made the Node 12 runtime available for extensibility to all public cloud customers. You have been provided a migration switch that allows you to control your environment's migration to the new runtime environment.

    To learn more about this migration and the steps you should follow to upgrade your implementation, see Migration Guide: Extensibility and Node.js v12. +
    Instagram Connection Deprecation5 March 202031 March 2020Facebook announced that on March 31th, 2020, they will turn off the Instagram legacy APIs, and they won't provide an alternative to implement Login with Instagram
    Changes in the Yahoo user profile1 March 20201 March 2020Yahoo changed the way to retrieve the user profile and the information included on it.
    Management API v1October 2016 + Public Cloud: 13 July 2020
    + Private Cloud: November 2020 release
    +
    Management API v1 will reach its End of Life in the Public Cloud on July 13, 2020. Management API v1 will be included in the Private Cloud until the November 2020 monthly release, which is the first release that will not include Management API v1. You may be required to take action before that date to ensure no interruption to your service. A migration guide is available to walk you through the required steps. Notifications have been and will continue to be sent to customers that need to complete this migration.
    Useful Resources:
    + Management API v1 to v2 Migration Guide
    + Management API v2 documentation
    + Management API v1 documentation
    + Breaking changes
    +
    /oauth/ro deprecation for Passwordless Connections8 June 2017 + TBD + On June 8th 2017 we deprecated the /oauth/ro endpoint for passwordless connections. You can now implement the same functionality using the /oauth/token endpoint.
    User Search v26 June 201830 June 2019User Search v2 is being deprecated and you may be required to take action before June 30, 2019. A migration guide is available to walk you through the steps required. Notifications have been and will continue to be sent to customers that need to complete this migration.
    Useful Resources:
    + User Search v3
    + User Search v3 - Query Syntax
    + User Search Best Practices
    + User Search v2 to v3 Migration Guide
    +
    Tenant Logs Search v221 May 2019 + Free: 9 July 2019
    + Developer: 20 August 2019
    + Developer Pro: 20 August 2019
    + Enterprise: 4 November 2019 +
    To provide our customers with the most reliable and scalable solution, Auth0 has deprecated Tenant Logs Search Engine v2 in favor of v3. Auth0 is proactively migrating customers unaffected by this change, while those who are potentially affected are being notified to opt in for v3 during the provided grace period. See the migration guide for more information.
    + +If you have any questions, please visit the Migrations section of the [Auth0 Community site](https://community.auth0.com/c/auth0-community/Migrations) or create a ticket in our [Support Center](${env.DOMAIN_URL_SUPPORT}). diff --git a/articles/product-lifecycle/product-release-stages.md b/articles/product-lifecycle/product-release-stages.md new file mode 100644 index 0000000000..f663e50032 --- /dev/null +++ b/articles/product-lifecycle/product-release-stages.md @@ -0,0 +1,71 @@ +--- +toc: true +title: Product Release Stages +description: Learn how we stage, release, and retire product functionality. +topics: + - migrations + - product-lifecycle +contentType: + - reference +useCase: + - migrate +--- + +# Product Release Stages + +Product release stages describe how we stage, release, and retire product functionality. Product features may not progress through all release stages, and the time in each stage will vary depending on the scope and impact of the feature. + +## Early Access (Alpha) + +Early access offerings give a limited number of subscribers or customer development partners (CDPs) the opportunity to test and provide feedback on future functionality. At this stage, functionality may not be complete, but is ready for validation. + +During this stage, we work with participants to + +* confirm that functionality aligns with the intended goal +* validate that the solution is usable in practice +* elicit suggested improvement + +During this stage, our goal is to ensure that the eventual release provides the maximum value to our customers. + +When participating in an early access program, you should understand the following: + +* Functionality is under active development, so we do not yet support it for production use. +* We expect breaking changes, but will do our best to communicate them. +* The program provides a private preview available to only a limited number of select subscribers. +* Your feedback may help shape the General Availability (GA) or a subsequent release. + +Early Access offerings are subject to our Beta Service Terms, which you can view at [Legal](https://auth0.com/legal). + +## Beta (Private or Public) + +Beta releases give subscribers time to explore and adopt new product capabilities while providing final feedback prior to a General Availability (GA) release. Functionality is code-complete, stable, useful in a variety of scenarios, and believed to meet or almost meet quality expectations for a GA release. Beta releases may be restricted to a select number of subscribers (private) or open to all subscribers (public). + +When participating in a beta release, you should understand the following: + +* Functionality is feature complete, but we do not yet support it for production use. +* Breaking changes may occur, and we will do our best to communicate them. +* Your feedback may help prioritize improvements and fixes in a subsequent release. + +Beta releases are subject to our Beta Service Terms, which you can view at [Legal](https://auth0.com/legal). + +## General Availability + +General Availability (GA) releases are fully functional and available to all subscribers (limited by pricing tier) for production use. If a new release replaces an existing feature, we provide a period of backward compatibility in accordance with our deprecation policy and inform customers so they have time to adopt the new release. + +## Deprecation + +Deprecated features are not supported for use by new subscribers, are not actively being enhanced, and are being only minimally maintained. Tenants using the feature at the time of deprecation will continue to have access. + +Deprecation begins when we introduce new behavior that customers would experience as a breaking change without mediation and ends when the old behavior moves into the End of Life product release stage. During Deprecation, customers should engage in a migration to move away from the deprecated feature or behavior. To learn more, see [Migration Process](/product-lifecycle/migration-process). + +Although we know that deprecations can be disruptive, they are necessary to allow us to upgrade technology, improve security and quality, and continue to invest in resources that provide the most value for our customers. + +We are committed to transparency, so we try to proactively notify subscribers when deprecations result in breaking changes or cause altered use of Auth0. Additionally, we try to provide end-of-life notices with accompanying recommendations for migration and replacement capabilities where available. + +For self-service subscribers, Deprecation is subject to our [Identity Platform Terms of Service](https://auth0.com/legal/ss-tos). For enterprise customers, Deprecation is subject to the Subscription Agreement, which you can view at [Legal](https://auth0.com/legal). + +## End Of Life + +Features that reach this stage are removed from the platform. Continued use of these features will likely result in errors. + +For self-service subscribers, End of Life is subject to our [Identity Platform Terms of Service](https://auth0.com/legal/ss-tos). For enterprise customers, End of Life is subject to the Subscription Agreement, which you can view at [Legal](https://auth0.com/legal). \ No newline at end of file diff --git a/articles/protocols/index.html b/articles/protocols/index.html index 0ff08ad891..18daba8d31 100644 --- a/articles/protocols/index.html +++ b/articles/protocols/index.html @@ -26,7 +26,7 @@

    Protocols

    - Auth0 implements proven, common and popular identity protocols used in consumer oriented web products (OAuth 2.0, OpenID Connect) and in enterprise deployments (SAML, WS-Federation, LDAP). + Auth0 implements proven, common and popular identity protocols used in consumer oriented web products (OAuth 2.0, OpenID Connect (OIDC)) and in enterprise deployments (SAML, WS-Federation, LDAP).