Java Code Examples for org.brickred.socialauth.Profile#getDisplayName()

The following examples show how to use org.brickred.socialauth.Profile#getDisplayName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SuccessController.java    From socialauth with MIT License 6 votes vote down vote up
private ModelAndView registration(final AuthProvider provider)
		throws Exception {
	Profile profile = provider.getUserProfile();
	if (profile.getFullName() == null) {
		String name = null;
		if (profile.getFirstName() != null) {
			name = profile.getFirstName();
		}
		if (profile.getLastName() != null) {
			if (profile.getFirstName() != null) {
				name += " " + profile.getLastName();
			} else {
				name = profile.getLastName();
			}
		}
		if (name == null && profile.getDisplayName() != null) {
			name = profile.getDisplayName();
		}
		if (name != null) {
			profile.setFullName(name);
		}
	}
	ModelAndView view = new ModelAndView("registrationForm", "profile",
			profile);
	return view;
}
 
Example 2
Source File: GitHubProvider.java    From gocd-oauth-login with Apache License 2.0 5 votes vote down vote up
@Override
public User getUser(Profile profile) {
    String displayName = profile.getDisplayName();
    String fullName = profile.getFullName();
    String emailId = profile.getEmail();
    return new User(displayName, fullName, emailId);
}