# MFA on OKTA native API login with token

**URL:** <https://devforum.okta.com/t/mfa-on-okta-native-api-login-with-token/7519>\
**Category:** Questions\
**Created:** [January 4, 2020, 4:50pm UTC](https://devforum.okta.com/t/mfa-on-okta-native-api-login-with-token/7519 "2020-01-04T16:50:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JappeReuling](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JappeReuling](https://devforum.okta.com/u/JappeReuling)\
**Post date:** [January 4, 2020, 4:50pm UTC](https://devforum.okta.com/t/mfa-on-okta-native-api-login-with-token/7519/1 "2020-01-04T16:50:19Z")

</div>

Hi,

I am developing an admin script that connects to the Okta API ([https://xyz.okta-ema.com/api/v1/](https://xyz.okta-ema.com/api/v1/)) for Okta user, group management. So I am NOT integrating Okta in any kind of app. It’s just my own Okta admin script.

I have this working with a token but I want to add MFA on this.

Currently this token won’t be secure because if anybody get’s his/her hand on this token it can be used from everywhere in the world. The solution would be to add MFA. But I can only find documentation on how to add OAuth a.o. to my application. I want it on the Okta API session.

If some one could confirm this is possible (or not) and point me in the right direction? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dragos](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dragos/32/1313_2.png) [@dragos](https://devforum.okta.com/u/dragos)\
**Post date:** [January 6, 2020, 2:23am UTC](https://devforum.okta.com/t/mfa-on-okta-native-api-login-with-token/7519/2 "2020-01-06T02:23:46Z")

</div>

Hi @JappeReuling

You can find [here](https://developer.okta.com/docs/guides/implement-oauth-for-okta/overview/) a documentation for OAuth for Okta API. The bearer tokens generated through this feature can be used for 60 minutes.

Regarding the MFA option, there is no option out of the box for this functionality, however you can proxy the request through an API gateway, which can add the Authorization header with the API token, preventing the token from being exposed to users.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 23, 2024, 7:44pm UTC](https://devforum.okta.com/t/mfa-on-okta-native-api-login-with-token/7519/3 "2024-01-23T19:44:25Z")

</div>

Closed on January 23, 2024, 7:44pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
