|
| 1 | + |
| 2 | +Getting Started With Okta |
| 3 | +========================= |
| 4 | + |
| 5 | +Okay, so you have been using Stormpath for a while and now you want to checkout out Okta. This guide will walk through |
| 6 | +setting up a new account, creating an API token, and everything else needed to get you up and running on Okta. |
| 7 | + |
| 8 | +Create an Okta Developer Account |
| 9 | +-------------------------------- |
| 10 | + |
| 11 | +1. Head on over to: https://www.okta.com/developer/signup/ |
| 12 | +2. Fill out the signup form, and click the "Get Started" button |
| 13 | +3. Within a few minutes you will get a conformation email |
| 14 | +4. Follow the instructions in the email to finish setting up your account |
| 15 | + |
| 16 | + |
| 17 | +Your Okta URLs |
| 18 | +-------------- |
| 19 | + |
| 20 | +When setting up a developer account, you end up with a couple URL: |
| 21 | +An admin console URL that looks something like this: |
| 22 | + |
| 23 | +https://dev-123456-admin.oktapreview.com/admin/getting-started |
| 24 | + |
| 25 | +Use this one to manually change organization settings, create users, or other general administrative work. The other URL looks similar, but is missing the `admin` part: |
| 26 | + |
| 27 | +https://dev-123456.oktapreview.com/ |
| 28 | + |
| 29 | +This is the one your yours could interact with, and will be the base URL for any API access. |
| 30 | + |
| 31 | +**Important:** The second URL (the non-admin one) is the one you will need to remember, you will use this one for API access. |
| 32 | + |
| 33 | +Setup your Okta 'Organization' |
| 34 | +------------------------------ |
| 35 | + |
| 36 | +### Create an Application |
| 37 | + |
| 38 | +1. Navigate to your Admin console: i.e. https://dev-123456-admin.oktapreview.com/admin/dashboard |
| 39 | +2. On the top menu click on 'Applications' |
| 40 | +3. Press the 'Add Application' button |
| 41 | +4. Press the 'Create New App' button |
| 42 | +5. On the 'Create a New Application Integration' popup fill select the following values, then press the 'Create' button |
| 43 | + - Platform - Native |
| 44 | + - Sign-on Method - OpenID Connect |
| 45 | +6. On the 'Create OpenID Connect Integration' page enter the following values, and press the 'Next' button |
| 46 | + - Application Name - 'My Test Application' |
| 47 | +7. Use `http://localhost:8080/client/callback` for the Redirect URI's, and press the 'Finish' button |
| 48 | +8. Your application has been created, but you still have a few settings to change. On the 'General' tab, click the 'Edit' button on the 'General Settings' panel |
| 49 | +9. Select the 'Refresh Token', and 'Resource Owner Password' checkboxes and click the 'Save' button |
| 50 | +10. Click the 'Edit' button on the 'Client Credentials' panel |
| 51 | +11. Select the 'Use Client Authentication' radio button, and press the 'Save' button |
| 52 | +12. Click on the 'Groups' tab |
| 53 | +13. Select the 'Assign' button in the 'Everyone' column, and press the 'Done' button |
| 54 | +14. Grab the ID portion of the URL of your browsers current page, for example: if my URL was: `https://dev-123456-admin.oktapreview.com/admin/app/oidc_client/instance/00icu81200icu812/#tab-groups` then `00icu81200icu812` would be your application's ID |
| 55 | + |
| 56 | +**Important:** You will need to remember your application's ID. |
| 57 | + |
| 58 | +### Create an Access Token |
| 59 | + |
| 60 | +1. Navigate to your Admin console: i.e. https://dev-123456-admin.oktapreview.com/admin/dashboard |
| 61 | +2. On the top menu click on 'Security' -> 'API' |
| 62 | +3. Select the 'Tokens' tab |
| 63 | +4. Press the 'Create Token' button |
| 64 | +5. On the popup, give your new token a name, for example: 'My Test Token', and press the 'Create Token' button |
| 65 | + |
| 66 | +**Important:** You will need to remember this token value, so copy/paste it somewhere safe. |
| 67 | + |
| 68 | +For more information take a look at the official [Create an API token](http://developer.okta.com/docs/api/getting_started/getting_a_token.html) guide. |
| 69 | + |
| 70 | + |
| 71 | +Run an Example Application |
| 72 | +-------------------------- |
| 73 | + |
| 74 | +Since you are reading this page on Github, I'm going to assume you know how to clone this repo, and switch to the `okta` branch, once you have done that, build the current SNAPSHOT with Apache Maven. |
| 75 | + |
| 76 | +/Users/briandemers/dev/source/stormpath/stormpath-sdk-java |
| 77 | + |
| 78 | +``` bash |
| 79 | +$ mvn clean install |
| 80 | +``` |
| 81 | + |
| 82 | +This should not take more then a couple minutes. |
| 83 | + |
| 84 | +Once complete change directories to examples/spring-boot-default |
| 85 | + |
| 86 | +``` bash |
| 87 | +$ cd examples/spring-boot-default |
| 88 | +``` |
| 89 | + |
| 90 | +The last step before running our example is to set your configuration variables, there are a [few different ways](https://docs.stormpath.com/java/servlet-plugin/config.html) you can do this, but I'll just use environment variables here. |
| 91 | + |
| 92 | +``` bash |
| 93 | +$ export STORMPATH_CLIENT_BASEURL=[baseurl_from_above] |
| 94 | +$ export OKTA_APPLICATION_ID=[aapplication_id_from_above] |
| 95 | +$ export OKTA_API_TOKEN=[api_token_from_above] |
| 96 | +``` |
| 97 | + |
| 98 | +Start it up! |
| 99 | + |
| 100 | +``` bash |
| 101 | +$ mvn spring-boot:run |
| 102 | +``` |
| 103 | + |
| 104 | +Point your browser to: http://localhost:8080 and start using the example application! |
| 105 | + |
0 commit comments