[ADF-3791] [User Info] - SSO - User Info displays only the First Name* Fixed display fullname * Updated unit test for the recent changes (#4022)

This commit is contained in:
siva kumar
2018-11-28 20:55:31 +05:30
committed by Maurizio Vitale
parent eb2ca06526
commit b5c693fe79
3 changed files with 7 additions and 8 deletions

View File

@@ -15,9 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
export let mockToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIx' + export let mockToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.' +
'MjM0NTY3ODkwIiwiZW1haWwiOiJqb2huRG9lQGdtYWlsLmNvbSIsImdpdmVuX25h' + 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydW' +
'bWUiOiJKb2huIERvZSIsInByZWZlcnJlZF91c2VybmFtZSI6ImpvaG5Eb2UxIiwi' + 'UsImVtYWlsIjoiam9obkRvZUBnbWFpbC5jb20iLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJqb' +
'anRpIjoiNjVkYzNlMTItYmE0ZS00NDYyLWJmMDItMGVkZDYxNjAzYzY0IiwiaWF0' + '2huRG9lMSIsImp0aSI6IjYyZDdiMDg1LWE1MmMtNGNmYS1iMDZmLWE4MWE3YjA2NGNkMiIsImlhdC' +
'IjoxNTQyNzIxNjEzLCJleHAiOjE1NDI3Mjc3Njl9.W-KUqsy5IBVgG0RhZTvTUXY' + 'I6MTU0MzQxMDQ3NywiZXhwIjoxNTQzNDE1MjEzfQ.d0xX5QA - d6qGz2TpeWAPQE46B99BVMo_MyOXAMdfcIA';
'1no5wE9lghKXGFNgFbuA';

View File

@@ -39,7 +39,7 @@ describe('JwtHelperService', () => {
const result = jwtHelperService.decodeToken(mockToken); const result = jwtHelperService.decodeToken(mockToken);
expect(result).toBeDefined(); expect(result).toBeDefined();
expect(result).not.toBeNull(''); expect(result).not.toBeNull('');
expect(result['given_name']).toBe('John Doe'); expect(result['name']).toBe('John Doe');
expect(result['email']).toBe('johnDoe@gmail.com'); expect(result['email']).toBe('johnDoe@gmail.com');
}); });
}); });

View File

@@ -25,7 +25,7 @@ import { JwtHelperService } from './../../services/jwt-helper.service';
}) })
export class IdentityUserService { export class IdentityUserService {
static USER_NAME = 'given_name'; static USER_NAME = 'name';
static USER_EMAIL = 'email'; static USER_EMAIL = 'email';
static USER_ACCESS_TOKEN = 'access_token'; static USER_ACCESS_TOKEN = 'access_token';
static USER_PREFERRED_USERNAME = 'preferred_username'; static USER_PREFERRED_USERNAME = 'preferred_username';