I want to develop MVC web application as a client and Okta as OIDC provider.
I am new in MVC but i have knowledge of c# and .Net
I have already registered our application in okta server for authorization code .
Want some sample code in MVC web application that communicate with Okta server for receiving token and userinfo.
I want to make client to Implement the Authorization Code Flow with Okta.
Also want to get user information with their roles in our application.
Case: I am login with my PC using LDAP login and click on my webapplication name as "TestOIDCApp " then my app will detect the username and password and login automatically.
Thanks for the help dear.
After change the scope as per above , main page redirect to Okta login page.
Once login on that page , redirect to the below url:
How can we use this code to get the ID token after Authorization code received.
What should be the next step, after receive the token i want to redirect to the main page .
You are right dear, i have received the access token after exchange the authorization code,
but after received the token need to display user profile in some sample page.
Only access token is received but how to get "“id_token” and "“refresh_token” as per same as below sample:
How and where to use /userinfo endpoint in existing code?
Also help me about the below code , in our existing client code want to add /userinfo endpoint.
I have checked out the below guide earlier , but i am getting confused.
NO CallBack URL endpoint is mentioned in the ASP.Net web form example.
As such no single article that can describe a to z ,i mean Authorization grant flow using OIDC protocol to authenticate the user without opening the login page in .NET MVC Web application.
Just need to authenticate my ASP.net web application with OKta server via Back channel authentication and get user profile from the server.
Please share the step by step guide code according to my problem.
Regarding using OIDC and skipping the Okta login page, you can use OWIN which should make your life easier. It has an AuthenticationMode property that you can set to AuthenticationMode.Passive, so it wouldn’t try to authenticate to Okta immediately.
Hi,
Yes i am using LDAP for login, but no sample given in okta solution guide.
In some example Redirect URI definition is not mentioned and some example some endpoints are missing.
Please help me to share full fledged example code with OWIN.
If you are using the tokenservice in my example, you also have a class called OktaToken, this is where I map the json you just posted. If you add 2 more properties for refresh_token and id_token then you will also have it in an object. Originally I only return the access_token (in GetToken method, there you see it return token.access_token or something like that). Instead of doing that you can also just return the entire OktaToken object and take out whatever you need in your method.
If you got above json, you basically authenticated the user…
The easiest option is to use implicit flow for ASP.net (not authorization code), less secure but that is only available for the older framework
I understand the above, but what is the best way to Authenticate with okta via LDAP login.
Scenario: User login via LDAp in the system , after loggedin hit the application URL and then authenticate the user with okta at backend with OIDC and show the main application infront of user.
Okta supports delegathed authentication for LDAP. If you set that up a user can login using his LDAP credentials from the okta login screen and he will be authenticated. No fancy setup needed, the flow works exactly the same as a normal login but behind the screens okta will check the credentials with LDAP.
But forgot all the things, first of all just focus on our “client” application.
List item
Only need to display user information which is getting in “access token” after authorization.
List item
As per below your comment"
“The cool thing is that you can start using claim based protection. This also ensures you have SSO. Once you have an Okta session, Okta will keep sending you access tokens so the user is not prompted with a login screen everytime.”
I also want that user is not prompted okta login page again and again.