# User Onboarding

The goal is to implement **PDA Auth** screens in a simplified style with less visual clutter.

**PDA Auth** includes the following screens:

* email/password collection for signup
* email/password collection for login
* password recovery and reset screen
* HMIC screen

### Registration

![](/files/S4I2g07pYsZzNvso9jDA)

To use the new **PDA Auth** flow you will first need to redirect the user where they can give their consent to complete the registration.

You can do this by building the signup URL using your `application_id` and `redirect_uri`. See below for an example, these parameters are required:

```
https://auth.dataswift.io/services/signup?
  application_id=<application-id>
  &redirect_uri=<redirect-uri>
```

There are two optional query parameters as well:

* `lang`
  * Defaults to `en`.&#x20;
  * If you pass a different country code by using `lang=<country-code>`,

    the application will appear localized to the requested language, for example: `lang=pt`
* `skip_deps`
  * Defaults to `false`.&#x20;
  * This flag allows control over how the platform handles downline dependencies of your

    application. If, for example, your application depends on a DataPlug to provide data that

    your application can use, the default behaviour of `skip_deps=false` will automatically send the user to the appropriate service to enable the DataPlug.
  * We now support an option for the developer to skip the latter step by using `skip_deps=true`flag passed to the API as a query parameter. When the flag is added, the platform will create a PDA for the user, but will skip the data synchronization setup. In this case, it is up to the developer to decide how they want to handle data synchronization setup in the future.

Upon successful signup, the user will be redirected back to your application with the authentication token attached. This should be stored for subsequent API calls:

```
test-app://authenticate?token=eyJ0eXAiOiJKV1Qi….
```

### Authentication

![](/files/T29A2C8VtnfMkJmnzEWm)

To use **PDA Auth** authorization, you will need to redirect the user to where they can enter their password and complete the process.

You’ll need to build the URL using your Application ID, and a redirect URI. The URL will look similar to this:

```
https://auth.dataswift.io/services/login?
  application_id=<application-id>
  &redirect_uri=<redirect-uri>
```

Optional configuration query parameters:

* `lang`
  * Defaults to `en`.&#x20;
  * If you pass a different country code by using `lang=<country-code>`,

    the application will appear localized to the requested language, for example: `lang=pt`

Upon successful login, the server will verify if the application has been granted all the permissions it needs. If not, the user will need to do so for the app to access their PDA.

Lastly, the user will be redirected back to your application with the authentication token attached. This should be stored for subsequent API calls:

```
test-app://authenticate?token=eyJ0eXAiOiJKV1Qi….
```

### Email Verification

![](/files/9KGPtWiBsEUuK47xxwXA)

Upon successful registration, the user will receive an email to verify their email address and create a password. The user will be redirected to the PDA Dashboard by clicking the link with the unique token.

```
https://<pda-user-url>/auth/verify-email/<verification-token>?
  email=<email-address>
  &application_id=<application-id>
  &redirect_uri=<redirect-uri>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dataswyft.com/build/advanced-topics/pda-authentication/user-onboarding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
