Nothing to see here, move along.
6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /security/spring-boot-okta-demo/src/main/resources/templates/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 |Nothing to see here, move along.
12 | 13 | -------------------------------------------------------------------------------- /security/spring-boot-okta-demo/src/test/java/com/sivalabs/oktademo/SpringBootOktaDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.oktademo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootOktaDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /security/spring-boot-social-login/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | application-prod.properties 6 | secure.properties 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | 23 | ### NetBeans ### 24 | /nbproject/private/ 25 | /nbbuild/ 26 | /dist/ 27 | /nbdist/ 28 | /.nb-gradle/ 29 | /build/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /security/spring-boot-social-login/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sivaprasadreddy/spring-boot-tutorials/11b6fdbc89397122b61353c07c4b9eb34ee1a703/security/spring-boot-social-login/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /security/spring-boot-social-login/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /security/spring-boot-social-login/src/main/java/com/sivalabs/bookmarker/BookmarkerApplication.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarker; 2 | 3 | import com.sivalabs.bookmarker.config.BookmarkerProperties; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 7 | import org.springframework.cache.annotation.EnableCaching; 8 | import org.springframework.context.annotation.EnableAspectJAutoProxy; 9 | 10 | @SpringBootApplication 11 | @EnableConfigurationProperties(value = {BookmarkerProperties.class}) 12 | @EnableAspectJAutoProxy 13 | @EnableCaching 14 | public class BookmarkerApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(BookmarkerApplication.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /security/spring-boot-social-login/src/main/java/com/sivalabs/bookmarker/config/BookmarkerProperties.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarker.config; 2 | 3 | import lombok.Data; 4 | import org.springframework.boot.context.properties.ConfigurationProperties; 5 | 6 | @ConfigurationProperties(prefix = "bookmarker") 7 | @Data 8 | public class BookmarkerProperties { 9 | } 10 | -------------------------------------------------------------------------------- /security/spring-boot-social-login/src/main/java/com/sivalabs/bookmarker/config/security/oauth/AuthenticatedPrincipal.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarker.config.security.oauth; 2 | 3 | public interface AuthenticatedPrincipal { 4 | String getId(); 5 | String getName(); 6 | String getEmail(); 7 | String getImageUrl(); 8 | } 9 | -------------------------------------------------------------------------------- /security/spring-boot-social-login/src/main/java/com/sivalabs/bookmarker/config/security/oauth/OidcUser.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarker.config.security.oauth; 2 | 3 | import org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser; 4 | 5 | public class OidcUser extends DefaultOidcUser implements AuthenticatedPrincipal { 6 | 7 | public OidcUser(org.springframework.security.oauth2.core.oidc.user.OidcUser user) { 8 | super(user.getAuthorities(), user.getIdToken(), "name"); 9 | } 10 | 11 | @Override 12 | public String getId() { 13 | return super.getClaimAsString("id"); 14 | } 15 | 16 | @Override 17 | public String getImageUrl() { 18 | return super.getPicture(); 19 | } 20 | 21 | @Override 22 | public String getEmail() { 23 | return super.getEmail(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /security/spring-boot-social-login/src/main/java/com/sivalabs/bookmarker/domain/entity/Role.java: -------------------------------------------------------------------------------- 1 | package com.sivalabs.bookmarker.domain.entity; 2 | 3 | import com.fasterxml.jackson.annotation.JsonIgnore; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import javax.persistence.*; 8 | import javax.validation.constraints.NotEmpty; 9 | import java.io.Serializable; 10 | import java.util.List; 11 | 12 | @Entity 13 | @Table(name="roles") 14 | @Setter 15 | @Getter 16 | public class Role extends BaseEntity implements Serializable 17 | { 18 | 19 | @Id 20 | @SequenceGenerator(name = "role_id_generator", sequenceName = "role_id_seq", allocationSize = 1) 21 | @GeneratedValue(generator = "role_id_generator") 22 | private Long id; 23 | 24 | @Column(nullable=false, unique=true) 25 | @NotEmpty 26 | private String name; 27 | 28 | @JsonIgnore 29 | @ManyToMany(mappedBy = "roles") 30 | private ListProduct Name: name
11 |Registration is successful.
17 |Please Login.
18 |