# Native Android app + Username-Password authentication + REST API?

**URL:** <https://community.auth0.com/t/native-android-app-username-password-authentication-rest-api/6504>\
**Category:** Get Help\
**Tags:** android, api-authorization\
**Created:** [May 5, 2017, 10:11pm UTC](https://community.auth0.com/t/native-android-app-username-password-authentication-rest-api/6504 "2017-05-05T22:11:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalvishaarad](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dalvishaarad/32/7144_2.png) [@dalvishaarad](https://community.auth0.com/u/dalvishaarad)\
**Post date:** [May 5, 2017, 10:11pm UTC](https://community.auth0.com/t/native-android-app-username-password-authentication-rest-api/6504/1 "2017-05-05T22:11:12Z")

</div>

I’m building a native Android app for a small group of users. As I only want intended users to authenticate and use, I’m opting for Username and Password login (Auth0 Database) with disabling Signing Up feature.

The Android app is supposed to talk to an API whose methods should be authenticated only.

I’m new to Auth0 ecosystem and it’s a bit overwhelming about how to start.

Things I’ve done till now:

- Created an API project
- Created an android native client

Questions:

- Should I follow [Add Login to Your Android Application using the Auth0.Android SDK - Auth0 Docs](https://auth0.com/docs/quickstart/native/android) and create a login activity on my Android app?
- How to connect the API project with android native client? The API section says ‘for native clients, you need Authorization Code Grant Flow with PKCE’. Is this not done with the link in 1)?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [May 15, 2017, 5:53pm UTC](https://community.auth0.com/t/native-android-app-username-password-authentication-rest-api/6504/2 "2017-05-15T17:53:26Z")

</div>

There’s a couple of ways to achieve that. If you choose to make use of Lock Android then see the answer to your other question: [Android Lock with database authentication and API Authorization - Auth0 Community](http://community.auth0.com/questions/2213/android-lock-with-database-authentication)

In relation to the use of PKCE, this is indeed the general recommended approach for native application to obtain tokens as part of authentication/authorization requests performed under the rules of OpenID Connect/OAuth2. It’s not the only option, but it’s the one that covers most scenarios; for example, in very specific circumstances where a user authenticates with custom username/password credentials specific to the application itself it may be sufficient to use resource owner password grant.

---

<div class="post-metadata">

**Author:** ![sonny.rajagopalan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sonny.rajagopalan/32/4126_2.png) [@sonny.rajagopalan](https://community.auth0.com/u/sonny.rajagopalan)\
**Post date:** [June 13, 2017, 10:23pm UTC](https://community.auth0.com/t/native-android-app-username-password-authentication-rest-api/6504/3 "2017-06-13T22:23:21Z")

</div>

Would be really useful if you added an example and point to URL for how to do this.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/native-android-app-username-password-authentication-rest-api/6504/4 "2018-03-02T05:53:44Z")

</div>


