Giter VIP home page Giter VIP logo

passport-spid's People

Contributors

bernardini687 avatar giovapanasiti avatar random42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

passport-spid's Issues

Error: Incorrect request format when trying to call /login

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

  1. Update const idp = 'https://posteid.poste.it'
  2. Update privateKey and spCert
  3. Update IPACode to be PA:IT-c_h501
  4. Run example yarn dev
  5. Open http://localhost:4000/login in the browser
  6. Browser navigates to https://posteid.poste.it/jod-fs/ssoservicepost

Error
Error message messaggio di avvisoErrore: Formato richiesta non corretto - Contattare il gestore del servizio appears

Screenshot
Screenshot 2023-05-09 at 23 38 58

getIDPEntityIdFromRequest allowed to return null

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!

tentativo di gestire più IdP

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.