Browse Source
			
			
			Merge pull request #70 from Filirom1/generate_client_secrets
			
				Add generate_client_secrets
			
			
				pull/75/head
			
			
		 
		
			
				
					
						 Marcos Pereira
					
					6 years ago
						Marcos Pereira
					
					6 years ago
					
						
							committed by
							
								 GitHub
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
				  
				  No known key found for this signature in database
				  
				  	
						GPG Key ID: 4AEE18F83AFDEB23
				  	
				  
				
			
		
		
		
	
		
			
				 1 changed files with 
14 additions and 
0 deletions
			 
			
		 
		
			
				- 
					
					
					 
					keycloak/keycloak_admin.py
				
					
					
						
							
								
									
										
											
	
		
			
				
					|  |  | @ -1103,6 +1103,20 @@ class KeycloakAdmin: | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return raise_error_from_response(data_raw, KeycloakGetError, expected_code=201) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     def generate_client_secrets(self, client_id): | 
			
		
	
		
			
				
					|  |  |  |         """ | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         Generate a new secret for the client | 
			
		
	
		
			
				
					|  |  |  |         https://www.keycloak.org/docs-api/8.0/rest-api/index.html#_regeneratesecret | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         :param client_id:  id of client (not client-id) | 
			
		
	
		
			
				
					|  |  |  |         :return: Keycloak server response (ClientRepresentation) | 
			
		
	
		
			
				
					|  |  |  |         """ | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         params_path = {"realm-name": self.realm_name, "id": client_id} | 
			
		
	
		
			
				
					|  |  |  |         data_raw = self.raw_post(URL_ADMIN_CLIENT_SECRETS.format(**params_path), data=None) | 
			
		
	
		
			
				
					|  |  |  |         return raise_error_from_response(data_raw, KeycloakGetError) | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     def get_client_secrets(self, client_id): | 
			
		
	
		
			
				
					|  |  |  |         """ | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |