Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laura-rodriguez/okta-maui-sample-app
A MAUI sample application that uses Okta for authentication
https://github.com/laura-rodriguez/okta-maui-sample-app
Last synced: 28 days ago
JSON representation
A MAUI sample application that uses Okta for authentication
- Host: GitHub
- URL: https://github.com/laura-rodriguez/okta-maui-sample-app
- Owner: laura-rodriguez
- License: apache-2.0
- Created: 2023-04-05T18:58:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-05T19:41:39.000Z (almost 2 years ago)
- Last Synced: 2024-12-12T11:15:12.225Z (28 days ago)
- Language: C#
- Size: 158 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://developer.okta.com/signup/).
2. In your `Okta Developer Console` add an application; follow the directions at [Set up your Application](https://developer.okta.com/docs/guides/implement-auth-code-pkce/setup-app/) and accept the defaults.
3. In your `Okta Developer Console` register your application's login and logout redirect callbacks, see [Register Redirects](#register-redirects).
4. Configure your application to use the values registered in the previous step, see [Configure Your Application](#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`:```csharp
var oktaClientConfiguration = new Okta.OktaClientConfiguration()
{
// Use "https://myOktaDomain.com/oauth2/default" for the "default" authorization server, or
// "https://myOktaDomain.com/oauth2/"
OktaDomain = "https://myOktaDomain.com",
ClientId = "",
RedirectUri = "myapp://callback",
Browser = new WebBrowserAuthenticator()
};```
6. 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](https://developer.okta.com/docs/guides/implement-auth-code-pkce/setup-app/).
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`.