<commit_before>---
section: libraries
toc_title: Passwordless Authentication with Lock for Android
description: Guide on implementing Passwordless authentication with Lock for Android
---

# Lock Passwordless

Lock Passwordless authenticates users by sending them an Email or SMS with a one-time password that the user must enter and confirm to be able to log in, similar to how WhatsApp authenticates you. This article will explain how to send a **CODE** using the `Lock.Android` library.

> You can achieve a similar result by sending a **LINK** that the user can click to finish the passwordless authentication automatically, but a few more configuration steps are involved. You can check that article [here](/libraries/lock-android/passwordless-magic-link).

In order to be able to authenticate the user, your application must have the Email/SMS connection enabled and configured in your [Auth0 Dashboard](${manage_url}/#/connections/passwordless).


## Implementing CODE Passwordless

The first step is to add the `PasswordlessLockActivity` to your `AndroidManifest.xml` inside the `application` tag.

```xml
<activity
    android:name="com.auth0.android.lock.PasswordlessLockActivity"
    android:theme="@style/Lock.Theme"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:launchMode="singleTask"/>
```

> If your client has Social connections enabled you must add the corresponding Intent-Filter in the `PasswordlessLockActivity` to capture the call to the expected callback URL.

When the Passwordless connection is SMS you must also add the `CountryCodeActivity` to allow the user to change the **Country Code** prefix of the phone number.

```xml
<activity<commit_msg>use note wrapper for passwordless instead of quotes<commit_after>---
section: libraries
toc_title: Passwordless Authentication with Lock for Android
description: Guide on implementing Passwordless authentication with Lock for Android
---

# Lock Passwordless

Lock Passwordless authenticates users by sending them an Email or SMS with a one-time password that the user must enter and confirm to be able to log in, similar to how WhatsApp authenticates you. This article will explain how to send a **CODE** using the `Lock.Android` library.

::: note
You can achieve a similar result by sending a **LINK** that the user can click to finish the passwordless authentication automatically, but a few more configuration steps are involved. You can check that article [here](/libraries/lock-android/passwordless-magic-link).
:::

In order to be able to authenticate the user, your application must have the Email/SMS connection enabled and configured in your [Auth0 Dashboard](${manage_url}/#/connections/passwordless).


## Implementing CODE Passwordless

The first step is to add the `PasswordlessLockActivity` to your `AndroidManifest.xml` inside the `application` tag.

```xml
<activity
    android:name="com.auth0.android.lock.PasswordlessLockActivity"
    android:theme="@style/Lock.Theme"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:launchMode="singleTask"/>
```

::: note
If your client has Social connections enabled you must add the corresponding Intent-Filter in the `PasswordlessLockActivity` to capture the call to the expected callback URL.
:::

When the Passwordless connection is SMS you must also add the `CountryCodeActivity` to allow the user to change the **Country Code** prefix of the phone number.

```xml
<activity
{'fraction_non_alphanumeric': 0.07151029748283753, 'fraction_numerical': 0.0011441647597254005, 'mean_word_length': 5.178445229681979, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1683280', 'n_tokens_mistral': 883, 'n_tokens_neox': 838, 'n_words': 418}