# Flow for IoT device with no display or input

**URL:** <https://devforum.okta.com/t/flow-for-iot-device-with-no-display-or-input/8183>\
**Category:** Questions\
**Created:** [February 20, 2020, 6:42pm UTC](https://devforum.okta.com/t/flow-for-iot-device-with-no-display-or-input/8183 "2020-02-20T18:42:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aloiseau\_xobd](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@aloiseau\_xobd](https://devforum.okta.com/u/aloiseau_xobd)\
**Post date:** [February 20, 2020, 6:42pm UTC](https://devforum.okta.com/t/flow-for-iot-device-with-no-display-or-input/8183/1 "2020-02-20T18:42:11Z")

</div>

Hello,

We currently have a product that is an IoT device with no display or input method.  
In order to activate it with a user account, we use a native mobile app that communicates with a Spring Boot web app that responds to the Password Flow, and sends back access+refresh tokens.

The access+refresh tokens are then sent from mobile app to IoT via encrypted channel, and the IoT is then able to stay logged in forever by refreshing the access token on its own.

It has worked for us the past couple years because we own the mobile app/web app/IoT device. However, I’m aware that it is not optimal, and does not support federated identity (dealbreaker).

What flow would you suggest to authenticate the user on mobile app, _have IoT device be logged on forever (unless credentials are no longer valid)_ and supports federated identities (ex. Facebook)?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![abroadhurst](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@abroadhurst](https://devforum.okta.com/u/abroadhurst)\
**Post date:** [February 21, 2020, 9:46am UTC](https://devforum.okta.com/t/flow-for-iot-device-with-no-display-or-input/8183/2 "2020-02-21T09:46:35Z")

</div>

Hi there!

I would recommend the Client Credentials, Device Flow or Authorization + PKCE Flow. They seems to suit what you are looking for.

[https://developer.okta.com/books/api-security/authn/federated/](https://developer.okta.com/books/api-security/authn/federated/)

They all support federated identities.

However I don’t recommend Resource Owner Password Flow, please avoid using this flow.

---

<div class="post-metadata">

**Author:** ![Govner](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/govner/32/1099_2.png) [@Govner](https://devforum.okta.com/u/Govner)\
**Post date:** [February 21, 2020, 10:49am UTC](https://devforum.okta.com/t/flow-for-iot-device-with-no-display-or-input/8183/3 "2020-02-21T10:49:40Z")

</div>

The OAuth device authorization grant was specifically designed for this purpose ([https://tools.ietf.org/html/rfc8628](https://tools.ietf.org/html/rfc8628))

> **[Add the OAuth 2.0 Device Flow to any OAuth Server](https://developer.okta.com/blog/2019/02/19/add-oauth-device-flow-to-any-server)**
>
> Learn how to run an OAuth 2.0 Device Flow proxy server so you can use the Device Flow with servers that don't have native support.

---

<div class="post-metadata">

**Author:** ![aloiseau\_xobd](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@aloiseau\_xobd](https://devforum.okta.com/u/aloiseau_xobd)\
**Post date:** [February 21, 2020, 6:30pm UTC](https://devforum.okta.com/t/flow-for-iot-device-with-no-display-or-input/8183/4 "2020-02-21T18:30:59Z")

</div>

Hello,

Thank you for your replies!  
Yes, I am fully aware of Device / Auth Code / Client Credentials flows and I did read that article on how to add Device Flow to Okta. 🙂

Another auth provider suggests using the Client Credentials flow for IoT (machine to machine) but I’m ambivalent… Generating a new Client ID / Secret pair for each end-user IoT product does not seem very efficient, and it would need to be matched with the customer account as well.

On the other hand, the Device Flow looks appropriate indeed but I’m a bit confused on how the “user code” should be handled when the IoT **does not have a display**. In that case, is it acceptable that the client device (IoT) returns both user\_code and verification\_uri to the secondary device to input them automatically during authentication?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 23, 2024, 10:38pm UTC](https://devforum.okta.com/t/flow-for-iot-device-with-no-display-or-input/8183/5 "2024-01-23T22:38:02Z")

</div>

Closed on January 23, 2024, 10:38pm UTC


