profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/alagane/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Alexandre Lagane alagane @LINAGORA Toulouse, France https://www.linkedin.com/in/alexandrelagane/ Fullstack developer on OpenPaas at @linagora

alagane/alagane.github.io 0

Site for everything

alagane/alfred 0

Projet de Programmation Objet - Licence 3 Informatique de l'Université Paul Sabatier

alagane/angular-cli 0

CLI tool for Angular

alagane/Botania 0

A magic mod for Minecraft based on nature and plant life.

alagane/ChatPlaysNethack 0

Remember Twitch plays Pokémon? This time it's not Pokémon...

alagane/CMPDL 0

Curse Modpack Downloader

alagane/dfplex 0

Web Fortress

alagane/docker-petals-cockpit 0

A Dockerfile for Petals Cockpit

startedactions/virtual-environments

started time in 5 hours

startedorganicmaps/organicmaps

started time in 7 hours

issue commentlinagora/esn-frontend-inbox

as a user I want to be connected every time

the link (https://wstutorial.com/am/obtain-jwt-from-keycloak.html) shows that the access_token + refresh_token are packed into the JWT token.

yes we are aware of what keycloak provides, but here its not the topic. one more time, we shouldnt use refresh token for SPA without rotating mechanism

fabienmoyon

comment created time in 17 hours

push eventlinagora/esn-frontend-inbox

Andy Tan

commit sha 9f70c5d092b41f9be8f51432f7d2e7ccdc30413a

Use try_files until we rework the routing

view details

Alexandre Lagane

commit sha 22a52caa472adb25fdba09d64e16f312543d03a1

Merge pull request #477 from linagora/tanandy-patch-1 Use try_files until we rework the routing

view details

Fabien Moyon

commit sha a4b15b293e438f183a3771a1bccfe9b4a2c1706c

Merge branch 'main' into inbox-453-fix-401-jwt-token

view details

push time in a day

push eventlinagora/esn-frontend-inbox

Rachid OUBRAIM

commit sha 8283801c5c80bf266c9ac089288de661b8a6a675

#453 Fix 401 error

view details

push time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 angular.module('esn.inbox.libs')      function _initializeJmapClient() {       return $q.all([-        generateJwtToken(),+        tokenAPI.getWebToken(true),
        tokenAPI.getWebToken(),

we don't want a new token each time. we need to use the cached one

oubchid

comment created time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 angular.module('esn.inbox.libs')      function _initializeJmapClient() {       return $q.all([-        generateJwtToken(),+        tokenAPI.getWebToken(true),         inboxConfig('api'),         inboxConfig('downloadUrl')-      ]).then(function(data) {+      ]).then(function([{ data: jwt }, api, downloadUrl]) {
      ]).then(function([{ data: jwt }, apiUrl, downloadUrl]) {
oubchid

comment created time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 angular.module('esn.inbox.libs')      function _initializeJmapClient() {       return $q.all([-        generateJwtToken(),+        tokenAPI.getWebToken(true),         inboxConfig('api'),         inboxConfig('downloadUrl')-      ]).then(function(data) {+      ]).then(function([{ data: jwt }, api, downloadUrl]) {         jmapClient = new jmapDraft.Client(dollarHttpTransport, dollarQPromiseProvider)-          .withAPIUrl(data[1])-          .withDownloadUrl(data[2])-          .withAuthenticationToken('Bearer ' + data[0])+          .withAPIUrl(api)
          .withAPIUrl(apiUrl)
oubchid

comment created time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 describe('The jmapClientProvider service', function() {   });    it('should return a fulfilled promise if jwt generation succeed', function(done) {-    angular.mock.module(function($provide) {-      $provide.value('generateJwtToken', function() {-        return $q.when('expected jwt');-      });-    });     config['linagora.esn.unifiedinbox.api'] = 'expected jmap api';     config['linagora.esn.unifiedinbox.downloadUrl'] = 'expected jmap downloadUrl';+    tokenAPIMock.getWebToken = () => $q.when({ data: 'jwt' });     injectServices.bind(this)(); -    jmapClientProvider.get().then(function(client) {-      expect(client).to.be.an.instanceof(jmapDraft.Client);-      expect(client.authToken).to.equal('Bearer expected jwt');-      expect(client.apiUrl).to.equal('expected jmap api');-      expect(client.downloadUrl).to.equal('expected jmap downloadUrl');+    jmapClientProvider.get()+      .then(function(client) {+        expect(client).to.be.an.instanceof(jmapDraft.Client);+        expect(client.authToken).to.equal('Bearer jwt');+        expect(client.apiUrl).to.equal('expected jmap api');+        expect(client.downloadUrl).to.equal('expected jmap downloadUrl'); -      done();-    }, done.bind(null, 'should resolve'));+        done();

to match the indentation level, the done should be at the same level of the expect

image

oubchid

comment created time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 describe('The jmapClientProvider service', function() {   });    it('should return a fulfilled promise if jwt generation succeed', function(done) {-    angular.mock.module(function($provide) {-      $provide.value('generateJwtToken', function() {-        return $q.when('expected jwt');-      });-    });     config['linagora.esn.unifiedinbox.api'] = 'expected jmap api';     config['linagora.esn.unifiedinbox.downloadUrl'] = 'expected jmap downloadUrl';+    tokenAPIMock.getWebToken = () => $q.when({ data: 'jwt' });     injectServices.bind(this)(); -    jmapClientProvider.get().then(function(client) {-      expect(client).to.be.an.instanceof(jmapDraft.Client);-      expect(client.authToken).to.equal('Bearer expected jwt');-      expect(client.apiUrl).to.equal('expected jmap api');-      expect(client.downloadUrl).to.equal('expected jmap downloadUrl');+    jmapClientProvider.get()+      .then(function(client) {+        expect(client).to.be.an.instanceof(jmapDraft.Client);+        expect(client.authToken).to.equal('Bearer jwt');+        expect(client.apiUrl).to.equal('expected jmap api');+        expect(client.downloadUrl).to.equal('expected jmap downloadUrl'); -      done();-    }, done.bind(null, 'should resolve'));+        done();

yes, no ?

oubchid

comment created time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 describe('The inboxMessageBodyHtml component', function() {   var $compile, $rootScope, $timeout, newComposerService;   var element; +  const tokenAPIMock = {+    getNewToken: function() {+      return $q.when({ data: { token: '123' } });

this is a unit @tanandy

oubchid

comment created time in a day

push eventlinagora/esn-frontend-inbox

Andy Tan

commit sha 9f70c5d092b41f9be8f51432f7d2e7ccdc30413a

Use try_files until we rework the routing

view details

Alexandre Lagane

commit sha 22a52caa472adb25fdba09d64e16f312543d03a1

Merge pull request #477 from linagora/tanandy-patch-1 Use try_files until we rework the routing

view details

Andy Tan

commit sha 0c1f3edd0c4205383fd5f5ee515f49cd15e1db6a

Merge branch 'main' into inbox-453-fix-401-jwt-token

view details

push time in a day

push eventlinagora/esn-frontend-inbox

Rachid OUBRAIM

commit sha 600e89a6c407f9eebdced256bfacd4105e9f7309

#453 Fix 401 error

view details

push time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 describe('The inboxMessageBodyHtml component', function() {   var $compile, $rootScope, $timeout, newComposerService;   var element; +  const tokenAPIMock = {+    getNewToken: function() {+      return $q.when({ data: { token: '123' } });

It doesn't matter the value here, just a token value

oubchid

comment created time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 describe('The jmapClientProvider service', function() {   });    it('should return a fulfilled promise if jwt generation succeed', function(done) {-    angular.mock.module(function($provide) {-      $provide.value('generateJwtToken', function() {-        return $q.when('expected jwt');-      });-    });     config['linagora.esn.unifiedinbox.api'] = 'expected jmap api';     config['linagora.esn.unifiedinbox.downloadUrl'] = 'expected jmap downloadUrl';+    tokenAPIMock.getWebToken = () => $q.when({ data: 'jwt' });     injectServices.bind(this)(); -    jmapClientProvider.get().then(function(client) {-      expect(client).to.be.an.instanceof(jmapDraft.Client);-      expect(client.authToken).to.equal('Bearer expected jwt');-      expect(client.apiUrl).to.equal('expected jmap api');-      expect(client.downloadUrl).to.equal('expected jmap downloadUrl');+    jmapClientProvider.get()+      .then(function(client) {+        expect(client).to.be.an.instanceof(jmapDraft.Client);+        expect(client.authToken).to.equal('Bearer jwt');+        expect(client.apiUrl).to.equal('expected jmap api');+        expect(client.downloadUrl).to.equal('expected jmap downloadUrl'); -      done();-    }, done.bind(null, 'should resolve'));+        done();

do we have spaces here ?

oubchid

comment created time in a day

Pull request review commentlinagora/esn-frontend-inbox

#453 Fix 401 error

 describe('The inboxMessageBodyHtml component', function() {   var $compile, $rootScope, $timeout, newComposerService;   var element; +  const tokenAPIMock = {+    getNewToken: function() {+      return $q.when({ data: { token: '123' } });

what is 123 ?

oubchid

comment created time in a day

push eventlinagora/esn-frontend-inbox

Andy Tan

commit sha 9f70c5d092b41f9be8f51432f7d2e7ccdc30413a

Use try_files until we rework the routing

view details

Alexandre Lagane

commit sha 22a52caa472adb25fdba09d64e16f312543d03a1

Merge pull request #477 from linagora/tanandy-patch-1 Use try_files until we rework the routing

view details

Andy Tan

commit sha 7f3e06444294e2ff70c0fffb0af9bb4e25475cd5

Merge branch 'main' into inbox-453-fix-401-jwt-token

view details

push time in a day

PR opened linagora/esn-frontend-inbox

Reviewers
#453 Fix 401 error
+86 -75

0 comment

9 changed files

pr created time in a day

create barnchlinagora/esn-frontend-inbox

branch : inbox-453-fix-401-jwt-token

created branch time in a day

Pull request review commentlinagora/esn-frontend-common-libs

use current date in seconds instead of milliseconds while checking jwt exp claim expiration

 angular.module('esn.authentication', ['esn.http'])       if (!expirationTime) return promise || requestNewWebToken();        // check if we haven't reached the expiration time yet.-      return expirationTime > Date.now() ? promise : requestNewWebToken();+      // jwt exp claim is a NumericDate value that is defined as the number of seconds (not milliseconds) since Epoch.+      return expirationTime > Date.now() / 1000 ? promise : requestNewWebToken();

this has nothing to do with OIDC i believe, client ( ie calendar SPA ) will request a jwt token from ESN to use it when making requests to services like Sabre and jmap.

rezk2ll

comment created time in 2 days

Pull request review commentlinagora/esn-frontend-common-libs

use current date in seconds instead of milliseconds while checking jwt exp claim expiration

 angular.module('esn.authentication', ['esn.http'])       if (!expirationTime) return promise || requestNewWebToken();        // check if we haven't reached the expiration time yet.-      return expirationTime > Date.now() ? promise : requestNewWebToken();+      // jwt exp claim is a NumericDate value that is defined as the number of seconds (not milliseconds) since Epoch.+      return expirationTime > Date.now() / 1000 ? promise : requestNewWebToken();

sure but how we can work if its not behind OIDC ?

rezk2ll

comment created time in 2 days

create barnchlinagora/esn-frontend-inbox

branch : tanandy-patch-1

created branch time in 2 days

startedSigNoz/signoz

started time in 3 days

push eventlinagora/esn-frontend-common-libs

Renaud BOYER

commit sha 7a43c1d15706f77b8a62ce142160248ddab1c29c

#104: Prevent error looping when fallback src not found

view details

Fabien Moyon

commit sha ffdd13b42ca611d480f90761a879b0166348ba06

Merge pull request #220 from renaudboyer/fix-fallback-src-loop

view details

push time in 3 days

PR merged linagora/esn-frontend-common-libs

Reviewers
#104: Prevent error looping when fallback src not found

Display one console warn instead of looping on trying to fetch fallback src

image

+5 -1

0 comment

1 changed file

renaudboyer

pr closed time in 3 days

issue commentlinagora/esn-frontend-inbox

as a user I want to be connected every time

the link (https://wstutorial.com/am/obtain-jwt-from-keycloak.html) shows that the access_token + refresh_token are packed into the JWT token.

fabienmoyon

comment created time in 3 days

issue commentlinagora/esn-frontend-inbox

as a user I want to be connected every time

Maybe thé refresh_token could be used to refresh the access_token in case it has expired

Sûre. Btw using refresh token for spa without rotating mecanism is a security issue.

Btw here it is mainly the jwt token that expires before. We need to Sync jwt and Access token

fabienmoyon

comment created time in 3 days

issue commentlinagora/esn-frontend-inbox

as a user I want to be connected every time

Maybe thé refresh_token could be used to refresh the access_token in case it has expired

fabienmoyon

comment created time in 3 days