> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-chore-teams-api-autoupdate.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> How to use Auth0.Android with database connections

# Auth0.Android Database Authentication

<Warning>
  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](/docs/get-started/applications/application-grant-types) for more information.
</Warning>

## 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 want to authenticate with. The response is a `Credentials` object.

```kotlin lines theme={null}
authentication
    .login("username@domain.com", "a secret password", "my-database-connection")
    .start(object: Callback<Credentials, AuthenticationException> {
        override fun onSuccess(payload: Credentials) {
            // Logged in!
        }

        override fun onFailure(error: AuthenticationException) {
            // Error!
        }
    })
```

The default scope is `openid profile email`.

## Sign up with a database connection

To sign up with a database connection, call the `signUp` method, passing the user's email, password, and connection name.

```kotlin lines theme={null}
authentication
    .signUp("username@domain.com", "a secret password", "my-database-connection")
    .start(object: Callback<Credentials, AuthenticationException> {
        override fun onSuccess(result: Credentials) {
            // Signed Up & Logged in!
        }

        override fun onFailure(error: AuthenticationException) {
            // Error!
        }
    });
```
