@@ -138,9 +138,9 @@ public String verifyCodeAndFetchEmail(String code, String provider) {
138138 public OauthProviderVO registerOauthProvider (RegisterOAuthProviderCmd cmd ) {
139139 String description = cmd .getDescription ();
140140 String provider = cmd .getProvider ();
141- String clientId = cmd .getClientId ();
142- String redirectUri = cmd .getRedirectUri ();
143- String secretKey = cmd .getSecretKey ();
141+ String clientId = StringUtils . trim ( cmd .getClientId () );
142+ String redirectUri = StringUtils . trim ( cmd .getRedirectUri () );
143+ String secretKey = StringUtils . trim ( cmd .getSecretKey () );
144144
145145 if (!isOAuthPluginEnabled ()) {
146146 throw new CloudRuntimeException ("OAuth is not enabled, please enable to register" );
@@ -170,9 +170,9 @@ public List<OauthProviderVO> listOauthProviders(String provider, String uuid) {
170170 public OauthProviderVO updateOauthProvider (UpdateOAuthProviderCmd cmd ) {
171171 Long id = cmd .getId ();
172172 String description = cmd .getDescription ();
173- String clientId = cmd .getClientId ();
174- String redirectUri = cmd .getRedirectUri ();
175- String secretKey = cmd .getSecretKey ();
173+ String clientId = StringUtils . trim ( cmd .getClientId () );
174+ String redirectUri = StringUtils . trim ( cmd .getRedirectUri () );
175+ String secretKey = StringUtils . trim ( cmd .getSecretKey () );
176176 Boolean enabled = cmd .getEnabled ();
177177
178178 OauthProviderVO providerVO = _oauthProviderDao .findById (id );
0 commit comments