random42 / passport-spid Goto Github PK
View Code? Open in Web Editor NEWPassport strategy for SPID (italian citizens) authentication
License: MIT License
Passport strategy for SPID (italian citizens) authentication
License: MIT License
Hi,
I've just noticed one error happened to me while using example.ts
. I am not sure the root cause of this issue. Could you please help me to understand the issue?
Steps
const idp = 'https://posteid.poste.it'
privateKey
and spCert
IPACode
to be PA:IT-c_h501
yarn dev
http://localhost:4000/login
in the browserhttps://posteid.poste.it/jod-fs/ssoservicepost
Error
Error message messaggio di avvisoErrore: Formato richiesta non corretto - Contattare il gestore del servizio
appears
If the getIDPEntityIdFromRequest()
method will be called even for metadata generation it should be allowed to return a null (or an undefined) also in the types.
export interface SpidConfig extends StrategyOptions {
saml: SpidSamlConfig;
spid: {
serviceProvider: ServiceProvider;
IDPRegistryMetadata: string;
// getIDPEntityIdFromRequest: (req: Request) => string | Promise<string>;
getIDPEntityIdFromRequest: (req: Request) => (string | null) | Promise<string | null>;
authnContext: SpidLevel;
};
cache: Cache;
}
Looking into the MultiSamlStrategy when generating SP metadata it passes an {}
as Request so it could be better improved detecting this call in some way. I'll try something...
Ottimo lavoro, ottima libreria. Bravo!
ciao!
sto tentando di gestire due diversi IdP offerti da spid-saml-check
(https://localhost:8443
e https://localhost:8443/demo
).
ho inserito entrambi i metadata degli IdP in un singolo registro xml e provando a chiamare strategy.getIDPS()
li vedo parsati correttamente.
per scegliere l'IdP dalla chiamata di login ho implementato getIDPEntityIdFromRequest()
in questo modo:
function getIDPEntityIdFromRequest(expressRequest) {
const entityID = expressRequest.query?.entityID;
if (entityID && IDP_ENTITY_IDS.includes(entityID)) {
console.log(`Chosen IdP: "${entityID}"`);
return entityID;
}
console.log(`Unkown IdP: "${entityID}"`);
console.log(`Defaulting to: "${TEST_IDP}"`);
return TEST_IDP;
}
il problema che sto incontrando è nella callback che avviene dopo il login con l'IdP https://localhost:8443/demo
poiché mi sembra di capire che anche durante la callback viene chiamata la funzione sopra, questa volta senza parametro nella query e quindi, facendo default a un altro IdP, ottengo l'errore: Invalid Issuer "https://localhost:8443/demo"
.
non riesco a trovare una soluzione su come, nella callback, poter risalire all'IdP verso cui è stata originata la richiesta 🤔
ringrazio in anticipo per qualsiasi delucidazione in merito, sono alle prime armi con l'integrazione di SPID e questa mi è sembrata la libreria più user-friendly tra le altre in JS, ottimo lavoro!
Error: Provider 'https://localhost:8443' not found at SpidStrategy.<anonymous> (D:\prj\xxx\node_modules\passport-spid\dist\src\strategy.js:66:23)
any info about this? this happens when i run the example
Thanks in advance
Giuseppe
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.