Skip to content

Commit ef45c07

Browse files
committed
Improvements for SimpleSSO
1 parent 52bacf2 commit ef45c07

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

core/src/main/java/com/fastcomments/core/sso/FastCommentsSSO.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,18 @@ public FastCommentsSSO() {
6868

6969
}
7070

71+
public static class SimpleSSOWrapper {
72+
public SimpleSSOUserData simpleSSOUser;
73+
public SimpleSSOWrapper(SimpleSSOUserData simpleSSOUser) {
74+
this.simpleSSOUser = simpleSSOUser;
75+
}
76+
}
77+
7178
private String createToken() {
7279
if (secureSSOPayload != null) {
7380
return gson.toJson(secureSSOPayload);
7481
}
75-
return gson.toJson(simpleSSOUserData);
82+
return gson.toJson(new SimpleSSOWrapper(simpleSSOUserData));
7683
}
7784

7885
public String prepareToSend() {

core/src/main/java/com/fastcomments/core/sso/SimpleSSOUserData.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,35 @@
66
* An object that represents a user, for SimpleSSO.
77
*/
88
public class SimpleSSOUserData {
9+
/**
10+
* If you don't set id, it defaults to their email.
11+
*/
12+
public String id;
13+
/**
14+
* Their locale, for email notifications etc, in the format "en_us".
15+
*/
16+
public String locale;
17+
public Boolean optedInNotifications;
18+
/**
19+
* Show a nice label with their comments, like "VIP User".
20+
*/
21+
public String displayLabel;
22+
/**
23+
* Set a non-unique name (since username must be unique within your tenant).
24+
*/
25+
public String displayName;
26+
/**
27+
* Defaults to true when null.
28+
*/
29+
public Boolean isProfileActivityPrivate;
30+
931
/** This must be unique when paired with an email. */
1032
public String username;
1133
/** The user's email. */
1234
public String email;
1335
/** The user's avatar. */
1436
public String avatar;
15-
/** The user's website, blog, or personal account page. */
37+
/** The user's website, blog, or personal account page to show with their comments. */
1638
public String websiteUrl;
1739

1840
public SimpleSSOUserData(String username) {

0 commit comments

Comments
 (0)