Newb Question Doing POC with .Net (not Core)

I am trying to follow along with this example, https://developer.okta.com/code/dotnet/aspnet/

but it looks like I am not making a connection to my octa application. When I look at the dashboard, I’m not seeing a login, nor is the application being redirected to a registration url like I would have expected.

When I try and run the application from the github site, I get a similar issue, but it seems marginally more successful in that the dashboard is at least registering the invalid login attempt.

My guess is that the application is configured incorrectly in my dashboard due to my confusion.

What I am trying to achieve is a proof of concept where a login action on my MVC app to be redirected to a registration / login default form in the okta cloud.

The org url is https://dev-589491.oktapreview.com

Can you send me a link to your code (github repo, etc) and maybe take a screengrab of your application’s Settings screen?

As far as code is concerned, we don’t publicly publish our code. If you look at the github asp.net example and pull that code, that should be sufficient for that. If you can get a version of that code working against an app with same settings, then that should be enough to get me on my way.

Here is a link to the code in github. Note: you will have to restore packages as the code checked into github does not include the packages.

I assumed that if I gave the dev account, then someone from Okta would be able to navigate to those settings on their own.

Try this screen shot and see if this tells you enough…

Lee do you have any additional thoughts on this? I tried again using the samples (from scratch) and I still cannot get the samples to run. Fiddler is telling me that odtapreview.com is forcibly closing the connection

I was able to get the sample working. I just leave the default settings for the URLs (localhost:8080) the sample project was setup to run on that port. I set the “Logout redirect URIs” setting to:
http://localhost:8080/Account/PostLogout

the only other thing to check is that http://localhost:8080 is in your trusted origin: in the top menu: API => Trusted Origins and make sure that http://localhost:8080 is in that list (or add it if needed).

Set the values in the Web.Config:

<add key=“okta:ClientId” value="{My App’s Client ID}" />
<add key=“okta:ClientSecret” value="{My App’s Client Secret}" />
<add key=“okta:OktaDomain” value=“https://dev-12345.oktapreview.com” />
<!-- 2. Update the Okta application with these values -->
<add key=“okta:RedirectUri” value=“http://localhost:8080/authorization-code/callback” /> <add key=“okta:PostLogoutRedirectUri” value=“http://localhost:8080/Account/PostLogout” />

Your settings in the Okta Application General Settings look right.

As it turns out, I was able to get this working with a couple of tweaks to my application that I didn’t take into account.

I needed to refactor my existing login process, removing code asking for AntiForgeryTokens, I also needed to refactor places in the application where logging takes place.

And I figured out that package Okta.AspNet v1.1.3 has a hard dependency on IdentityModel 3.7.0. It didn’t like it whatsoever when I upgraded to IdentityModel 3.10.5.

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