Инструкция для подключения авторизации https://trusted.plus/id в системе moodle.
-
Зарегистрируйте свое приложение в https://trusted.plus/id
-
Перейдите в Ваш портал moodle на вкладку
Site administration > Server > OAuth 2 servicesи нажмите кнопкуCreate new custom services. -
Заполните форму
- В поле
Client IDвведите Client ID приложения, созданного на сервисе IDTrustedPlus. - В поле
Client secretвведите пароль от приложения, созданного на сервисе IDTrustedPlus. - В поле
Scopes included in a login requestиScopes included in a login request for offline accessвведите значениеuserprofile. - Поставьте галочки напротив пунктов:
Authenticate token requests via HTTP headers,Show on login page.
- В поле
-
Во вкладке
OAuth 2 services, справа от названия созданного Вами сервиса, нажмите на кнопкуConfigure endpointsи заполните полня:- Name:
authorization_endpoint, URL:https://id.trusted.plus/idp/sso/oauth/authorize. - Name:
token_endpoint, URL:https://id.trusted.plus/idp/sso/oauth/token. - Name:
userinfo_endpoint, URL:https://id.trusted.plus/trustedapp/rest/user/profile/get.
- Name:
-
Во вкладке
OAuth 2 services, справа от названия созданного Вами сервиса, нажмите на кнопкуUser field mapping:- External field name:
data-givenName, Internal field name:firstname. - External field name:
data-familyName, Internal field name:lastname. - External field name:
data-email, Internal field name:email. - External field name:
data-phone, Internal field name:phone1. - External field name:
data-login, Internal field name:username.
- External field name:
-
Перейдите на вкладку
Site administration -> Plugins -> Authenticationи включитеOAuth 2, нажав на кнопкуEnable. -
Во вкладке
OAuth 2 servicesнажмите на кнопкуConnect to a system accountи пройдите авторизацию.
После выполнения всех действий на вашем портале moodle появится кнопка входа через ID.Trusted.Plus