How to Use Okta as openId authentication provider in azure function

Sajin Sudhakaran 1 Reputation point
2022-08-05T04:09:34.49+00:00

I have created an azure function and trying to configure okta as an openId connect authentication provider on function app server thorugh portal. below are my step

1) Registered a client(SSO) application in OKta (using free okta developer account )
2)Registered API application with client credential flow with scope api(custom scope) in Okta
2) Configured function app authentication section with Okta openId meta url
3) Successfully generated 'access_token' and 'id_token' with api scope
3) Tried passing access token directly to function as header Authorization: bearer <access_token>

Received 401 error
4) Tried passing id_token as post requst to <functionhost>/.auth/login/<oktaprovider name> for session token

Received 401 error

when tried to verify my tokens with openId v1/introspect url from okta i am getting scopes defined and an active token

I am not sure what I am missing. I am able to connect azure add as both Microsoft provider and openId connect provider without issue

Is this a an issue with function app itself?

I can see a scope section inazure function openId provider but can't enter any value there. what is the purpose of scope tab?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-08-18T06:47:26.937+00:00

    @Sajin Sudhakaran , Please make sure that you are following the grant types as mentioned in the below article

    https://developer.okta.com/blog/2018/04/10/oauth-authorization-code-grant-type

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.