From b5c693fe79ca63f7e6901c3251b23b7009a97153 Mon Sep 17 00:00:00 2001 From: siva kumar Date: Wed, 28 Nov 2018 20:55:31 +0530 Subject: [PATCH] [ADF-3791] [User Info] - SSO - User Info displays only the First Name* Fixed display fullname * Updated unit test for the recent changes (#4022) --- lib/core/mock/jwt-helper.service.spec.ts | 11 +++++------ lib/core/services/jwt-helper.service.spec.ts | 2 +- lib/core/userinfo/services/identity-user.service.ts | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/core/mock/jwt-helper.service.spec.ts b/lib/core/mock/jwt-helper.service.spec.ts index bf0ef3bf26..bb32aeb3ab 100644 --- a/lib/core/mock/jwt-helper.service.spec.ts +++ b/lib/core/mock/jwt-helper.service.spec.ts @@ -15,9 +15,8 @@ * limitations under the License. */ -export let mockToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIx' + - 'MjM0NTY3ODkwIiwiZW1haWwiOiJqb2huRG9lQGdtYWlsLmNvbSIsImdpdmVuX25h' + - 'bWUiOiJKb2huIERvZSIsInByZWZlcnJlZF91c2VybmFtZSI6ImpvaG5Eb2UxIiwi' + - 'anRpIjoiNjVkYzNlMTItYmE0ZS00NDYyLWJmMDItMGVkZDYxNjAzYzY0IiwiaWF0' + - 'IjoxNTQyNzIxNjEzLCJleHAiOjE1NDI3Mjc3Njl9.W-KUqsy5IBVgG0RhZTvTUXY' + - '1no5wE9lghKXGFNgFbuA'; +export let mockToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.' + + 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydW' + + 'UsImVtYWlsIjoiam9obkRvZUBnbWFpbC5jb20iLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJqb' + + '2huRG9lMSIsImp0aSI6IjYyZDdiMDg1LWE1MmMtNGNmYS1iMDZmLWE4MWE3YjA2NGNkMiIsImlhdC' + + 'I6MTU0MzQxMDQ3NywiZXhwIjoxNTQzNDE1MjEzfQ.d0xX5QA - d6qGz2TpeWAPQE46B99BVMo_MyOXAMdfcIA'; diff --git a/lib/core/services/jwt-helper.service.spec.ts b/lib/core/services/jwt-helper.service.spec.ts index ac66526235..eae8f26f67 100644 --- a/lib/core/services/jwt-helper.service.spec.ts +++ b/lib/core/services/jwt-helper.service.spec.ts @@ -39,7 +39,7 @@ describe('JwtHelperService', () => { const result = jwtHelperService.decodeToken(mockToken); expect(result).toBeDefined(); expect(result).not.toBeNull(''); - expect(result['given_name']).toBe('John Doe'); + expect(result['name']).toBe('John Doe'); expect(result['email']).toBe('johnDoe@gmail.com'); }); }); diff --git a/lib/core/userinfo/services/identity-user.service.ts b/lib/core/userinfo/services/identity-user.service.ts index 26eaf79e38..42f30f46b5 100644 --- a/lib/core/userinfo/services/identity-user.service.ts +++ b/lib/core/userinfo/services/identity-user.service.ts @@ -25,7 +25,7 @@ import { JwtHelperService } from './../../services/jwt-helper.service'; }) export class IdentityUserService { - static USER_NAME = 'given_name'; + static USER_NAME = 'name'; static USER_EMAIL = 'email'; static USER_ACCESS_TOKEN = 'access_token'; static USER_PREFERRED_USERNAME = 'preferred_username';