mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-11-04 01:51:04 +01:00 
			
		
		
		
	Use correct machinekey format for oidc reg
This commit is contained in:
		
							parent
							
								
									86ade72c19
								
							
						
					
					
						commit
						ec4dc68524
					
				
							
								
								
									
										8
									
								
								oidc.go
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								oidc.go
									
									
									
									
									
								
							@ -193,10 +193,12 @@ func (h *Headscale) OIDCCallback(ctx *gin.Context) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	machineKeyStr, machineKeyOK := machineKeyIf.(string)
 | 
			
		||||
	machineKeyFromCache, machineKeyOK := machineKeyIf.(string)
 | 
			
		||||
 | 
			
		||||
	var machineKey key.MachinePublic
 | 
			
		||||
	err = machineKey.UnmarshalText([]byte(MachinePublicKeyEnsurePrefix(machineKeyStr)))
 | 
			
		||||
	err = machineKey.UnmarshalText(
 | 
			
		||||
		[]byte(MachinePublicKeyEnsurePrefix(machineKeyFromCache)),
 | 
			
		||||
	)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		log.Error().
 | 
			
		||||
			Msg("could not parse machine public key")
 | 
			
		||||
@ -295,6 +297,8 @@ func (h *Headscale) OIDCCallback(ctx *gin.Context) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	machineKeyStr := MachinePublicKeyStripPrefix(machineKey)
 | 
			
		||||
 | 
			
		||||
	_, err = h.RegisterMachineFromAuthCallback(
 | 
			
		||||
		machineKeyStr,
 | 
			
		||||
		namespace.Name,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user