Changeset 37692


Ignore:
Timestamp:
2023-04-21T14:07:55+12:00 (12 months ago)
Author:
davidb
Message:

Makes more sense for the variable named to be greenstone_username; and so does not need to @-part being stripped off; tested with a Google sign-in account with a Google username part that was different to the Greenstone username

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/GoogleSigninJDBCRealm.java

    r37390 r37692  
    398398       
    399399        // Google Client Token ID has been passed in as 'credentials'
    400         String google_user_email = getGreenstoneUsernameFromGoogleTokenId(credentials);
    401 
    402         if (google_user_email != null) {
    403         String google_username = google_user_email.replaceAll("@.*$","");
    404         System.err.println("**** Using the following username derived from verified Google email address as Greenstone3 username = '" + google_username + "'");
    405        
    406         principal = super.getPrincipal(google_username);
     400        String greenstone_username = getGreenstoneUsernameFromGoogleTokenId(credentials);
     401
     402        if (greenstone_username != null) {
     403        System.err.println("**** Using the following username derived from verified Google email address as Greenstone3 username = '" + greenstone_username + "'");
     404       
     405        principal = super.getPrincipal(greenstone_username);
    407406        }
    408407        else {
Note: See TracChangeset for help on using the changeset viewer.