{"action":"created","comment":{"url":"https://api.github.com/repos/okta/okta.github.io/pulls/comments/121811813","pull_request_review_id":43871069,"id":121811813,"diff_hunk":"@@ -0,0 +1,816 @@\n+---\n+layout: blog_post\n+title: 'Add Authentication to Your Angular PWA'\n+author: mraible\n+tags: [pwa, progressive web app, angular, typescript, oidc, spring boot, java]\n+---\n+\n+You're developing a Progressive Web Application (PWA) and your service worker and web app manifest are working swimmingly. You've even taken the time to deploy it to a server with HTTPS and you're feeling pretty good about  things. But wait, you don't have any way of knowing who your users are! Don't you want to provide them with an opportunity to authenticate and tell you who they are? Once you know who they are, you can give them all kinds of personalization options, inspire them to ❤️ your app, and maybe even support your work!\n+\n+In this article, I'll show you how you can lock down a Spring Boot app, then use modern authentication protocol, in this case OpenID Connect (OIDC), to authenticate and gain access to its APIs. \n+\n+## Secure Your Spring Boot App\n+\n+You might've heard that [Stormpath joined forces with Okta](https://www.okta.com/blog/2017/03/stormpath-welcome-to-Okta/) a few months ago (February 2017). Since the transition, we've been working hard to make the Stormpath SDKs work with Okta's API. The good news is we've made great progress! \n+\n+In this example, you'll use a Stormpath's Spring Boot Starter to add security to a Spring Boot app. I'll show you how this starter provides functionality such as login, forgot password, and user registration. \n+\n+Then I'll show you how you can use OIDC and Okta's Auth SDK in an Angular app to login and get data from the Spring Boot app. Finally, I'll show how Stormpath's Angular SDK has similar functionality to the Spring Boot Starter, providing login, user registration, and forgot password features.\n+\n+I recently created a Sping Boot app that provides a list of good beers, based on a pre-populated list. It filters out less-than-great beers and displays them in an Angular UI that displays the first animated GIF (from Giphy) that matches the beer name.\n+\n+Let's get started! \n+\n+Rather than building Spring Boot and Angular applications from scratch, you can clone an existing GitHub project to get you going quickly.\n+\n+```\n+git clone https://github.com/oktadeveloper/spring-boot-angular-pwa-example.git\n+```\n+\n+If you'd prefer to build this application yourself, please read [Build Your First Progressive Web Application with Angular and Spring Boot](https://developer.okta.com/blog/2017/05/09/progressive-web-applications-with-angular-and-spring-boot).\n+\n+In this project's `server/pom.xml` file, you'll need to add the following XML:\n+\n+```xml\n+<properties>\n+    <stormpath.version>2.0.0-okta-rc2</stormpath.version>\n+</properties>\n+\n+<dependencies>\n+    ...\n+    <dependency>\n+        <groupId>com.stormpath.spring</groupId>\n+        <artifactId>stormpath-default-spring-boot-starter</artifactId>\n+    </dependency>\n+</dependencies>\n+\n+<dependencyManagement>\n+    <dependencies>\n+        <dependency>\n+            <groupId>com.stormpath.sdk</groupId>\n+            <artifactId>stormpath-bom</artifactId>\n+            <version>${stormpath.version}</version>\n+            <type>pom</type>\n+            <scope>import</scope>\n+        </dependency>\n+    </dependencies>\n+</dependencyManagement>\n+```\n+\n+## Get Started with Okta\n+ \n+To begin, you'll need to create an Okta Developer account. This account is free forever and provides the complete Okta Identity Platform for up to 3 applications and 100 users.\n+\n+1. Head on over to <https://www.okta.com/developer/signup>\n+2. Fill out the signup form, and click \"Get Started\"\n+3. Within a few minutes you'll get a confirmation email, follow the instructions in the email to finish setting up your account\n+\n+Once you're set up you'll receive a couple URLs. The first is an admin console URL that looks something like this: \n+\n+https://dev-123456-admin.oktapreview.com/admin/getting-started\n+\n+Use this one to manually change organization settings, create users, or other general administrative work.  \n+\n+The other URL looks similar, but is missing the `admin` part: \n+\n+https://dev-123456.oktapreview.com/\n+\n+This is the one your users could interact with, and will be the base URL for any API access.\n+\n+**Important:** The second URL (the non-admin one) is the one you will need to remember, you will use this URL for API access.\n+ \n+To setup your Okta account for Spring Boot, you'll first need to create an application. \n+\n+### Create an Application\n+\n+1. Navigate to your Admin console: i.e. https://dev-123456-admin.oktapreview.com/admin/dashboard\n+2. On the top menu click on **Applications**\n+3. Click **Add Application**\n+4. Click **Create New App**\n+5. On the *Create a New Application Integration* popup, select the following values, then click **Create**\n+    - Platform - Native\n+    - Sign-on Method - OpenID Connect\n+6. On the *Create OpenID Connect Integration* page, enter the following value, then click **Next**\n+    - Application Name - Spring Boot Awesomesauce\n+7. Use `http://localhost:8080/client/callback` for the Redirect URI's, and click **Finish**\n+\n+Your application has been created, but you still have a few settings to change. \n+\n+1. On the *General* tab, click **Edit** on the **General Settings** panel\n+2. Check the *Refresh Token*, and *Resource Owner Password* checkboxes click **Save**\n+3. Click **Edit** on the Client Credentials panel\n+4. Select the *Use Client Authentication* radio button, and click the **Save** button \n+5. Click on the *Assignments* tab and then select the *Assign* button and **Assign to Groups**\n+6. Select the *Assign* button in the *Everyone* column, and click the **Done** button\n+7. 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-assignments` then `00icu81200icu812` is my application's ID","path":"_source/_posts/2017-06-13-add-authentication-angular-pwa.md","position":105,"original_position":105,"commit_id":"13116c7852c013469f6a8dfa8dce456607f90464","original_commit_id":"13116c7852c013469f6a8dfa8dce456607f90464","user":{"login":"mraible","id":17892,"avatar_url":"https://avatars0.githubusercontent.com/u/17892?v=3","gravatar_id":"","url":"https://api.github.com/users/mraible","html_url":"https://github.com/mraible","followers_url":"https://api.github.com/users/mraible/followers","following_url":"https://api.github.com/users/mraible/following{/other_user}","gists_url":"https://api.github.com/users/mraible/gists{/gist_id}","starred_url":"https://api.github.com/users/mraible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mraible/subscriptions","organizations_url":"https://api.github.com/users/mraible/orgs","repos_url":"https://api.github.com/users/mraible/repos","events_url":"https://api.github.com/users/mraible/events{/privacy}","received_events_url":"https://api.github.com/users/mraible/received_events","type":"User","site_admin":false},"body":"I'm cool with this change, @lindsaybrunner-okta WDYT?","created_at":"2017-06-13T22:21:13Z","updated_at":"2017-06-13T22:21:13Z","html_url":"https://github.com/okta/okta.github.io/pull/945#discussion_r121811813","pull_request_url":"https://api.github.com/repos/okta/okta.github.io/pulls/945","_links":{"self":{"href":"https://api.github.com/repos/okta/okta.github.io/pulls/comments/121811813"},"html":{"href":"https://github.com/okta/okta.github.io/pull/945#discussion_r121811813"},"pull_request":{"href":"https://api.github.com/repos/okta/okta.github.io/pulls/945"}}},"pull_request":{"url":"https://api.github.com/repos/okta/okta.github.io/pulls/945","id":125428688,"html_url":"https://github.com/okta/okta.github.io/pull/945","diff_url":"https://github.com/okta/okta.github.io/pull/945.diff","patch_url":"https://github.com/okta/okta.github.io/pull/945.patch","issue_url":"https://api.github.com/repos/okta/okta.github.io/issues/945","number":945,"state":"closed","locked":false,"title":"Blog post: Add Authentication to Your Angular PWA","user":{"login":"mraible","id":17892,"avatar_url":"https://avatars0.githubusercontent.com/u/17892?v=3","gravatar_id":"","url":"https://api.github.com/users/mraible","html_url":"https://github.com/mraible","followers_url":"https://api.github.com/users/mraible/followers","following_url":"https://api.github.com/users/mraible/following{/other_user}","gists_url":"https://api.github.com/users/mraible/gists{/gist_id}","starred_url":"https://api.github.com/users/mraible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mraible/subscriptions","organizations_url":"https://api.github.com/users/mraible/orgs","repos_url":"https://api.github.com/users/mraible/repos","events_url":"https://api.github.com/users/mraible/events{/privacy}","received_events_url":"https://api.github.com/users/mraible/received_events","type":"User","site_admin":false},"body":"## Description:\r\n\r\nBlog post: Add Authentication to Your Angular PWA\r\n\r\n## Type of Pull Request:\r\n- [ ] Content (Documentation updates or typo-fixes)\r\n- [x] Blog Post\r\n- [ ] Functional (CSS changes, JS updates, or layout modifications)\r\n\r\n## How Has This Been Tested?\r\n- [x] I have built this locally and verified that it does not break existing functionality.\r\n- [ ] For functional changes, I have tested against Chrome, Firefox, and Safari, and mobile.\r\n- [ ] For functional changes, I have added tests.\r\n\r\n## Primary Reviewers:\r\n\r\nDevBlog team + DevEx \r\n\r\n- @bdemers, @lindsaybrunner-okta \r\n\r\n<!--- For Blog posts, add the Google Docs link below -->\r\n- [Blog Post Markdown](https://github.com/oktadeveloper/okta-spring-boot-angular-pwa-example/blob/master/TUTORIAL.md)\r\n","created_at":"2017-06-13T18:18:01Z","updated_at":"2017-06-13T22:21:13Z","closed_at":"2017-06-13T19:31:54Z","merged_at":"2017-06-13T19:31:54Z","merge_commit_sha":"97ffe893e2d63e8478cd669f18620d5452e6f86c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/okta/okta.github.io/pulls/945/commits","review_comments_url":"https://api.github.com/repos/okta/okta.github.io/pulls/945/comments","review_comment_url":"https://api.github.com/repos/okta/okta.github.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/okta/okta.github.io/issues/945/comments","statuses_url":"https://api.github.com/repos/okta/okta.github.io/statuses/13116c7852c013469f6a8dfa8dce456607f90464","head":{"label":"mraible:pwa-auth","ref":"pwa-auth","sha":"13116c7852c013469f6a8dfa8dce456607f90464","user":{"login":"mraible","id":17892,"avatar_url":"https://avatars0.githubusercontent.com/u/17892?v=3","gravatar_id":"","url":"https://api.github.com/users/mraible","html_url":"https://github.com/mraible","followers_url":"https://api.github.com/users/mraible/followers","following_url":"https://api.github.com/users/mraible/following{/other_user}","gists_url":"https://api.github.com/users/mraible/gists{/gist_id}","starred_url":"https://api.github.com/users/mraible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mraible/subscriptions","organizations_url":"https://api.github.com/users/mraible/orgs","repos_url":"https://api.github.com/users/mraible/repos","events_url":"https://api.github.com/users/mraible/events{/privacy}","received_events_url":"https://api.github.com/users/mraible/received_events","type":"User","site_admin":false},"repo":{"id":85240755,"name":"okta.github.io","full_name":"mraible/okta.github.io","owner":{"login":"mraible","id":17892,"avatar_url":"https://avatars0.githubusercontent.com/u/17892?v=3","gravatar_id":"","url":"https://api.github.com/users/mraible","html_url":"https://github.com/mraible","followers_url":"https://api.github.com/users/mraible/followers","following_url":"https://api.github.com/users/mraible/following{/other_user}","gists_url":"https://api.github.com/users/mraible/gists{/gist_id}","starred_url":"https://api.github.com/users/mraible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mraible/subscriptions","organizations_url":"https://api.github.com/users/mraible/orgs","repos_url":"https://api.github.com/users/mraible/repos","events_url":"https://api.github.com/users/mraible/events{/privacy}","received_events_url":"https://api.github.com/users/mraible/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mraible/okta.github.io","description":"Okta Identity Platform API Docs and Developer Home","fork":true,"url":"https://api.github.com/repos/mraible/okta.github.io","forks_url":"https://api.github.com/repos/mraible/okta.github.io/forks","keys_url":"https://api.github.com/repos/mraible/okta.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mraible/okta.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mraible/okta.github.io/teams","hooks_url":"https://api.github.com/repos/mraible/okta.github.io/hooks","issue_events_url":"https://api.github.com/repos/mraible/okta.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/mraible/okta.github.io/events","assignees_url":"https://api.github.com/repos/mraible/okta.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/mraible/okta.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/mraible/okta.github.io/tags","blobs_url":"https://api.github.com/repos/mraible/okta.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mraible/okta.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mraible/okta.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/mraible/okta.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mraible/okta.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/mraible/okta.github.io/languages","stargazers_url":"https://api.github.com/repos/mraible/okta.github.io/stargazers","contributors_url":"https://api.github.com/repos/mraible/okta.github.io/contributors","subscribers_url":"https://api.github.com/repos/mraible/okta.github.io/subscribers","subscription_url":"https://api.github.com/repos/mraible/okta.github.io/subscription","commits_url":"https://api.github.com/repos/mraible/okta.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/mraible/okta.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/mraible/okta.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/mraible/okta.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/mraible/okta.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/mraible/okta.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mraible/okta.github.io/merges","archive_url":"https://api.github.com/repos/mraible/okta.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mraible/okta.github.io/downloads","issues_url":"https://api.github.com/repos/mraible/okta.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/mraible/okta.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/mraible/okta.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/mraible/okta.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mraible/okta.github.io/labels{/name}","releases_url":"https://api.github.com/repos/mraible/okta.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/mraible/okta.github.io/deployments","created_at":"2017-03-16T20:54:33Z","updated_at":"2017-03-16T20:54:42Z","pushed_at":"2017-06-13T19:33:10Z","git_url":"git://github.com/mraible/okta.github.io.git","ssh_url":"git@github.com:mraible/okta.github.io.git","clone_url":"https://github.com/mraible/okta.github.io.git","svn_url":"https://github.com/mraible/okta.github.io","homepage":"http://developer.okta.com/","size":72744,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"okta:master","ref":"master","sha":"edf68f9cf74e299a50803f68a84c5a0cf4bf851f","user":{"login":"okta","id":362460,"avatar_url":"https://avatars2.githubusercontent.com/u/362460?v=3","gravatar_id":"","url":"https://api.github.com/users/okta","html_url":"https://github.com/okta","followers_url":"https://api.github.com/users/okta/followers","following_url":"https://api.github.com/users/okta/following{/other_user}","gists_url":"https://api.github.com/users/okta/gists{/gist_id}","starred_url":"https://api.github.com/users/okta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okta/subscriptions","organizations_url":"https://api.github.com/users/okta/orgs","repos_url":"https://api.github.com/users/okta/repos","events_url":"https://api.github.com/users/okta/events{/privacy}","received_events_url":"https://api.github.com/users/okta/received_events","type":"Organization","site_admin":false},"repo":{"id":10953058,"name":"okta.github.io","full_name":"okta/okta.github.io","owner":{"login":"okta","id":362460,"avatar_url":"https://avatars2.githubusercontent.com/u/362460?v=3","gravatar_id":"","url":"https://api.github.com/users/okta","html_url":"https://github.com/okta","followers_url":"https://api.github.com/users/okta/followers","following_url":"https://api.github.com/users/okta/following{/other_user}","gists_url":"https://api.github.com/users/okta/gists{/gist_id}","starred_url":"https://api.github.com/users/okta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okta/subscriptions","organizations_url":"https://api.github.com/users/okta/orgs","repos_url":"https://api.github.com/users/okta/repos","events_url":"https://api.github.com/users/okta/events{/privacy}","received_events_url":"https://api.github.com/users/okta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/okta/okta.github.io","description":"Okta Identity Platform API Docs and Developer Home","fork":false,"url":"https://api.github.com/repos/okta/okta.github.io","forks_url":"https://api.github.com/repos/okta/okta.github.io/forks","keys_url":"https://api.github.com/repos/okta/okta.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okta/okta.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okta/okta.github.io/teams","hooks_url":"https://api.github.com/repos/okta/okta.github.io/hooks","issue_events_url":"https://api.github.com/repos/okta/okta.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/okta/okta.github.io/events","assignees_url":"https://api.github.com/repos/okta/okta.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/okta/okta.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/okta/okta.github.io/tags","blobs_url":"https://api.github.com/repos/okta/okta.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okta/okta.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okta/okta.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/okta/okta.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okta/okta.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/okta/okta.github.io/languages","stargazers_url":"https://api.github.com/repos/okta/okta.github.io/stargazers","contributors_url":"https://api.github.com/repos/okta/okta.github.io/contributors","subscribers_url":"https://api.github.com/repos/okta/okta.github.io/subscribers","subscription_url":"https://api.github.com/repos/okta/okta.github.io/subscription","commits_url":"https://api.github.com/repos/okta/okta.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/okta/okta.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/okta/okta.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/okta/okta.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/okta/okta.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/okta/okta.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okta/okta.github.io/merges","archive_url":"https://api.github.com/repos/okta/okta.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okta/okta.github.io/downloads","issues_url":"https://api.github.com/repos/okta/okta.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/okta/okta.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/okta/okta.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/okta/okta.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okta/okta.github.io/labels{/name}","releases_url":"https://api.github.com/repos/okta/okta.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/okta/okta.github.io/deployments","created_at":"2013-06-25T23:22:38Z","updated_at":"2017-06-07T18:07:48Z","pushed_at":"2017-06-13T22:18:23Z","git_url":"git://github.com/okta/okta.github.io.git","ssh_url":"git@github.com:okta/okta.github.io.git","clone_url":"https://github.com/okta/okta.github.io.git","svn_url":"https://github.com/okta/okta.github.io","homepage":"http://developer.okta.com/","size":75191,"stargazers_count":21,"watchers_count":21,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":16,"forks":67,"open_issues":16,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/okta/okta.github.io/pulls/945"},"html":{"href":"https://github.com/okta/okta.github.io/pull/945"},"issue":{"href":"https://api.github.com/repos/okta/okta.github.io/issues/945"},"comments":{"href":"https://api.github.com/repos/okta/okta.github.io/issues/945/comments"},"review_comments":{"href":"https://api.github.com/repos/okta/okta.github.io/pulls/945/comments"},"review_comment":{"href":"https://api.github.com/repos/okta/okta.github.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/okta/okta.github.io/pulls/945/commits"},"statuses":{"href":"https://api.github.com/repos/okta/okta.github.io/statuses/13116c7852c013469f6a8dfa8dce456607f90464"}}}}
{"actor":{"display_login":"mraible"}}