2017-03-18 20:25:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Relevant articles
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  [Spring Security and OpenID Connect ](http://www.baeldung.com/spring-security-openid-connect ) 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 12:47:03 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## OpenID Connect with Spring Security
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-02 14:00:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Run the Project
  
						 
					
						
							
								
									
										
										
										
											2016-03-03 12:47:03 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2017-02-02 14:00:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								mvn spring-boot:run
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 12:47:03 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 12:57:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Obtain Google App - Client ID, Secret
  
						 
					
						
							
								
									
										
										
										
											2017-02-02 14:00:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  You need to get client id and client secret by creating a new project at [Google Developer Console ](https://console.developers.google.com/project/_/apiui/credential?pli=1 ) 
						 
					
						
							
								
									
										
										
										
											2016-03-03 12:47:03 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								-  Make sure to add OAuth2 credentials by selecting Add credentials > OAuth 2.0 client ID 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-  Make sure you set redirect URI to http://localhost:8081/google-login 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-03-03 12:57:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-  Once you have your client id and secret, make sure you add them to the `application.properties`  of the project 
						 
					
						
							
								
									
										
										
										
											2017-03-18 20:25:06 +01:00