2121
2222import com .auth0 .jwt .algorithms .Algorithm ;
2323import com .auth0 .jwt .exceptions .JWTCreationException ;
24- import com .auth0 .jwt .impl .PublicClaims ;
24+ import com .auth0 .jwt .interfaces .constants .Constants ;
25+ import com .auth0 .jwt .interfaces .constants .PublicClaims ;
2526import com .auth0 .jwt .jwts .JWT ;
2627
2728import java .util .Date ;
@@ -41,11 +42,11 @@ public class GoogleJwtCreator {
4142 public GoogleJwtCreator () {
4243 jwt = JWT .create ();
4344 addedClaims = new HashMap <String , Boolean >() {{
44- put ("Name" , false );
45- put ("Email" , false );
46- put ("Picture" , false );
47- put ("Issuer" , false );
48- put ("Subject" , false );
45+ put (Constants . NAME_CAPITALIZED , false );
46+ put (Constants . EMAIL_CAPITALIZED , false );
47+ put (Constants . PICTURE_CAPITALIZED , false );
48+ put (Constants . ISSUER_CAPITALIZED , false );
49+ put (Constants . SUBJECT_CAPITALIZED , false );
4950 put ("Iat" , false );
5051 }};
5152 publicClaims = new HashSet <String >() {{
@@ -68,7 +69,7 @@ public GoogleJwtCreator() {
6869 */
6970 public GoogleJwtCreator withName (String name ) {
7071 jwt .withNonStandardClaim ("name" , name );
71- addedClaims .put ("Name" , true );
72+ addedClaims .put (Constants . NAME_CAPITALIZED , true );
7273 return this ;
7374 }
7475
@@ -79,8 +80,8 @@ public GoogleJwtCreator withName(String name) {
7980 * @return this same Builder instance.
8081 */
8182 public GoogleJwtCreator withEmail (String email ) {
82- jwt .withNonStandardClaim ("email" , email );
83- addedClaims .put ("Email" , true );
83+ jwt .withNonStandardClaim (Constants . EMAIL , email );
84+ addedClaims .put (Constants . EMAIL_CAPITALIZED , true );
8485 return this ;
8586 }
8687
@@ -91,8 +92,8 @@ public GoogleJwtCreator withEmail(String email) {
9192 * @return this same Builder instance.
9293 */
9394 public GoogleJwtCreator withPicture (String picture ) {
94- jwt .withNonStandardClaim ("picture" , picture );
95- addedClaims .put ("Picture" , true );
95+ jwt .withNonStandardClaim (Constants . PICTURE , picture );
96+ addedClaims .put (Constants . PICTURE_CAPITALIZED , true );
9697 return this ;
9798 }
9899
@@ -105,7 +106,7 @@ public GoogleJwtCreator withPicture(String picture) {
105106 */
106107 public GoogleJwtCreator withIssuer (String ... issuer ) {
107108 jwt .withIssuer (issuer );
108- addedClaims .put ("Issuer" , true );
109+ addedClaims .put (Constants . ISSUER_CAPITALIZED , true );
109110 return this ;
110111 }
111112
@@ -118,7 +119,7 @@ public GoogleJwtCreator withIssuer(String... issuer) {
118119 */
119120 public GoogleJwtCreator withSubject (String ... subject ) {
120121 jwt .withSubject (subject );
121- addedClaims .put ("Subject" , true );
122+ addedClaims .put (Constants . SUBJECT_CAPITALIZED , true );
122123 return this ;
123124 }
124125
0 commit comments