This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Setting up authentication with Okta
Ryan Newington edited this page Jul 7, 2018
·
5 revisions
The following guide will assist you in configuring your application to use Okta for authentication.
- Open IIS Manager, expand the
Sites
list, and select the Lithnet LAPS web site you created at installation time. - In the app setting pane, click
Authentication
- Ensure
Anonymous authentication
is enabled, and all other options are disabled.
- Log into to the Okta admin console with administrative credentials, select
Applications
thenApplications
- Click
Add application
, thenCreate new app
- Select
Web
as the platform, andOpen ID Connect
as the sign on method - Enter
Lithnet LAPS
or another suitable application name and optionally provide a logo - For the login redirect URI, enter the base URL where your Lithnet LAPS Web app is hosted (eg https://laps.lithnet.local/)
- On the general settings page, click
Edit
- Select the
Implicit (Hybrid)
click box underClient acting on behalf of user
, and ensureAllow ID token with implicit grant type
is selected. ClickSave
. - Set the logout URL to your base URL, and append
/Home/LogOut
to the end of it (eghttps://laps.lithnet.local/Home/LogOut
) - Copy the
client ID
value for use later. You do not need theclient secret
. - Assign the appropriate users to the app
- Select
Directory
from the main menu bar, and selectProfile editor
. Find the Lithnet LAPS Web app in the list, and click theProfile
button - Click
Add attribute
and create a new attribute calledupn
, of data typestring
. Select both theattribute required
andUser personal
check boxes - Click the
Map attributes
button. Find the UPN value, and map it to the okta attribute that contains the Active Directory UPN (eg aduser.userPrincipalName)
- Open the
web.config
file in the root of the application folder. Ensure no otherowin:appStartup
key is present - Substitute the value for
oidc:ClientId
with theClient ID
obtained in step 7 above - Substitute the value for
oidc:RedirectUri
with the base URL of your application - Substitute the value for
oidc:Authority
for the URL of your Okta tenant
<add key="owin:appStartup" value="Lithnet.Laps.Web.Startup.ConfigureOpenIDConnect" />
<add key="oidc:ClientId" value="0oaffr1ov5sl3NXff7h0" />
<add key="oidc:RedirectUri" value="https://laps.lithnet.local/" />
<add key="oidc:Authority" value="https://lithnet.okta.com" />
For further security, you can modify your application sign-on policy to require multifactor authentication for the app