# Create new token

**URL:** <https://devforum.okta.com/t/create-new-token/2360>\
**Category:** Questions\
**Created:** [August 7, 2018, 9:50am UTC](https://devforum.okta.com/t/create-new-token/2360 "2018-08-07T09:50:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashish311patidar](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/ashish311patidar/32/639_2.png) [@ashish311patidar](https://devforum.okta.com/u/ashish311patidar)\
**Post date:** [August 7, 2018, 9:50am UTC](https://devforum.okta.com/t/create-new-token/2360/1 "2018-08-07T09:50:18Z")

</div>

We are not able to generate new access token from rest api and getting below response.  
What is “Invalid client app id” for okta?  
{  
“errorCode”: “E0000013”,  
“errorSummary”: “Invalid client app id”,  
“errorLink”: “E0000013”,  
“errorId”: “oae\_DI329iMR4SahCSlTS4nTQ”,  
“errorCauses”: []  
}

---

<div class="post-metadata">

**Author:** ![nate.barbettini](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/nate.barbettini/32/385_2.png) [@nate.barbettini](https://devforum.okta.com/u/nate.barbettini)\
**Post date:** [August 7, 2018, 3:40pm UTC](https://devforum.okta.com/t/create-new-token/2360/2 "2018-08-07T15:40:36Z")

</div>

Can you post the full request and response? I can’t tell what request you are trying to make.

---

<div class="post-metadata">

**Author:** ![ashish311patidar](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/ashish311patidar/32/639_2.png) [@ashish311patidar](https://devforum.okta.com/u/ashish311patidar)\
**Post date:** [August 8, 2018, 5:19am UTC](https://devforum.okta.com/t/create-new-token/2360/3 "2018-08-08T05:19:25Z")

</div>

Hi Nate,

Thanks for the response.

We are trying to create Okta Token from **Postman/SoapUI** with below request.

**Request:**

curl -v -H “Content-type:application/json”   
-H “Accept:application/json”   
-X POST https://{yourOktaDomain}/api/v1/tokens/   
-d   
'{  
“username”: "ashish311patidar@gmail.com",  
“password”: “SecretPass”,  
“clientAppId”: “0oafu4nt03Pyew3uS0h7”,  
“deviceName”: “Sample Device Name”  
}`

**Expected Response** :

{  
“token”: “00F-MBcxD2SC8tzXDCDZm2a04qtXLcFqtlrrPu6eVtxRs”  
}

But we are getting below response with error code.

{  
“errorCode”: “E0000013”,  
**“errorSummary”: “Invalid client app id”,**  
“errorLink”: “E0000013”,  
“errorId”: “oae\_DI329iMR4SahCSlTS4nTQ”,  
“errorCauses”: []  
}

---

<div class="post-metadata">

**Author:** ![nate.barbettini](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/nate.barbettini/32/385_2.png) [@nate.barbettini](https://devforum.okta.com/u/nate.barbettini)\
**Post date:** [August 9, 2018, 12:26pm UTC](https://devforum.okta.com/t/create-new-token/2360/4 "2018-08-09T12:26:52Z")

</div>

The API you’re using is deprecated.

It sounds like you are trying to get an access token for a user who is logging into your application. Is that correct? Can you give me more details about what your application does and who logs in to it?

The [OAuth 2.0 Resource Owner Password flow](https://developer.okta.com/authentication-guide/implementing-authentication/password) is very similar to what you are trying to do:

```auto
POST https://{yourOktaDomain}/oauth2/default/v1/token
Accept: application/json
Authorization: Basic ...
Content-Type: application/x-www-form-urlencoded

grant_type=password&username=ashish311patidar%40gmail.com&password=SecretPass&scope=openid

```

---

<div class="post-metadata">

**Author:** ![ashish311patidar](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/ashish311patidar/32/639_2.png) [@ashish311patidar](https://devforum.okta.com/u/ashish311patidar)\
**Post date:** [August 10, 2018, 6:37am UTC](https://devforum.okta.com/t/create-new-token/2360/5 "2018-08-10T06:37:17Z")

</div>

Hi Nate,

Thank you for your support.  
we have tried as you have suggested in above chain and got below response.

```auto
{
    "access_token": "eyJraWQiOiI4T3A2ajBoRGtXSTM5QUdQWFBHdTlDUjFfTzBaVGZDVzVDMV9adDFsd0xVIiwiYWxnIjoiUlMyNTYifQ.eyJ2ZXIiOjEsImp0aSI6IkFULmhuMXRzVWZJLUMwQXRMX2xrZkJ1RExTMU54ZUNWOGJqTUZSVVVYMndNZ1kiLCJpc3MiOiJodHRwczovL2Rldi05NzQ5OTIub2t0YXByZXZpZXcuY29tL29hdXRoMi9kZWZhdWx0IiwiYXVkIjoiYXBpOi8vZGVmYXVsdCIsImlhdCI6MTUzMzg4Mjk0NywiZXhwIjoxNTMzODg2NTQ3LCJjaWdDAzUHlldzN1UzBoNyIsInNjcCI6WyJ3cml0ZSJdLCJzdWIiOiIwb2FmdTRudDAzUHlldzN1UzBoNyJ9.jk9gZ8vLYdvuoGK_J1KAE0LR1MXYCZwUv1R4FqGek9qdFZBYvMi_0buJLv-KwIvmbkw-J-tJvf8IrNHD7MliaQHwp5wjRzNwAXtRhmuY0Aq580jKwPEthbqYvZZGj3BsULisaMlFkk10M1bfQf9pUllNHeqX-ok6GVZ_n18Gn3mv164lUBJ1a5pCer9OX9JayKSlaL71j-f77_J-aeS2Z8XaYEwVhDQGJ03i-4ulXhdnZYEDhqXZNM_kVixRcyEJTH7uYAUCiaClrrlZI2vIDiDjO5kCB1_Ur4JKmY9J_fE1C_F8KNY5cuexZ9Sig06xm9cG5Mn_JHIR45g1I3-FPA",
    "token_type": "Bearer",
    "expires_in": 3600,
    "scope": "write"
}

```

But we are not able to create Custom Authorization server with below request. Will you please help us to Create Custom Authorization server.

```auto
curl -v -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{ "name": "Sample Authorization Server",
      "description": "Sample Authorization Server description",
      "audiences": [
        "api://default"
      ]
}' "https://dev-974992.oktapreview.com/api/v1/authorizationServers"

```

---

<div class="post-metadata">

**Author:** ![nate.barbettini](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/nate.barbettini/32/385_2.png) [@nate.barbettini](https://devforum.okta.com/u/nate.barbettini)\
**Post date:** [August 10, 2018, 3:38pm UTC](https://devforum.okta.com/t/create-new-token/2360/6 "2018-08-10T15:38:42Z")

</div>

Glad that worked! I’ll answer your question about creating a custom Authorization Server here: [Authorization Server Creation Issue](https://devforum.okta.com/t/authorization-server-creation-issue/2372)

---

<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:** [February 8, 2024, 6:52pm UTC](https://devforum.okta.com/t/create-new-token/2360/8 "2024-02-08T18:52:11Z")

</div>

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