Skip to content

laura-rodriguez/okta-maui-sample-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

okta-maui-sample-app

A MAUI sample application that uses Okta for authentication

Getting Started

  1. Create an Okta account, also know as an organization, see Developer Signup.
  2. In your Okta Developer Console add an application; follow the directions at Set up your Application and accept the defaults.
  3. In your Okta Developer Console register your application's login and logout redirect callbacks, see Register Redirects.
  4. Configure your application to use the values registered in the previous step, see Configure Your Application
  5. Go to Visual Studio (I used VS 2022 Community Edition) and update the OktaClientConfiguration settings with your application details in the MauiProgram.cs:
var oktaClientConfiguration = new Okta.OktaClientConfiguration()
        {
            // Use "https://myOktaDomain.com/oauth2/default" for the "default" authorization server, or
            // "https://myOktaDomain.com/oauth2/<MyCustomAuthorizationServerId>"
            OktaDomain = "https://myOktaDomain.com", 
            ClientId = "<MyClientId>",
            RedirectUri = "myapp://callback",
            Browser = new WebBrowserAuthenticator()
        };
  1. Start an Android emulator of your choice.

Note: This sample only implements the Android platform. You can go ahead and add the bits corresponding to the platform you want to try.

Register Redirects

To register redirect URIs do the following:

  1. Sign in to your Okta Developer Console as an administrator.
  2. Click the Applications tab and select your application. If you need to set up your application see Set up your Application.
  3. Ensure you are on the General tab, then go to General Settings and click Edit.
  4. Go to the Login section.
  5. Below Login redirect URIs click the Add URI button.
  6. Enter a value appropriate for your application, this example uses the following:
    myApp://callback
    
  7. Below Logout redirect URIs click the Add URI button.
  8. Enter a value appropriate for your application, this example uses the following:
    myapp://callback
    
  9. Click Save.

About

A MAUI sample application that uses Okta for authentication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages