Single Sign-On w wielu aplikacjach
Dowiedz się, jak OAuth2 i OpenID Connect umożliwiają Single Sign-On, dzięki czemu użytkownicy uwierzytelniają się raz i płynnie korzystają z wielu aplikacji.
Single Sign-On w wielu aplikacjach to bezpłatna lekcja OAuth2 & OpenID Connect Deep Dive na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej OAuth2 & OpenID Connect Deep Dive, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs OAuth2 & OpenID Connect Deep Dive zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
What Is SSO?
Single Sign-On lets a user authenticate once with a central identity provider and then access many applications without logging in again. OpenID Connect is the modern foundation for web and mobile SSO.
The Central Session
The magic lives at the OpenID Provider (OP). When the user logs in, the OP establishes its own session (often a cookie). Each app relies on that central session rather than maintaining its own credentials.
First App Login
App A redirects the user to the OP's /authorize endpoint. The user enters credentials, the OP sets its session cookie, and returns an authorization code to App A, which exchanges it for tokens.
Second App: Silent Login
Later the user opens App B, which also redirects to /authorize. Because the OP session cookie already exists, the OP recognizes the user and returns a code without prompting for credentials again. That is the SSO experience.
prompt=none
To check silently whether a session exists, apps can use prompt=none. The OP either returns a code immediately or an error like login_required if no session is present.
GET /authorize?response_type=code
&client_id=appB&scope=openid
&redirect_uri=https://b.example.com/cb
&prompt=noneForcing Re-authentication
Conversely, sensitive operations can require a fresh login with prompt=login or a max_age constraint, overriding the SSO session for that request.
Identity Provider Federation
The OP itself may federate to upstream providers (corporate IdP, Google, social logins). To the apps it still looks like one OP, but the OP brokers authentication to the chosen source. This centralizes policy and simplifies clients.
Single Logout
SSO needs Single Logout too: when the user signs out of one app, related sessions should end. OIDC offers front-channel and back-channel logout to notify participating apps and clear the central session.
Session Token Lifetimes
Balance convenience and security: short access tokens with refresh tokens for ongoing access, and an OP session lifetime that matches your risk tolerance. Long SSO sessions are convenient but widen the impact of a compromised device.
Native and Mobile SSO
On mobile, SSO uses the system browser (ASWebAuthenticationSession / Custom Tabs) so the OP cookie is shared across apps. Embedded WebViews break SSO and are discouraged for security and usability reasons.
Benefits and Risks
SSO improves UX, centralizes MFA and auditing, and reduces password fatigue. The trade-off: the OP becomes a high-value target, so it must be hardened, monitored, and protected with strong authentication.
Quick Check
Test your SSO understanding.
Recap
Single Sign-On centralizes authentication at the OpenID Provider.
- The OP session lets subsequent apps log in silently.
prompt=nonechecks for a session;prompt=login/max_ageforce re-auth.- Single Logout coordinates ending sessions across apps.
- Use the system browser, not embedded WebViews, for mobile SSO.
Często zadawane pytania
Czy lekcja „Single Sign-On w wielu aplikacjach” jest bezpłatna?
Tak — pełny tekst „Single Sign-On w wielu aplikacjach” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu OAuth2 & OpenID Connect Deep Dive, przejdź na CoddyKit PRO. Kurs OAuth2 & OpenID Connect Deep Dive zawiera 4 lekcji w sumie.
Co nauczysz się w „Single Sign-On w wielu aplikacjach”?
Dowiedz się, jak OAuth2 i OpenID Connect umożliwiają Single Sign-On, dzięki czemu użytkownicy uwierzytelniają się raz i płynnie korzystają z wielu aplikacji. Ćwiczysz OAuth2 & OpenID Connect Deep Dive z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć OAuth2 & OpenID Connect Deep Dive?
Nie wymagamy żadnego doświadczenia. OAuth2 & OpenID Connect Deep Dive w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.
Ile czasu zajmuje lekcja „Single Sign-On w wielu aplikacjach”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji OAuth2 & OpenID Connect Deep Dive?
Tak. Każda lekcja OAuth2 & OpenID Connect Deep Dive zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Integracja z dostawcami tożsamości
- Bezpieczeństwo mikrousług i bram API
- Uwierzytelnianie wieloskładnikowe (MFA)
- Single Sign-On w wielu aplikacjach