S
S
semexion2018-06-22 13:53:23
Java
semexion, 2018-06-22 13:53:23

How to implement SSO (domain authorization) on the site (JAVA Servlet)?

Добрый день, перерыл весь интернет но не нашел или не понял материала в виду недавнего изучения JAVA, по данному вопросу.
Как реализовать доменную авторизацию на стороне сервера JAVA. Насколько я понимаю сервер должен в ответ на GET запрос посылать HTTP-код 401 «Not Authorized», и в HTTP-заголовках и если сайт находится в интрасети то браузер передает токен.
Как реализовать данный механизм может есть пример или где почитать об этом.
Для серверной части использую Java, в частности Servlet.
В качестве контейнера использую Tomcat 8.
Сама авторизация на ресурсе не совсем нужна, смысл заключается в том что бы получить sign-on ticket для авторизации на Call Manager CISCO путем создания провайдера в сервлете java.
Выдержка из документации:

Single Sign-On
The Single Sign-On feature allows Cisco JTAPI applications to use the single sign-on ticket to
authenticate instead of a user ID and password.
Applications fetch the service ticket for the OpenSSO server from the active directory and then pass the
ticket to Cisco JTAPI in the string used in the getProivder(String str) API. Applications can set the single
sign-on ticket as ssoticket="ssotokenfromad".
Only end users can use this feature.
Applications using this feature need not specify the user ID and password in the getProvider string.
If an application is used by an end user and has the Standard CTI Secure Connection role enabled, then
a user ID is required in the provider string. No password is required.
This solution is designed around an active directory with a Kerberos environment to achieve Windows
desktop Single Sign-On. If an active directory with a Kerberos environment is unavailable, then an
alternate equivalent setup is available, which includes a KDC, an authentication server, and a domain
controller.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Алексей Черемисин, 2018-06-23
@leahch

1) если нужна авторизация на удаленном сервере, то смотреть на pac4j и/или apache shuro.
2) если сервера авторизации нет, то либо свой писать (можно используя п1), либо используйте CAS-сервер типа apereo.
Экзамплов полно во всех двух пунктах.
Ну а по хорошему, если у вас винда-домен, то лучше всего тикеты получать через NTLM. Тоже самое можно сделать на samba.

S
semexion, 2018-06-24
@semexion Автор вопроса

Using javax.servlet.http.* packages can't get a ticket from the browser?
As far as I know, the browser receiving WWW-Authenticate: Negotiate in the response should automatically send a second request to the server but with a ticket?

Similar questions
K
KhanTengri2011-06-17 23:56:41
Get from a remote web page?</a> <a class="content__item-button" href="/q/get-title-from-a-remote-web-page"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class=""> <path fill-rule="evenodd" d="M15 14a1.002 1.002 0 01-1.703.71h-.004l-.003-.01-1.704-1.7H3c-1.104 0-2-.9-2-2V3c0-1.1.896-2 2-2h10c1.104 0 2 .9 2 2v11zM5 6c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1z"></path> </svg> <span class="dark">6</span><span class="dn">Reply</span> </a> </div> </div><div class="content__item"> <div class="content__item-img name-color-Y"> <span>Y</span></div> <div class="content__item-content"> <div class="content__item-row"> <a href="/q/interview-questions-for-self-preparation">YoungSkipper</a><span>2011-06-19 21:30:05</span></div> <a class="content__item-title similar" href="/q/interview-questions-for-self-preparation">Interview questions for self-preparation</a> <a class="content__item-button" href="/q/interview-questions-for-self-preparation"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class=""> <path fill-rule="evenodd" d="M15 14a1.002 1.002 0 01-1.703.71h-.004l-.003-.01-1.704-1.7H3c-1.104 0-2-.9-2-2V3c0-1.1.896-2 2-2h10c1.104 0 2 .9 2 2v11zM5 6c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1z"></path> </svg> <span class="dark">11</span><span class="dn">Reply</span> </a> </div> </div><div class="content__item"> <div class="content__item-img name-color-O"> <span>O</span></div> <div class="content__item-content"> <div class="content__item-row"> <a href="/q/how-to-return-html-page-in-spring-boot">Oleg Mikhailov</a><span>2018-02-17 21:22:44</span></div> <a class="content__item-title similar" href="/q/how-to-return-html-page-in-spring-boot">How to return html page in Spring Boot?</a> <a class="content__item-button" href="/q/how-to-return-html-page-in-spring-boot"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class=""> <path fill-rule="evenodd" d="M15 14a1.002 1.002 0 01-1.703.71h-.004l-.003-.01-1.704-1.7H3c-1.104 0-2-.9-2-2V3c0-1.1.896-2 2-2h10c1.104 0 2 .9 2 2v11zM5 6c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1z"></path> </svg> <span class="dark">1</span><span class="dn">Reply</span> </a> </div> </div><div class="content__item"> <div class="content__item-img name-color-A"> <span>A</span></div> <div class="content__item-content"> <div class="content__item-row"> <a href="/q/how-to-implement-oauth2-authorization-for-clients-with-access-code-type">Alexiuscrow</a><span>2015-10-14 18:09:03</span></div> <a class="content__item-title similar" href="/q/how-to-implement-oauth2-authorization-for-clients-with-access-code-type">How to implement OAuth2 authorization for clients with access code type?</a> <a class="content__item-button" href="/q/how-to-implement-oauth2-authorization-for-clients-with-access-code-type"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class=""> <path fill-rule="evenodd" d="M15 14a1.002 1.002 0 01-1.703.71h-.004l-.003-.01-1.704-1.7H3c-1.104 0-2-.9-2-2V3c0-1.1.896-2 2-2h10c1.104 0 2 .9 2 2v11zM5 6c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1z"></path> </svg> <span class="dark">0</span><span class="dn">Reply</span> </a> </div> </div><div class="content__item"> <div class="content__item-img name-color-A"> <span>A</span></div> <div class="content__item-content"> <div class="content__item-row"> <a href="/q/how-does-a-double-for-loop-work">Andrey Kulagin</a><span>2020-04-24 20:59:10</span></div> <a class="content__item-title similar" href="/q/how-does-a-double-for-loop-work">How does a double for loop work?</a> <a class="content__item-button" href="/q/how-does-a-double-for-loop-work"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class=""> <path fill-rule="evenodd" d="M15 14a1.002 1.002 0 01-1.703.71h-.004l-.003-.01-1.704-1.7H3c-1.104 0-2-.9-2-2V3c0-1.1.896-2 2-2h10c1.104 0 2 .9 2 2v11zM5 6c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1zm3 0c.552 0 1 .45 1 1s-.448 1-1 1-1-.45-1-1 .448-1 1-1z"></path> </svg> <span class="dark">1</span><span class="dn">Reply</span> </a> </div> </div> </div> </div> </div> <div class="content find"> <p class="find__p">Didn't find what you were looking for?</p><a class="find__btn" href="#!">Ask your question</a> </div> <div class="find sm"> <p class="find__title">Ask a Question </p> <form class="find__form" action="#!"> <input class="find__input" type="text" placeholder="Ask your question here"> <button class="find__btn" type="submit"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 16 16" class="nBqR1"><path fill-rule="evenodd" d="M12.696 7.256L9.657 4.217a1 1 0 00-1.415 1.414l1.344 1.344H3.949a1.001 1.001 0 000 2h5.637l-1.344 1.343a1.002 1.002 0 000 1.415c.391.39 1.024.39 1.415 0l3.039-3.04A.993.993 0 0013 7.975a.997.997 0 00-.293-.708l-.011-.011z"></path></svg></button> </form> <p class="find__span">731 491 924 answers to any question</p> </div> </div> <aside class="banners"> <p>banners </p> </aside> </div> </main> </div> <script src="/assets/theme/js/highlight/highlight.min.js"></script> <script src="/assets/theme/js/app.min.js?_v=20220404145216"> </script> <script>hljs.highlightAll();</script> </body> </html>