g3w-suite / g3w-admin

Server module for G3W-SUITE
https://g3w-suite.readthedocs.io/en/latest/g3wsuite_administration.html
Mozilla Public License 2.0
40 stars 33 forks source link

[Token Authentication] - JWT Token by REST API #533

Open bard0x opened 1 year ago

bard0x commented 1 year ago

Checklist

Motivation

Hi,

is there a possibility to do a login in G3W with a JWT Token by calling a REST API? For example, I would to implement an autologin on start on G3W, embedding G3W into an iframe with an autologin calling a rest api by JWT Token.

Thanks in advance for the reply

bard0x

Suggested solution

JWT Token in order to do an authentication by REST API

Alternatives considered

No response

Raruto commented 1 year ago

Hi @bard0x,

maybe I misunderstood you, but I don't think you can authenticate a JWT user using a "standard" <iframe src="..."> request.

The closest thing you can do, is to generate a unique token for the user (within your "frontend" application) and pass it to the remote server as a parameter in the <iframe src="...?token=your_super_secret_key"> url.

For more info:

FYI, right now we are developing a premium module, which handles a situation similar to the one you describe (ie. a catalog explorer with remote user authentication), if you might be interested, please try to contact sales at info@gis3w.it for some information about future availability of this extension.

Otherwise, please post some of your code so that everyone else can get a better idea.

👋 Raruto