Hi! I’m trying to use the “Create Board without registration” button but it doesn’t work. Maybe, something wrong with JWT integration. Any ideas?
<script language="JavaScript" type="text/javascript"
src="https://kjur.github.io/jsrsasign/jsrsasign-latest-all-min.js">
</script>
<script type="text/javascript">
var oHeader = {alg: 'HS256', typ: 'JWT'};
// Payload
var oPayload = {};
var tNow = KJUR.jws.IntDate.get('now');
var tEnd = KJUR.jws.IntDate.get('now + 1day');
oPayload.iss = "CLIENT_ID";
oPayload.nbf = tNow;
oPayload.iat = tNow;
oPayload.exp = tEnd;
// Sign JWT, password=616161
var sHeader = JSON.stringify(oHeader);
var sPayload = JSON.stringify(oPayload);
var sJWT = KJUR.jws.JWS.sign("HS256", sHeader, sPayload, "CLIENT_SECRET");
</script>
<script>
function onClick() {
console.log(sJWT);
miroBoardsPicker.open({
clientId: 'CLIENT_ID', // 1) Put your 'clientId' here.
action: 'access-link',
allowCreateAnonymousBoards: true, //2) Enable this option
getToken: () => Promise.resolve(sJWT), // Provide token in async way
success: data => {
console.log('on success', data)
},
error: e => {
console.log('on error', e)
},
cancel: () => {
console.log('on cancel')
},
/*windowRef: windowRef,*/ // Optional. Link to an already opened popup window. See example below in case you want lazy loading for boardsPicker.js.
})
}