Интеграция Idam Identity Server с Spring Boot и Spring Security — протокол SAML2 для моего приложения и развертывание мо ⇐ JAVA
Интеграция Idam Identity Server с Spring Boot и Spring Security — протокол SAML2 для моего приложения и развертывание мо
это код конфигурации безопасности SAML:
`пакет in.gov.mca.helpdesk.saml; импортировать org.springframework.beans.factory.annotation.Autowired; импортировать org.springframework.beans.factory.annotation.Value; импортировать org.springframework.context.annotation.Bean; импортировать org.springframework.context.annotation.Configuration; импортировать org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; импортировать org.springframework.security.config.annotation.web.builders.HttpSecurity; импортировать org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; импортировать org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; импортировать org.springframework.security.extensions.saml2.config.SAMLConfigurer; импортировать org.springframework.security.saml.userdetails.SAMLUserDetailsService; @Конфигурация @EnableWebSecurity @EnableGlobalMethodSecurity (securedEnabled = true) общественный класс SAMLSecurityConfig расширяет WebSecurityConfigurerAdapter { @Value("${saml2.metadata-path}") частный String MetadataPath; @Value("${saml2.sp.protocol}") частная строка spProtocol; @Value("${saml2.sp.host}") частная строка spHost; @Value("${saml2.sp.path}") частная строка spBashPath; @Value("${saml2.sp.key-store.file}") частная строка keyStoreFile; @Value("${saml2.sp.key-store.password}") частная строка keyStorePassword; @Value("${saml2.sp.key-store.alias}") частная строка keyStoreAlias; @Value("${saml2.entity-id}") частная строка идентификатор объекта; @Autowired частный SAMLUserDetailsService samlUserService; @Override protected void configure(final HttpSecurity http) выдает исключение { http.csrf().and().authorizeRequests().antMatchers("/helpdesk/").permitAll().anyRequest().authenticated().and().apply(saml())/* .and( ).saml2Login() */; } @Бин public SAMLConfigurer saml() выдает исключение { вернуть SAMLConfigurer.saml().userDetailsService(samlUserService) .serviceProvider().протокол(spProtocol) .hostname(spHost).basePath(spBashPath).keyStore().storeFilePath(keyStoreFile) .keyPassword(keyStorePassword) .keyname(keyStoreAlias) .and().and() .identityProvider() .metadataFilePath(metadataPath).and(); }` Файл application.properties:
saml2.metadata-path=classpath:static/samlauthentication/idammetadata.xml saml2.entity-id=http://172.18.102.233:14100/oam/fed saml2.sp.protocol=http saml2.sp .host=172.18.21.156:8080 saml2.sp.path=/ saml2.sp.key-store.file=classpath:static/samlauthentication/helpdeskkeystore.p12 saml2.sp.key-store.alias=helpdeskmcasamlauth saml2.sp.key -store.password=changeit.
это моя страница контроллера `@Controller общедоступный класс LandingPageController {
@GetMapping("/") индекс публичной строки (модель модели) { // Добавляем любые общие атрибуты модели для целевой страницы model.addAttribute("searchType", "searchfouser"); вернуть «индекс»; // Возвращаем шаблон главной страницы (index.html) } }`
Выше приведен код, который мне нужен для аутентификации SAML для моего приложения службы поддержки на виртуальной машине (сервере). что я делаю при установке maven после того, как будет сгенерирован этот военный файл. Я беру этот военный файл и сохраняю его в папке веб-приложений атома виртуальной машины, и я запускаю URL-адрес
Мне выдается ошибка whitelabel error 505, внутренняя ошибка сервера
Я пробовал изменить несколько кодов, пробовал изменить URL-адрес и различные военные файлы, но все равно получаю ту же проблему: не удается запустить страницу входа в Idam, из-за ошибки whilelabel.
Я ожидаю проверки моего кода на предмет аутентификации Saml для Idam, мне нужно изменить любой код. и любые другие вопросы, дайте мне решение как можно скорее.
введите здесь
это код конфигурации безопасности SAML:
`пакет in.gov.mca.helpdesk.saml; импортировать org.springframework.beans.factory.annotation.Autowired; импортировать org.springframework.beans.factory.annotation.Value; импортировать org.springframework.context.annotation.Bean; импортировать org.springframework.context.annotation.Configuration; импортировать org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; импортировать org.springframework.security.config.annotation.web.builders.HttpSecurity; импортировать org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; импортировать org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; импортировать org.springframework.security.extensions.saml2.config.SAMLConfigurer; импортировать org.springframework.security.saml.userdetails.SAMLUserDetailsService; @Конфигурация @EnableWebSecurity @EnableGlobalMethodSecurity (securedEnabled = true) общественный класс SAMLSecurityConfig расширяет WebSecurityConfigurerAdapter { @Value("${saml2.metadata-path}") частный String MetadataPath; @Value("${saml2.sp.protocol}") частная строка spProtocol; @Value("${saml2.sp.host}") частная строка spHost; @Value("${saml2.sp.path}") частная строка spBashPath; @Value("${saml2.sp.key-store.file}") частная строка keyStoreFile; @Value("${saml2.sp.key-store.password}") частная строка keyStorePassword; @Value("${saml2.sp.key-store.alias}") частная строка keyStoreAlias; @Value("${saml2.entity-id}") частная строка идентификатор объекта; @Autowired частный SAMLUserDetailsService samlUserService; @Override protected void configure(final HttpSecurity http) выдает исключение { http.csrf().and().authorizeRequests().antMatchers("/helpdesk/").permitAll().anyRequest().authenticated().and().apply(saml())/* .and( ).saml2Login() */; } @Бин public SAMLConfigurer saml() выдает исключение { вернуть SAMLConfigurer.saml().userDetailsService(samlUserService) .serviceProvider().протокол(spProtocol) .hostname(spHost).basePath(spBashPath).keyStore().storeFilePath(keyStoreFile) .keyPassword(keyStorePassword) .keyname(keyStoreAlias) .and().and() .identityProvider() .metadataFilePath(metadataPath).and(); }` Файл application.properties:
saml2.metadata-path=classpath:static/samlauthentication/idammetadata.xml saml2.entity-id=http://172.18.102.233:14100/oam/fed saml2.sp.protocol=http saml2.sp .host=172.18.21.156:8080 saml2.sp.path=/ saml2.sp.key-store.file=classpath:static/samlauthentication/helpdeskkeystore.p12 saml2.sp.key-store.alias=helpdeskmcasamlauth saml2.sp.key -store.password=changeit.
это моя страница контроллера `@Controller общедоступный класс LandingPageController {
@GetMapping("/") индекс публичной строки (модель модели) { // Добавляем любые общие атрибуты модели для целевой страницы model.addAttribute("searchType", "searchfouser"); вернуть «индекс»; // Возвращаем шаблон главной страницы (index.html) } }`
Выше приведен код, который мне нужен для аутентификации SAML для моего приложения службы поддержки на виртуальной машине (сервере). что я делаю при установке maven после того, как будет сгенерирован этот военный файл. Я беру этот военный файл и сохраняю его в папке веб-приложений атома виртуальной машины, и я запускаю URL-адрес
Мне выдается ошибка whitelabel error 505, внутренняя ошибка сервера
Я пробовал изменить несколько кодов, пробовал изменить URL-адрес и различные военные файлы, но все равно получаю ту же проблему: не удается запустить страницу входа в Idam, из-за ошибки whilelabel.
Я ожидаю проверки моего кода на предмет аутентификации Saml для Idam, мне нужно изменить любой код. и любые другие вопросы, дайте мне решение как можно скорее.
введите здесь
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Не удалось загрузить тип Sustainsys.Saml2.WebSso.Saml2Module из сборки Sustainsys.Saml2.
Anonymous » » в форуме C# - 0 Ответы
- 29 Просмотры
-
Последнее сообщение Anonymous
-