{"id":90847,"date":"2019-04-18T13:00:10","date_gmt":"2019-04-18T10:00:10","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=90847"},"modified":"2019-04-17T11:02:23","modified_gmt":"2019-04-17T08:02:23","slug":"integrate-spring-boot-application-cognito","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html","title":{"rendered":"Integrate Spring Boot Application with Amazon Cognito"},"content":{"rendered":"<p>In this article, we will show how to use <a href=\"https:\/\/aws.amazon.com\/cognito\/\">Amazon Cognito<\/a> service for authentication users in a Spring Boot application using the <a href=\"https:\/\/docs.spring.io\/spring-security\/site\/docs\/current\/reference\/html\/jc.html#oauth2login\">OAuth 2.0 client library introduced in Spring Security 5.0<\/a>.<\/p>\n<h2 class=\"wp-block-heading\">What is AWS Cognito?<\/h2>\n<p><a href=\"https:\/\/aws.amazon.com\/cognito\/\">Amazon Cognito<\/a> is service offered by AWS which provides user management services like sign up and sign in, in addition to providing support for granting credentials for accessing AWS services. It has its own identity provider in addition to integrating with identity providers like Facebook, Google, SAML, OpenId<\/p>\n<h2 class=\"wp-block-heading\">What\u2019s in It for Web Application Developers?<\/h2>\n<p>Web application developers (server side \/ single page applications) and even mobile application developers can off load user signup and authentication to Amazon Cognito and focus on implementing business requirements.<\/p>\n<p>Cognito supports features like multi factor authentication (MFA), email and phone number verification, password strength management. It also supports authentication with other identity providers like Facebook, Google and custom SAML integration where cognito acts as an adapter to integrate with them.<\/p>\n<p>So in short developers get to focus on business features and let AWS handle the user signup and authentication.<\/p>\n<h2 class=\"wp-block-heading\">Setting up Amazon Cognito<\/h2>\n<p>Cognito contains two main components:<\/p>\n<ul class=\"wp-block-list\">\n<li>User pools \u2013 which is used for user and identity management, managing application client details (i.e the clients which would use cognito for authentication)<\/li>\n<li>Identity pools \u2013 which is used for granting AWS credentials for accessing AWS services<\/li>\n<\/ul>\n<p>Let us configure user pool and also create an application client which we can use to connect with cognito.<\/p>\n<h3 class=\"wp-block-heading\">Creating user pool<\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image.png\" alt=\"Amazon Cognito\" class=\"wp-image-90870\" width=\"622\" height=\"233\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image.png 829w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-300x113.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-768x288.png 768w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\">Creating app client<\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-1-1.png\" alt=\"Amazon Cognito\" class=\"wp-image-90873\" width=\"622\" height=\"233\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-1-1.png 829w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-1-1-300x112.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-1-1-768x287.png 768w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\">Setting up app client<\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-2-1.png\" alt=\"Amazon Cognito\" class=\"wp-image-90874\" width=\"622\" height=\"206\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-2-1.png 829w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-2-1-300x99.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-2-1-768x254.png 768w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\">Setting up domain name for user pool<\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-5.png\" alt=\"Amazon Cognito\" class=\"wp-image-90875\" width=\"622\" height=\"209\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-5.png 829w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-5-300x101.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-5-768x258.png 768w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\">Creating test users<\/h3>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-7.png\" alt=\"Amazon Cognito\" class=\"wp-image-90876\" width=\"622\" height=\"212\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-7.png 829w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-7-300x102.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-7-768x261.png 768w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/figure>\n<\/div>\n<p>These were the few steps to follow to setup your Cognito user pool and application client.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2 class=\"wp-block-heading\">Configuring Spring Boot Application<\/h2>\n<p>We will make use of the OAuth client library included as part of Spring Security 5 and its <a href=\"https:\/\/docs.spring.io\/spring-boot\/docs\/current\/reference\/html\/boot-features-security.html#boot-features-security-oauth2\">integration with Spring Boot<\/a>.<\/p>\n<h3 class=\"wp-block-heading\">Update the pom.xml to Add OAuth Client Dependency<\/h3>\n<p>Add the following dependency to your <code><code>pom.xml<\/code><\/code> to be able to get grab the OAuth client library<\/p>\n<pre class=\"wp-block-preformatted brush:xml\">&lt;dependency&gt;\n\t&lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n\t&lt;artifactId&gt;spring-boot-starter-oauth2-client&lt;\/artifactId&gt;\n&lt;\/dependency&gt;<\/pre>\n<h3 class=\"wp-block-heading\">Add the properties related to OAuth client<\/h3>\n<p>We need to define some properties related to registering the OAuth provider and setting up the OAuth provider. The following properties need to be added:<\/p>\n<pre class=\"wp-block-preformatted brush:java\">app.url=http:\/\/localhost:9999\ncognito.rooturl=https:\/\/test-userpool.auth.eu-west-1.amazoncognito.com\nspring.security.oauth2.client.registration.cognito.provider=cognito\nspring.security.oauth2.client.registration.cognito.client-id=&lt;client-id&gt;\nspring.security.oauth2.client.registration.cognito.client-secret=&lt;client-secret&gt;\nspring.security.oauth2.client.registration.cognito.client-name=test-client\nspring.security.oauth2.client.registration.cognito.authorization-grant-type=authorization_code\nspring.security.oauth2.client.registration.cognito.scope=email,openid\nspring.security.oauth2.client.registration.cognito.redirect-uri-template=${app.url}\/login\/oauth2\/code\/cognito\n\nspring.security.oauth2.client.provider.cognito.authorizationUri=${cognito.rooturl}\/oauth2\/authorize\nspring.security.oauth2.client.provider.cognito.tokenUri=${cognito.rooturl}\/oauth2\/token\nspring.security.oauth2.client.provider.cognito.jwkSetUri=https:\/\/cognito-idp.eu-west-1.amazonaws.com\/eu-west-1_Mi1q5QPXa\/.well-known\/jwks.json\nspring.security.oauth2.client.provider.cognito.user-info-uri=${cognito.rooturl}\/oauth2\/userInfo\nspring.security.oauth2.client.provider.cognito.userNameAttribute=username<\/pre>\n<p>The JWK URI is built based on the guidelines given <a href=\"https:\/\/aws.amazon.com\/premiumsupport\/knowledge-center\/decode-verify-cognito-json-token\/\">here<\/a>.<\/p>\n<h3 class=\"wp-block-heading\">Creating an HTML Page to Show Authenticated User Detail<\/h3>\n<p>We have added an <code><code>index.html<\/code><\/code> to show the logged in user detail using <a href=\"https:\/\/github.com\/thymeleaf\/thymeleaf-extras-springsecurity\">Thymeleaf-Spring security<\/a> dialects as shown below:<\/p>\n<pre class=\"wp-block-preformatted brush:xml\">&lt;div class=\"container\"&gt;\n\t&lt;div class=\"row\"&gt;\n\t\t&lt;div class=\"col\"&gt;\n\t\t\tAuthenticated successfully as [[${#authentication.name}]]&lt;br\/&gt;\n\t\t\tPrincipal: [[${#authentication.principal}]]\n\t\t\t&lt;div&gt;\n\t\t\t\t&lt;a th:href=\"@{\/logout}\" class=\"btn btn-primary\"&gt;Logout&lt;\/a&gt;\n\t\t\t&lt;\/div&gt;\n\t\t&lt;\/div&gt;\n\t&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<h2 class=\"wp-block-heading\">Testing the Integration<\/h2>\n<p>Just run the main class and the application will start running on <a href=\"http:\/\/localhost:9999\/\" rel=\"nofollow\">http:\/\/localhost:9999\/<\/a>. On navigating to this URL you will redirected to Cognito for authentication and once successfully authenticated you will be taken to the application page which looks something like:<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-8.png\" alt=\"Amazon Cognito\" class=\"wp-image-90877\" width=\"622\" height=\"107\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-8.png 829w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-8-300x52.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2019\/04\/image-8-768x132.png 768w\" sizes=\"(max-width: 622px) 100vw, 622px\" \/><\/figure>\n<\/div>\n<p>The complete code for the app can be found <a href=\"https:\/\/github.com\/sanaulla123\/samples\/tree\/master\/aws-cognito-client-demo\">here<\/a>. In the subsequent posts we will look at customizing the Principal object, making use of the user info end point, roles management via Spring security and also look at how single page applications can leverage Cognito.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>\n<p>Published on Java Code Geeks with permission by Mohamed Sanaulla, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener noreferrer\">JCG program<\/a>. See the original article here: <a href=\"https:\/\/sanaulla.info\/2019\/04\/17\/integrate-spring-boot-application-with-amazon-cognito\/\" target=\"_blank\" rel=\"noopener noreferrer\">Integrate Spring Boot Application with Amazon Cognito<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will show how to use Amazon Cognito service for authentication users in a Spring Boot application using the OAuth 2.0 client library introduced in Spring Security 5.0. What is AWS Cognito? Amazon Cognito is service offered by AWS which provides user management services like sign up and sign in, in addition &hellip;<\/p>\n","protected":false},"author":24,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[854],"class_list":["post-90847","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Integrate Spring Boot Application with Amazon Cognito - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Interested to learn about Amazon Cognito? Check our article explaining how to use Amazon Cognito service for authentication users in a Spring application\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Integrate Spring Boot Application with Amazon Cognito - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Interested to learn about Amazon Cognito? Check our article explaining how to use Amazon Cognito service for authentication users in a Spring application\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-18T10:00:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mohamed Sanaulla\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mohamed Sanaulla\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html\"},\"author\":{\"name\":\"Mohamed Sanaulla\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d27ef53124d64097c81168263af5a7f7\"},\"headline\":\"Integrate Spring Boot Application with Amazon Cognito\",\"datePublished\":\"2019-04-18T10:00:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html\"},\"wordCount\":534,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring Boot\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html\",\"name\":\"Integrate Spring Boot Application with Amazon Cognito - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2019-04-18T10:00:10+00:00\",\"description\":\"Interested to learn about Amazon Cognito? Check our article explaining how to use Amazon Cognito service for authentication users in a Spring application\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2019\\\/04\\\/integrate-spring-boot-application-cognito.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Integrate Spring Boot Application with Amazon Cognito\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d27ef53124d64097c81168263af5a7f7\",\"name\":\"Mohamed Sanaulla\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/64131fe9e9472b8852abf595cbbf3a8a2a5e86569fa1349eed92b2a32f9104c1?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/64131fe9e9472b8852abf595cbbf3a8a2a5e86569fa1349eed92b2a32f9104c1?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/64131fe9e9472b8852abf595cbbf3a8a2a5e86569fa1349eed92b2a32f9104c1?s=96&d=mm&r=g\",\"caption\":\"Mohamed Sanaulla\"},\"sameAs\":[\"http:\\\/\\\/blog.sanaulla.info\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Mohamed-Sanaulla\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Integrate Spring Boot Application with Amazon Cognito - Java Code Geeks","description":"Interested to learn about Amazon Cognito? Check our article explaining how to use Amazon Cognito service for authentication users in a Spring application","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html","og_locale":"en_US","og_type":"article","og_title":"Integrate Spring Boot Application with Amazon Cognito - Java Code Geeks","og_description":"Interested to learn about Amazon Cognito? Check our article explaining how to use Amazon Cognito service for authentication users in a Spring application","og_url":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2019-04-18T10:00:10+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Mohamed Sanaulla","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Mohamed Sanaulla","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html"},"author":{"name":"Mohamed Sanaulla","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d27ef53124d64097c81168263af5a7f7"},"headline":"Integrate Spring Boot Application with Amazon Cognito","datePublished":"2019-04-18T10:00:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html"},"wordCount":534,"commentCount":5,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring Boot"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html","url":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html","name":"Integrate Spring Boot Application with Amazon Cognito - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2019-04-18T10:00:10+00:00","description":"Interested to learn about Amazon Cognito? Check our article explaining how to use Amazon Cognito service for authentication users in a Spring application","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2019\/04\/integrate-spring-boot-application-cognito.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Integrate Spring Boot Application with Amazon Cognito"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d27ef53124d64097c81168263af5a7f7","name":"Mohamed Sanaulla","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/64131fe9e9472b8852abf595cbbf3a8a2a5e86569fa1349eed92b2a32f9104c1?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/64131fe9e9472b8852abf595cbbf3a8a2a5e86569fa1349eed92b2a32f9104c1?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/64131fe9e9472b8852abf595cbbf3a8a2a5e86569fa1349eed92b2a32f9104c1?s=96&d=mm&r=g","caption":"Mohamed Sanaulla"},"sameAs":["http:\/\/blog.sanaulla.info"],"url":"https:\/\/www.javacodegeeks.com\/author\/Mohamed-Sanaulla"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/90847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=90847"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/90847\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=90847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=90847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=90847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}