{"id":7765,"date":"2023-07-06T12:37:43","date_gmt":"2023-07-06T07:07:43","guid":{"rendered":"https:\/\/innovationm.co\/?p=7765"},"modified":"2023-07-06T12:37:43","modified_gmt":"2023-07-06T07:07:43","slug":"2f-authentication-with-google-authenticator-in-spring-boot","status":"publish","type":"post","link":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/","title":{"rendered":"2F Authentication with Google Authenticator in Spring Boot"},"content":{"rendered":"<p>In today&#8217;s digital world, security is a major concern, and 2-factor authentication (2FA) is one way to increase security. 2FA adds an extra layer of protection to your account by requiring users to provide two forms of authentication to access it. This usually includes something the user knows (such as a password) and something they have (such as a physical device). In this blog post, we will discuss how to implement 2FA in a Spring Boot application using Google Authenticator, a popular app that generates one-time codes.<\/p>\n<p>To implement 2FA in Spring Boot with Google Authenticator, we need to add the following dependencies in your <strong>`pom.xml<\/strong>` or <strong>`build.gradle` <\/strong>file :<\/p>\n<ul>\n<li><strong>`google-authenticator`<\/strong>: to generate and validate the TOTP codes.<\/li>\n<\/ul>\n<pre>&lt;dependency&gt;\r\n\r\n&lt;groupId&gt;com.warrenstrange&lt;\/groupId&gt;\r\n\r\n&lt;artifactId&gt;googleauth&lt;\/artifactId&gt;\r\n\r\n&lt;version&gt;1.4.0&lt;\/version&gt;\r\n\r\n&lt;\/dependency&gt;<\/pre>\n<ul>\n<li><strong>`zxing-core`<\/strong>: to generate QR codes.<\/li>\n<\/ul>\n<pre>&lt;dependency&gt;\r\n\r\n&lt;groupId&gt;com.google.zxing&lt;\/groupId&gt;\r\n\r\n&lt;artifactId&gt;core&lt;\/artifactId&gt;\r\n\r\n&lt;version&gt;3.3.0&lt;\/version&gt;\r\n\r\n&lt;\/dependency&gt;\r\n\r\n&lt;dependency&gt;\r\n\r\n&lt;groupId&gt;com.google.zxing&lt;\/groupId&gt;\r\n\r\n&lt;artifactId&gt;javase&lt;\/artifactId&gt;\r\n\r\n&lt;version&gt;3.3.0&lt;\/version&gt;\r\n\r\n&lt;\/dependency&gt;<\/pre>\n<p>Next, We need to configure Google Authenticator to create the Google Authenticator bean:<\/p>\n<pre>import com.warrenstrange.googleauth.GoogleAuthenticator; import lombok.RequiredArgsConstructor;\r\n\r\nimport org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;<\/pre>\n<pre>@Configuration\r\n\r\n@RequiredArgsConstructor\r\n\r\npublic class CustomGoogleAuthenticatorConfig { private final CredentialRepository credentialRepository;\r\n\r\n@Bean\r\n\r\npublic GoogleAuthenticator gAuth() {\r\n\r\nGoogleAuthenticator googleAuthenticator = new\r\n\r\nGoogleAuthenticator();\r\n\r\ngoogleAuthenticator.setCredentialRepository(credentialReposit ory);\r\n\r\nreturn googleAuthenticator;\r\n\r\n}\r\n\r\n}<\/pre>\n<p>Now, we have to implement ICredentialRepository for persisting keys for users. It contains two methods i.e. <strong><em>saveUserCredentials <\/em><\/strong>and <strong><em>getSecretKey. <\/em><\/strong>Below is the simple implementation :<\/p>\n<pre>import com.warrenstrange.googleauth.ICredentialRepository; import lombok.AllArgsConstructor;\r\n\r\nimport lombok.Data;\r\n\r\nimport lombok.NoArgsConstructor;\r\n\r\nimport org.springframework.stereotype.Component;\r\n\r\nimport java.util.HashMap;\r\n\r\nimport java.util.List;\r\n\r\nimport java.util.Map;\r\n\r\n@Component\r\n\r\npublic class CredentialRepository implements ICredentialRepository {\r\n\r\nprivate final Map&lt;String, UserTOTP&gt; usersKeys = new HashMap&lt;String, UserTOTP&gt;();\r\n\r\n@Override\r\n\r\npublic String getSecretKey(String userName) { return usersKeys.get(userName).getSecretKey(); }\r\n\r\n@Override\r\n\r\npublic void saveUserCredentials(String userName, String secretKey,\r\n\r\nint validationCode,\r\n\r\nList&lt;Integer&gt;\r\n\r\nscratchCodes) {\r\n\r\nusersKeys.put(userName, new UserTOTP(userName, secretKey, validationCode, scratchCodes)); }\r\n\r\npublic UserTOTP getUser(String username) { return usersKeys.get(username);\r\n\r\n}\r\n\r\n@Data\r\n\r\n@NoArgsConstructor\r\n\r\n@AllArgsConstructor\r\n\r\nclass UserTOTP {\r\n\r\nprivate String username;\r\n\r\nprivate String secretKey;\r\n\r\nprivate int validationCode;\r\n\r\nprivate List&lt;Integer&gt; scratchCodes;\r\n\r\n}\r\n\r\n}<\/pre>\n<p>Now, let&#8217;s create a controller for generating and verifying code :<\/p>\n<pre>import com.fAuth.models.ValidateCodeDto;\r\n\r\nimport com.fAuth.models.Validation;\r\n\r\nimport com.google.zxing.BarcodeFormat;\r\n\r\nimport com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.common.BitMatrix;\r\n\r\nimport com.google.zxing.qrcode.QRCodeWriter;\r\n\r\nimport com.warrenstrange.googleauth.GoogleAuthenticator; import com.warrenstrange.googleauth.GoogleAuthenticatorKey; import\r\n\r\ncom.warrenstrange.googleauth.GoogleAuthenticatorQRGenerator; import lombok.RequiredArgsConstructor;\r\n\r\nimport lombok.SneakyThrows;\r\n\r\nimport lombok.extern.slf4j.Slf4j;\r\n\r\nimport org.springframework.web.bind.annotation.*;\r\n\r\nimport javax.servlet.ServletOutputStream;\r\n\r\nimport javax.servlet.http.HttpServletResponse;\r\n\r\n@Slf4j\r\n\r\n@RestController\r\n\r\n@RequiredArgsConstructor\r\n\r\n@RequestMapping(\"\/code\")\r\n\r\npublic class CodeController {\r\n\r\nprivate final GoogleAuthenticator gAuth;\r\n\r\n@SneakyThrows\r\n\r\n@GetMapping(\"\/generate\/{username}\")\r\n\r\npublic void generate(@PathVariable String username, HttpServletResponse response) {\r\n\r\nfinal GoogleAuthenticatorKey key =\r\n\r\ngAuth.createCredentials(username);\r\n\r\n\/\/I've decided to generate QRCode on backend site QRCodeWriter qrCodeWriter = new QRCodeWriter();\r\n\r\nString otpAuthURL =\r\n\r\nGoogleAuthenticatorQRGenerator.<em>getOtpAuthTotpURL<\/em>(\"my-demo\", username, key);\r\n\r\nBitMatrix bitMatrix = qrCodeWriter.encode(otpAuthURL, BarcodeFormat.<em>QR_CODE<\/em>, 200, 200);\r\n\r\n\/\/Simple writing to outputstream\r\n\r\nServletOutputStream outputStream =\r\n\r\nresponse.getOutputStream();\r\n\r\nMatrixToImageWriter.<em>writeToStream<\/em>(bitMatrix, \"PNG\", outputStream);\r\n\r\noutputStream.close();\r\n\r\n}\r\n\r\n@PostMapping(\"\/validate\/key\")\r\n\r\npublic Validation validateKey(@RequestBody ValidateCodeDto body) {\r\n\r\nreturn new\r\n\r\nValidation(gAuth.authorizeUser(body.getUserName(), body.getCode()));\r\n\r\n}\r\n\r\n}\r\n\r\nOnce everything is set up, the user will log in using their username and password as usual. After successful authentication, the user will be prompted to enter a one-time code generated by Google Authenticator. This code will be valid for only a short time (usually 30 seconds) and can only be used once.<\/pre>\n<p>Now, let\u2019s try to generate a QR code for Google Authenticator App<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone  wp-image-7766\" src=\"https:\/\/innovationm.co\/wp-content\/uploads\/2023\/07\/b1-300x165.png\" alt=\"\" width=\"333\" height=\"183\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/b1-300x165.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/b1.png 468w\" sizes=\"(max-width: 333px) 100vw, 333px\" \/><\/p>\n<p>Now, we have to scan this QR code with our GA app to get the code :<\/p>\n<p><img decoding=\"async\" class=\"alignnone  wp-image-7767\" src=\"https:\/\/innovationm.co\/wp-content\/uploads\/2023\/07\/b2-300x144.png\" alt=\"\" width=\"340\" height=\"163\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/b2-300x144.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/b2.png 468w\" sizes=\"(max-width: 340px) 100vw, 340px\" \/><\/p>\n<p>Now, let\u2019s validate the code :<\/p>\n<p><img decoding=\"async\" class=\"alignnone  wp-image-7768\" src=\"https:\/\/innovationm.co\/wp-content\/uploads\/2023\/07\/b3-300x144.png\" alt=\"\" width=\"327\" height=\"157\" srcset=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/b3-300x144.png 300w, https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/b3.png 468w\" sizes=\"(max-width: 327px) 100vw, 327px\" \/><\/p>\n<p>As we can see in the above screenshot, when we provide the code generated by the GA App and the email id, the API is validating the code and returns the response as true.<\/p>\n<p>Good work folks! We\u2019ve implemented 2 Factor Authentication with Google Authenticator, as you can see, it was fairly easy to do.<\/p>\n<p>In summary, 2FA is an important security measure that adds an extra layer of protection to your accounts. Spring Boot with Google Authenticator makes it easy to implement 2FA in your web applications. By adding two dependencies, configuring Spring Security, creating a custom authentication filter, and configuring Google Authenticator, you can secure your application and provide a safer user experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s digital world, security is a major concern, and 2-factor authentication (2FA) is one way to increase security. 2FA adds an extra layer of protection to your account by requiring users to provide two forms of authentication to access it. This usually includes something the user knows (such as a password) and something they [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7769,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[441],"tags":[104,884,722,885,279],"class_list":["post-7765","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot","tag-authentication","tag-authenticator","tag-blog","tag-google","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>2F Authentication with Google Authenticator in Spring Boot InnovationM - Blog<\/title>\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.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"2F Authentication with Google Authenticator in Spring Boot InnovationM - Blog\" \/>\n<meta property=\"og:description\" content=\"In today&#8217;s digital world, security is a major concern, and 2-factor authentication (2FA) is one way to increase security. 2FA adds an extra layer of protection to your account by requiring users to provide two forms of authentication to access it. This usually includes something the user knows (such as a password) and something they [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/\" \/>\n<meta property=\"og:site_name\" content=\"InnovationM - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-06T07:07:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1689\" \/>\n\t<meta property=\"og:image:height\" content=\"950\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"InnovationM Admin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InnovationM Admin\" \/>\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.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/\"},\"author\":{\"name\":\"InnovationM Admin\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"headline\":\"2F Authentication with Google Authenticator in Spring Boot\",\"datePublished\":\"2023-07-06T07:07:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/\"},\"wordCount\":332,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png\",\"keywords\":[\"Authentication\",\"authenticator\",\"blog\",\"google\",\"Spring Boot\"],\"articleSection\":[\"Spring Boot\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/\",\"name\":\"2F Authentication with Google Authenticator in Spring Boot InnovationM - Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png\",\"datePublished\":\"2023-07-06T07:07:43+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png\",\"contentUrl\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png\",\"width\":1689,\"height\":950},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/2f-authentication-with-google-authenticator-in-spring-boot\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"2F Authentication with Google Authenticator in Spring Boot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/\",\"name\":\"InnovationM - Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/#\\\/schema\\\/person\\\/a831bf4602d69d1fa452e3de0c8862ed\",\"name\":\"InnovationM Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g\",\"caption\":\"InnovationM Admin\"},\"sameAs\":[\"http:\\\/\\\/www.innovationm.com\\\/\"],\"url\":\"https:\\\/\\\/www.innovationm.com\\\/blog\\\/author\\\/innovationmadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"2F Authentication with Google Authenticator in Spring Boot InnovationM - Blog","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.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/","og_locale":"en_US","og_type":"article","og_title":"2F Authentication with Google Authenticator in Spring Boot InnovationM - Blog","og_description":"In today&#8217;s digital world, security is a major concern, and 2-factor authentication (2FA) is one way to increase security. 2FA adds an extra layer of protection to your account by requiring users to provide two forms of authentication to access it. This usually includes something the user knows (such as a password) and something they [&hellip;]","og_url":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/","og_site_name":"InnovationM - Blog","article_published_time":"2023-07-06T07:07:43+00:00","og_image":[{"width":1689,"height":950,"url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png","type":"image\/png"}],"author":"InnovationM Admin","twitter_misc":{"Written by":"InnovationM Admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#article","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/"},"author":{"name":"InnovationM Admin","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"headline":"2F Authentication with Google Authenticator in Spring Boot","datePublished":"2023-07-06T07:07:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/"},"wordCount":332,"commentCount":0,"image":{"@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png","keywords":["Authentication","authenticator","blog","google","Spring Boot"],"articleSection":["Spring Boot"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/","url":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/","name":"2F Authentication with Google Authenticator in Spring Boot InnovationM - Blog","isPartOf":{"@id":"https:\/\/www.innovationm.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#primaryimage"},"image":{"@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#primaryimage"},"thumbnailUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png","datePublished":"2023-07-06T07:07:43+00:00","author":{"@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed"},"breadcrumb":{"@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#primaryimage","url":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png","contentUrl":"https:\/\/www.innovationm.com\/blog\/wp-content\/uploads\/2023\/07\/2F-Authentication-with-Google-Authenticator-in-Spring-Boot.png","width":1689,"height":950},{"@type":"BreadcrumbList","@id":"https:\/\/www.innovationm.com\/blog\/2f-authentication-with-google-authenticator-in-spring-boot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.innovationm.com\/blog\/"},{"@type":"ListItem","position":2,"name":"2F Authentication with Google Authenticator in Spring Boot"}]},{"@type":"WebSite","@id":"https:\/\/www.innovationm.com\/blog\/#website","url":"https:\/\/www.innovationm.com\/blog\/","name":"InnovationM - Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.innovationm.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.innovationm.com\/blog\/#\/schema\/person\/a831bf4602d69d1fa452e3de0c8862ed","name":"InnovationM Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c99d9eece9dfbc82297cf34ddd58e9fe05bb52fe66c8f6bf6c0a45bfb6d7629?s=96&r=g","caption":"InnovationM Admin"},"sameAs":["http:\/\/www.innovationm.com\/"],"url":"https:\/\/www.innovationm.com\/blog\/author\/innovationmadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/7765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/comments?post=7765"}],"version-history":[{"count":0,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/posts\/7765\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media\/7769"}],"wp:attachment":[{"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/media?parent=7765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/categories?post=7765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.innovationm.com\/blog\/wp-json\/wp\/v2\/tags?post=7765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}