This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 416a73fbe4e36ca6e971fadb238d49e1a79145c6 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Feb 5 17:16:38 2015 +0100 fixes #6517 resolve encoding problem in current user name --- coselmar-rest/pom.xml | 1 - .../coselmar/services/v1/UsersWebService.java | 2 +- coselmar-ui/src/main/webapp/js/angular-jwt.js | 38 +++++++++++++--------- pom.xml | 7 ++++ 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/coselmar-rest/pom.xml b/coselmar-rest/pom.xml index 7c98e66..d7a4c43 100644 --- a/coselmar-rest/pom.xml +++ b/coselmar-rest/pom.xml @@ -128,7 +128,6 @@ <dependency> <groupId>com.auth0</groupId> <artifactId>java-jwt</artifactId> - <version>1.0.0</version> </dependency> <!-- databases --> diff --git a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java index c0dbe5c..aa02c66 100644 --- a/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java +++ b/coselmar-rest/src/main/java/fr/ifremer/coselmar/services/v1/UsersWebService.java @@ -380,7 +380,7 @@ public class UsersWebService extends CoselmarWebServiceSupport { // return a Json Web Token for authentication JWTSigner jwtSigner = new JWTSigner(getCoselmarServicesConfig().getWebSecurityKey()); JWTSigner.Options signerOption = new JWTSigner.Options(); - signerOption.setAlgorithm(Algorithm.HS512); + signerOption.setAlgorithm(Algorithm.HS384); String userTopiaId = user.getTopiaId(); String shortId = getPersistenceContext().getTopiaIdFactory().getRandomPart(userTopiaId); diff --git a/coselmar-ui/src/main/webapp/js/angular-jwt.js b/coselmar-ui/src/main/webapp/js/angular-jwt.js index 512cf50..c132579 100644 --- a/coselmar-ui/src/main/webapp/js/angular-jwt.js +++ b/coselmar-ui/src/main/webapp/js/angular-jwt.js @@ -4,21 +4,29 @@ * $Id:$ * $HeadURL:$ * %% - * Copyright (C) 2014 Ifremer, Code Lutin + * https://github.com/auth0/angular-jwt * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. + * The MIT License (MIT) + * + * Copyright (c) 2015 Auth0, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. * #L% */ (function() { @@ -94,7 +102,7 @@ angular.module('angular-jwt', throw 'Illegal base64url string!'; } } - return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js + return decodeURIComponent(escape(window.atob(output))); //polifyll https://github.com/davidchambers/Base64.js } diff --git a/pom.xml b/pom.xml index fa5218f..a6272d7 100644 --- a/pom.xml +++ b/pom.xml @@ -354,6 +354,13 @@ <version>3.1.0</version> </dependency> + <!-- JWT signer --> + <dependency> + <groupId>com.auth0</groupId> + <artifactId>java-jwt</artifactId> + <version>1.0.0</version> + </dependency> + <!-- Logging --> <dependency> <groupId>log4j</groupId> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.