@@ -12,6 +12,8 @@ class SSOTokenData {
1212 * @param {Object } tokenVals TokenVals object wit keys representing possible SSO token values.
1313 */
1414 constructor ( tokenVals ) {
15+ this . branch_id = tokenVals . CLAIM_BRANCH_ID ;
16+ this . branch_slug = tokenVals . CLAIM_BRANCH_SLUG ;
1517 this . aud = tokenVals . CLAIM_AUDIENCE ;
1618 this . exp = tokenVals . CLAIM_EXPIRE_AT ;
1719 this . nbf = tokenVals . CLAIM_NOT_BEFORE ;
@@ -106,6 +108,8 @@ class SSOTokenData {
106108 */
107109 toJSObj ( ) {
108110 return {
111+ branch_id : this . branch_id ,
112+ branch_slug : this . branch_slug ,
109113 aud : this . aud ,
110114 exp : this . exp ,
111115 nbf : this . nbf ,
@@ -134,6 +138,8 @@ class SSOTokenData {
134138 */
135139 toJSObjPretty ( ) {
136140 return {
141+ CLAIM_BRANCH_ID : this . branch_id ,
142+ CLAIM_BRANCH_SLUG : this . branch_slug ,
137143 CLAIM_AUDIENCE : this . aud ,
138144 CLAIM_EXPIRE_AT : this . exp ,
139145 CLAIM_NOT_BEFORE : this . nbf ,
@@ -167,6 +173,24 @@ class SSOTokenData {
167173 }
168174 return this [ TokenDataConsts [ claimName ] ] || null ;
169175 }
176+ /**
177+ * Get the branch ID for which the token was issued.
178+ *
179+ * @return {null|string }
180+ */
181+ getBranchId ( ) {
182+ return this . _getClaim ( 'CLAIM_BRANCH_ID' ) ;
183+ }
184+
185+ /**
186+ * Get the branch slug for which the token was issued.
187+ *
188+ * @return {null|string }
189+ */
190+ getBranchSlug ( ) {
191+ return this . _getClaim ( 'CLAIM_BRANCH_SLUG' ) ;
192+ }
193+
170194 /**
171195 * Get targeted audience of the token.
172196 *
0 commit comments