例如 webapp 中使用:
import passport from 'passport';
import openidStrategy from 'passport-openid';
passport.use(new openidStrategy({
callbackURL: config.creds.returnURL,
clientID: config.creds.clientID,
clientSecret: config.creds.clientSecret
},
function(done) {
//....
}
)
app.get('/login',
passport.authenticate('openidconnect', { failureRedirect: '/login' }),
function(req, res) {
res.redirect('/');
});
那React-Native 项目中呢?