# Build an Android Application with Authentication

**URL:** <https://devforum.okta.com/t/build-an-android-application-with-authentication/17238>\
**Category:** Developer Blog Comments\
**Created:** [April 20, 2020, 5:03pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238 "2020-04-20T17:03:41Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [April 20, 2020, 5:03pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/1 "2020-04-20T17:03:41Z")

</div>

[Build an Android Application with Authentication](https://developer.okta.com/blog/2020/04/20/android-authentication)

Tutorial: Build a simple Android application with authentication then add social and biometric authentication.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 20, 2020, 2:20am UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/2 "2020-08-20T02:20:03Z")

</div>

**prathap badavath**

after clicking sign in button okta login web page not opening.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 20, 2020, 2:30am UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/3 "2020-08-20T02:30:29Z")

</div>

**Matt Raible**

Did you [give your app permission to use the internet](https://developer.okta.com/blog/2020/04/20/android-authentication#give-your-android-app-permission-to-use-the-internet "https://developer.okta.com/blog/2020/04/20/android-authentication#give-your-android-app-permission-to-use-the-internet")?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 20, 2020, 6:15am UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/4 "2020-08-20T06:15:51Z")

</div>

**prathap badavath**

yes, i gave permission in Manifest file.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 20, 2020, 10:12pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/5 "2020-08-20T22:12:41Z")

</div>

**Brian Demers**

Hey Prathap!  
What do you see when it’s not opening? any errors in your logs/console?  
Are you running in an emulator or on device?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 21, 2020, 8:29am UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/6 "2020-08-21T08:29:08Z")

</div>

**prathap badavath**

running on device.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 21, 2020, 1:48pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/7 "2020-08-21T13:48:56Z")

</div>

**Brian Demers**

What happens when you click on the button? Are there any errors in the log/console?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 25, 2020, 7:27pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/8 "2020-08-25T19:27:31Z")

</div>

**Jason Celestine**

We have customers that have their own okta subscriptions. How would I include okta login support that allows them to dynamically pick what subscription they want to auth against? Is the expectation that each customer would require a custom build?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 27, 2020, 8:41pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/9 "2020-08-27T20:41:33Z")

</div>

**Matt Raible**

Hello Jason,

The only solution I can think of is to have some sort of endpoint that returns the Okta configuration information for each customer. I don’t think our Android SDK has dynamic configuration built in, but I’m sure it’s possible to add. You could try opening an issue in our [Android SDK](https://github.com/okta/okta-oidc-android "https://github.com/okta/okta-oidc-android") with this as a feature request.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [August 28, 2020, 12:42am UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/10 "2020-08-28T00:42:33Z")

</div>

**Jason Celestine**

Thanks Matt, that’s basically what I was thinking. I was hoping Okta would have an option simular to the MS Azure AD feature that can auth with any MS account.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [January 6, 2021, 12:03am UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/11 "2021-01-06T00:03:31Z")

</div>

**Matt Raible**

I had the [same issue](https://github.com/okta/okta-oidc-android/issues/210 "https://github.com/okta/okta-oidc-android/issues/210"). Add `.setRequireHardwareBackedKeyStore(false)` to your `WebAuthBuilder` to fix it so it’ll run in an emulator.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [May 18, 2021, 10:15am UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/12 "2021-05-18T10:15:58Z")

</div>

**Rob de Kluijver**

There are warnings building the example.  
jcenter repository end-of-service - replacing it with mavenCentral was no solution.  
kotlin-android-extensions plugin deprecated - I can migrate but better adapt the example.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [May 18, 2021, 12:27pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/13 "2021-05-18T12:27:40Z")

</div>

**Matt Raible**

If you’d like to create a pull request to the [example repo](https://github.com/oktadeveloper/okta-oidc-android-example "https://github.com/oktadeveloper/okta-oidc-android-example"), I’d be happy to send you a t-shirt! 🙂

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 7, 2021, 6:08pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/14 "2021-10-07T18:08:24Z")

</div>

**Nathan DeGroff**

Platform: Android  
Framework: Jetpack Compose

I’ve been able to get the android (Java and Kotlin) GitHub web client sample apps to work using my developer account and with the new corporate account created. However, our team has decided to start development of a new Android app using Jetpack Compose (a declarative UI).

I’ve been having difficulty trying to port that sample kotlin code over to work with the new framework. I’m able to kick off the Okta Web Client and authenticate in, but when passing control back, the registered result callback does nothing and the client is in permanent limbo.

Is there any samples of Okta with Compose? The Github samples have been very useful so far.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 11, 2021, 6:50pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/15 "2021-10-11T18:50:01Z")

</div>

**Matt Raible**

Hello Nathan,

I noticed you posted this [same question to our developer forums](https://devforum.okta.com/t/support-for-android-jetpack-compose-kotlin/16511 "https://devforum.okta.com/t/support-for-android-jetpack-compose-kotlin/16511"). I’m just providing the link here so others can find it. In the future, please don’t cross post. We get notifications for both the blog and our forums and it just creates more work to answer your question in two places.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [October 11, 2021, 7:12pm UTC](https://devforum.okta.com/t/build-an-android-application-with-authentication/17238/16 "2021-10-11T19:12:44Z")

</div>

**Nathan DeGroff**

Thanks Matt, my apologies. I posted to this blog as the topic was the most similar one I found and I wanted to cast my net wide enough.
