mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-96: Clean up enrollment interface. Provide help text for user.
This commit is contained in:
		| @@ -245,14 +245,14 @@ public class UserVerificationService { | ||||
|             if (!key.isConfirmed()) { | ||||
|                 field.exposeKey(key); | ||||
|                 throw new GuacamoleInsufficientCredentialsException( | ||||
|                         "LOGIN.INFO_TOTP_REQUIRED", new CredentialsInfo( | ||||
|                         "TOTP.INFO_ENROLL_REQUIRED", new CredentialsInfo( | ||||
|                             Collections.<Field>singletonList(field) | ||||
|                         )); | ||||
|             } | ||||
|  | ||||
|             // Otherwise simply request the user's authentication code | ||||
|             throw new GuacamoleInsufficientCredentialsException( | ||||
|                     "LOGIN.INFO_TOTP_REQUIRED", new CredentialsInfo( | ||||
|                     "TOTP.INFO_CODE_REQUIRED", new CredentialsInfo( | ||||
|                         Collections.<Field>singletonList(field) | ||||
|                     )); | ||||
|  | ||||
| @@ -285,7 +285,7 @@ public class UserVerificationService { | ||||
|         } | ||||
|  | ||||
|         // Provided code is not valid | ||||
|         throw new GuacamoleClientException("LOGIN.INFO_TOTP_VERIFICATION_FAILED"); | ||||
|         throw new GuacamoleClientException("TOTP.INFO_VERIFICATION_FAILED"); | ||||
|  | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -98,6 +98,28 @@ public class AuthenticationCodeField extends Field { | ||||
|         this.key = key; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Returns the number of digits used for each TOTP code. If the user's key | ||||
|      * is not being exposed to facilitate enrollment, this value will not be | ||||
|      * exposed either. | ||||
|      * | ||||
|      * @return | ||||
|      *     The number of digits used for each TOTP code, or null if the user's | ||||
|      *     key is not being exposed to facilitate enrollment. | ||||
|      * | ||||
|      * @throws GuacamoleException | ||||
|      *     If the number of digits cannot be read from guacamole.properties. | ||||
|      */ | ||||
|     public Integer getDigits() throws GuacamoleException { | ||||
|  | ||||
|         // Do not reveal code size unless enrollment is in progress | ||||
|         if (key == null) | ||||
|             return null; | ||||
|  | ||||
|         return confService.getDigits(); | ||||
|          | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Returns the "otpauth" URI for the secret key used to generate TOTP codes | ||||
|      * for the current user. If the secret key is not being exposed to | ||||
|   | ||||
		Reference in New Issue
	
	Block a user