Skip to content

Commit 47e2878

Browse files
Merge branch 'master' into Update-jest
2 parents e3014ba + 3adbece commit 47e2878

12 files changed

Lines changed: 8988 additions & 86 deletions

File tree

README.MD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[![Build Status](https://travis-ci.org/Staffbase/plugins-sdk-nodejs.svg?branch=master)](https://travis-ci.org/Staffbase/plugins-sdk-nodejs)
2-
32
# Staffbase Plugins SDK for Node.js.
43

54
If you are developing your own plugin for your Staffbase app we describe the authentication flow of a plugin at https://developers.staffbase.com/guide/customplugin-overview/. While this documentation just covers the conceptual ideas of the interface of plugins though – the so called Plugin SSO – we want to provide a library to help you develop your first plugin for Staffbase even faster. This SDK provides the basic functionality to parse and verify a provided token for Node.js.
@@ -87,6 +86,8 @@ The following data can be retrieved from the token:
8786
|CLAIM_INSTANCE_NAME|instance_name|getInstanceName()|Get the (plugin) instance name for which the token was issued.|
8887
|CLAIM_USER_ID|sub|getUserId()|Get the id of the authenticated user.|
8988
|CLAIM_USER_EXTERNAL_ID|external_id|getUserExternalId()|Get the id of the user in an external system.|
89+
|CLAIM_USER_USERNAME|username|getUserUsername()|Get the username of the user accessing.|
90+
|CLAIM_USER_PRIMARY_EMAIL_ADDRESS|primary_email_address|getUserPrimaryEmailAddress()|Get the primary email address of the user accessing.|
9091
|CLAIM_USER_FULL_NAME|name|getFullName()|Get either the combined name of the user or the name of the token.|
9192
|CLAIM_USER_FIRST_NAME|given_name|getFirstName()|Get the first name of the user accessing.|
9293
|CLAIM_USER_LAST_NAME|family_name|getLastName()|Get the last name of the user accessing.|

authors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Max Scholz <max@staffbase.com>

docSrc/sections/usage.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ The following data can be retrieved from the token:
6363
|CLAIM_INSTANCE_NAME|instance_name|getInstanceName()|Get the (plugin) instance name for which the token was issued.|
6464
|CLAIM_USER_ID|sub|getUserId()|Get the id of the authenticated user.|
6565
|CLAIM_USER_EXTERNAL_ID|external_id|getUserExternalId()|Get the id of the user in an external system.|
66+
|CLAIM_USER_USERNAME|username|getUserUsername()|Get the username of the user accessing.|
67+
|CLAIM_USER_PRIMARY_EMAIL_ADDRESS|primary_email_address|getUserPrimaryEmailAddress()|Get the primary email address of the user accessing.|
6668
|CLAIM_USER_FULL_NAME|name|getFullName()|Get either the combined name of the user or the name of the token.|
6769
|CLAIM_USER_FIRST_NAME|given_name|getFirstName()|Get the first name of the user accessing.|
6870
|CLAIM_USER_LAST_NAME|family_name|getLastName()|Get the last name of the user accessing.|

docs/API.MD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ SSOTokenData Class used to host the token data values and provide getter functio
4444
* [.getInstanceName()](#markdown-header-ssotokendatagetinstancename-nullstring) ⇒ null ⎮ string
4545
* [.getUserId()](#markdown-header-ssotokendatagetuserid-nullstring) ⇒ null ⎮ string
4646
* [.getUserExternalId()](#markdown-header-ssotokendatagetuserexternalid-nullstring) ⇒ null ⎮ string
47+
* [.getUserUsername()](#markdown-header-ssotokendatagetuserusername-nullstring) ⇒ null ⎮ string
48+
* [.getUserPrimaryEmailAddress()](#markdown-header-ssotokendatagetuserprimaryemailaddress-nullstring) ⇒ null ⎮ string
4749
* [.getFullName()](#markdown-header-ssotokendatagetfullname-nullstring) ⇒ null ⎮ string
4850
* [.getFirstName()](#markdown-header-ssotokendatagetfirstname-nullstring) ⇒ null ⎮ string
4951
* [.getLastName()](#markdown-header-ssotokendatagetlastname-nullstring) ⇒ null ⎮ string
@@ -148,6 +150,14 @@ Get the id of the user in an external system.
148150
Example use case would be to map user from an external store
149151
to the entry defined in the token.
150152

153+
**Kind**: instance method of [SSOTokenData](#markdown-header-new-ssotokendatatokenvals)
154+
### ssoTokenData.getUserUsername() ⇒ null ⎮ string
155+
Get the username of the user accessing.
156+
157+
**Kind**: instance method of [SSOTokenData](#markdown-header-new-ssotokendatatokenvals)
158+
### ssoTokenData.getUserPrimaryEmailAddress() ⇒ null ⎮ string
159+
Get the primary email address of the user accessing.
160+
151161
**Kind**: instance method of [SSOTokenData](#markdown-header-new-ssotokendatatokenvals)
152162
### ssoTokenData.getFullName() ⇒ null ⎮ string
153163
Get either the combined name of the user or the name of the token.

0 commit comments

Comments
 (0)