# OKTA Token Inline Hook

**URL:** <https://devforum.okta.com/t/okta-token-inline-hook/12090>\
**Category:** Questions\
**Created:** [December 10, 2020, 8:20am UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090 "2020-12-10T08:20:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![san\_jain](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@san\_jain](https://devforum.okta.com/u/san_jain)\
**Post date:** [December 10, 2020, 8:20am UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/1 "2020-12-10T08:20:41Z")

</div>

i am seeing 0 successful execution for token inline hook, when executed from postman i am receiving the response from external service but the access token doesn’t contain the claim added.

Response from external service:  
{  
“error”: null,  
“commands”: [  
{  
“type”: “com.okta.access.patch”,  
“value”: [  
{  
“op”: “add”,  
“path”: “/claims/assertion”,  
“value”: “assertion”  
}  
]  
}  
],  
“debugContext”: {}  
}

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://devforum.okta.com/u/warren)\
**Post date:** [December 10, 2020, 5:51pm UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/2 "2020-12-10T17:51:57Z")

</div>

If you check your Okta system logs, you should see an event “Inline Hook execution failed” and it should show the failure reason. What error do you see?

---

<div class="post-metadata">

**Author:** ![san\_jain](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@san\_jain](https://devforum.okta.com/u/san_jain)\
**Post date:** [December 11, 2020, 4:52am UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/3 "2020-12-11T04:52:29Z")

</div>

There is no event in system log as well and metric still shows 0 successful executions.

But when triggered test/execute okta api for inline hook i am getting the response.

Am i missing anything here?

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://devforum.okta.com/u/warren)\
**Post date:** [December 11, 2020, 4:39pm UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/4 "2020-12-11T16:39:46Z")

</div>

Did you associate the inline hook with a custom authorization server access policy as described in this doc?

> **[Token Inline Hook Reference | Okta Developer](https://developer.okta.com/docs/reference/token-hook/#enabling-a-token-inline-hook)**

---

<div class="post-metadata">

**Author:** ![san\_jain](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@san\_jain](https://devforum.okta.com/u/san_jain)\
**Post date:** [December 11, 2020, 5:34pm UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/5 "2020-12-11T17:34:17Z")

</div>

yes i did associate the inline hook with custom authorization server, access policy-\> rule

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://devforum.okta.com/u/warren)\
**Post date:** [December 11, 2020, 7:34pm UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/6 "2020-12-11T19:34:22Z")

</div>

Can you confirm if you’re using the correct base url? If you associated the inline hook to an access policy for the custom authorization server named “default”, then your authorize request will look like this `https://yourOrg.okta.com/oauth2/default/v1/authorize?...` and you should see logs of the inline hook executing when tokens are generated. If you’re using a different base url such as `https://yourOrg.okta.com/oauth2/v1/authorize`, then it won’t work.

---

<div class="post-metadata">

**Author:** ![san\_jain](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@san\_jain](https://devforum.okta.com/u/san_jain)\
**Post date:** [December 14, 2020, 3:12am UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/7 "2020-12-14T03:12:38Z")

</div>

Hi Warren ,  
Using the right authorize url for the custom authz server but still not seeing any events in the logs but i do see the metric after a day with successful execution count but this is not instant.

Is there a minimal set up of json request for the inline hook which we can use to make request for the inline hook execution end point , or please let me know how do we create the json request for inline hook since i am using the sample format and editing the values, is there any other way to create the json request.

Regards,  
San\_jain

---

<div class="post-metadata">

**Author:** ![san\_jain](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@san\_jain](https://devforum.okta.com/u/san_jain)\
**Post date:** [December 14, 2020, 7:02am UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/8 "2020-12-14T07:02:38Z")

</div>

I am now able to see the Claims added through inline hook, Issue was with the [jwt.io](http://jwt.io) was not showing the complete claim ,okta /introspect endpoint showing the added claims.

Regards,  
san\_jain

---

<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:** [December 15, 2020, 7:02am UTC](https://devforum.okta.com/t/okta-token-inline-hook/12090/9 "2020-12-15T07:02:38Z")

</div>

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