Comments (3)
Получение профиля через OAuth происходит в строчке https://github.com/meefik/ITMOproctor/blob/master/routes/profile.js#L90
Проверьте настройки авторизации в конфигурационном файле https://github.com/meefik/ITMOproctor/blob/master/config-example.json#L33
Возможно, поменялся формат JSON возвращаемого профиля, тогда это нужно править тут https://github.com/meefik/ITMOproctor/blob/master/db/index.js#L47
from itmoproctor.
cookie
_ym_uid=***;
_ga=***;
openedx-language-preference=ru;
_ym_d=***;
_gid=***;
_ym_isad=2;
edxloggedin=true;
_ym_visorc_47949185=w;
authenticated=true;
_gat_gtag_UA_114846701_1=1;
csrftoken=***;
edx-user-info="{\"username\": \"testuser\"}";
sessionid="***"
routes/profile.js
// OAuth2 strategy (LETIteach)
passport.use('LETIteach', new OAuth2Strategy({
authorizationURL: config.get('auth:LETIteach:authorizationURL'),
tokenURL: config.get('auth:LETIteach:tokenURL'),
clientID: config.get('auth:LETIteach:clientID'),
clientSecret: config.get('auth:LETIteach:clientSecret'),
callbackURL: config.get('auth:LETIteach:callbackURL'),
scope: config.get('auth:LETIteach:scope')
}, function(accessToken, refreshToken, prof, done) {
var userProfileURL = config.get('auth:LETIteach:userProfileURL');
this._oauth2._useAuthorizationHeaderForGET = true;
this._oauth2.get(userProfileURL, accessToken, function(err, body, res) {
if (err) {
var InternalOAuthError = require('passport-oauth').InternalOAuthError;
return done(new InternalOAuthError('failed to fetch user profile', err));
}
try {
db.profile.auth.LETIteach(JSON.parse(body), done);
}
catch (e) {
done(e);
}
});
}));
router.get('/LETIteach', passport.authenticate('LETIteach'));
router.get('/LETIteach/callback', passport.authenticate('LETIteach', {
failureRedirect: '/#login'
}), router.logUserIP, function(req, res, next) {
res.redirect('/');
});
config.js
"auth": {
"LETIteach": {
"authorizationURL": "https://open.etu.ru/oauth2/auth",
"tokenURL": "https://open.etu.ru/oauth2/token",
"userProfileURL": "https://open.edu.ru/oauth2/user_info",
"clientID": "test",
"clientSecret": "test",
"callbackURL": "https://proctor.etu.ru/profile/LETIteach/callback",
"scope": "openid profile email"
},
db/index.js
LETIteach: function(prof, done) {
var userData = {
username: prof.username,
provider: config.get('auth:LETIteach:provider') || 'LETIteach'
};
var User = require('./models/user');
User.findOne({
username: userData.username,
provider: userData.provider
}).exec(function(err, data) {
if (err) {
return done(err);
}
if (!data) {
var user = new User(userData);
user.save(function(err, data) {
return done(err, data);
});
}
else {
if (!data.isActive()) {
return done(null, false, {
message: 'User is inactive.'
});
}
return done(null, data);
}
});
},
Ситуация на данный момент. Ошибка прежняя
from itmoproctor.
Попробуйте связаться с разработчиками из ИТМО, они поддерживают форк https://github.com/openeduITMO/ITMOproctor
Я больше не занимаюсь поддержкой этого проекта.
from itmoproctor.
Related Issues (20)
- Расширение полнотекстового поиска
- Возможность работы без UDP протокола HOT 1
- Сохранение временной метки при записи студентом на экзамен HOT 2
- В форму "Профиль пользователя" добавить поле "Месторасположение" HOT 1
- Проблема с сортировкой в таблице экзаменов проктора
- Модульная архитектура приложения HOT 1
- Переход на Kurento 6
- Добавить интерфейс администратора HOT 1
- Добавить расширение Chrome для поддержки работы в браузере
- Добавить установку zip в интсрукцию
- High severity vulnerability affecting this repo HOT 1
- Error: Cannot find module 'error-tojson' HOT 12
- add SSL udp-proxy problem HOT 14
- cannot run in wd [email protected] HOT 1
- после npm start в консоли ошибок нет, но пустая страница по localhost:3000 с title "ITMOproctor" HOT 5
- Failed to query stereo recording. HOT 1
- Proctoring Client Side Apps HOT 1
- Не появляется кнопка "Войти через OpenEDU" на Linux
- Не появляется кнопка войти через OpenEDU | M1 Pro
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itmoproctor.