Code Monkey home page Code Monkey logo

Comments (4)

panva avatar panva commented on May 18, 2024

got it reproduced

from node-openid-client.

panva avatar panva commented on May 18, 2024

Just for reference, my server file.

'use strict';

const Issuer = require('.').Issuer;
const Strategy = require('.').Strategy;

const app = require('express')();
const passport = require('passport');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const cookieSession = require('cookie-session');

Issuer.discover('https://guarded-cliffs-8635.herokuapp.com').then(function (issuer) {
  return issuer.Client.register({
    redirect_uris: ['http://lvh.me:3000/users'],
  });
}).then(function (client) {
  client.CLOCK_TOLERANCE = 5;
  app.use(bodyParser.urlencoded());
  app.use(cookieParser());
  app.use(cookieSession({ secret: 'foo', resave: false, saveUnitialized: true, cookie: { secure: false } }));

  passport.use('oidc', new Strategy(client, (tokenset, done) => {
    console.log(tokenset);
    return done(null, false);
  }));

  app.use(passport.initialize());
  app.use('/users', passport.authenticate('oidc'), function (req, res) {
    res.send('foo');
  });

  app.listen(3000);
});

from node-openid-client.

floydprice avatar floydprice commented on May 18, 2024

When i run the server file above i get a state miss match.

from node-openid-client.

panva avatar panva commented on May 18, 2024

@floydprice too many moving pieces to tell what's wrong, are you getting a state back on your response? can you see it in the authorization response?

from node-openid-client.

Related Issues (20)

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.