<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Is it possible to validate OAuth 2.0 token in Custom Inbound API in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153127#M1172871</link>
    <description>&lt;P&gt;That makes sense but I'm confused as to how would ServiceNow know that my custom API will need to validate for OAuth? I mean where is the link defined between the API and authentication? Like whenever someone hits the API, how does ServiceNow know that it should check for OAuth token?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2025 06:25:31 GMT</pubDate>
    <dc:creator>Nisar3</dc:creator>
    <dc:date>2025-01-20T06:25:31Z</dc:date>
    <item>
      <title>Is it possible to validate OAuth 2.0 token in Custom Inbound API</title>
      <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153080#M1172844</link>
      <description>&lt;P&gt;We have a custom inbound API and under it a resource (sys_ws_operation). When the consumer hits this resource, is there a way to validate if the token received in the header is valid (i.e. the same that ServiceNow gave to the client)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(function process( /*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {

// check token here and verify is it's valid
   
})(request, response);&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 20 Jan 2025 05:40:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153080#M1172844</guid>
      <dc:creator>Nisar3</dc:creator>
      <dc:date>2025-01-20T05:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to validate OAuth 2.0 token in Custom Inbound API</title>
      <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153108#M1172860</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/529433"&gt;@Nisar3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;are you using OAuth 2.0 here?&lt;/P&gt;
&lt;P&gt;I think you have created a scripted REST API and willing to check if the endpoint was hit with OAuth details or not&lt;/P&gt;
&lt;P&gt;If yes then check this link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=cfcd27ebdb82e384107d5583ca96193a" target="_blank" rel="noopener"&gt; Inbound Rest endpoint restricted to OAUTH Authentication&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 06:09:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153108#M1172860</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-01-20T06:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to validate OAuth 2.0 token in Custom Inbound API</title>
      <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153112#M1172862</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/529433"&gt;@Nisar3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for marking my response as helpful.&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 06:11:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153112#M1172862</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-01-20T06:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to validate OAuth 2.0 token in Custom Inbound API</title>
      <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153114#M1172863</link>
      <description>&lt;P&gt;Yes, that helps. It gets me over Step 1 (i.e. retrieving the token value from header). Now step 2 would be&amp;nbsp; verifying if the token value is valid or not. How can we do that? We have the Manage Tokens table but the value there would be encrypted, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, we received the token value "abc" in Authorization header. Now where do I compare this "abc" value with?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 06:12:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153114#M1172863</guid>
      <dc:creator>Nisar3</dc:creator>
      <dc:date>2025-01-20T06:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to validate OAuth 2.0 token in Custom Inbound API</title>
      <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153123#M1172868</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/529433"&gt;@Nisar3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but why you wish to validate?&lt;/P&gt;
&lt;P&gt;ServiceNow will handle this OOB and if token they retrieved isn't valid they won't be able to consume the endpoint.&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 06:18:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153123#M1172868</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-01-20T06:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to validate OAuth 2.0 token in Custom Inbound API</title>
      <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153127#M1172871</link>
      <description>&lt;P&gt;That makes sense but I'm confused as to how would ServiceNow know that my custom API will need to validate for OAuth? I mean where is the link defined between the API and authentication? Like whenever someone hits the API, how does ServiceNow know that it should check for OAuth token?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 06:25:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153127#M1172871</guid>
      <dc:creator>Nisar3</dc:creator>
      <dc:date>2025-01-20T06:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to validate OAuth 2.0 token in Custom Inbound API</title>
      <link>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153142#M1172876</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/529433"&gt;@Nisar3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when somebody hits your endpoint and you have given OAuth details to them i.e. client id and client secret, we usually give basic auth details as well.&lt;/P&gt;
&lt;P&gt;Now coming to your question how does ServiceNow know if the incoming API request has to be enforced using OAuth or Basic, so we cannot enforce to use OAuth, the link I shared will help you to enforce them to use OAuth token and not just basic auth&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 06:45:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/is-it-possible-to-validate-oauth-2-0-token-in-custom-inbound-api/m-p/3153142#M1172876</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-01-20T06:45:24Z</dc:date>
    </item>
  </channel>
</rss>

