Enterprise software, security and engineering notes
SSO and Session Security in Customer Portals: A Foundational Approach for Enterprise Applications
Security ·
Author: Abdulsamet Ok
Editors: Ege ÜLKER, Abdulsamet Ok
What Is SSO and Why Does It Matter in Enterprise Portals?
Enterprise customer portals, B2B platforms and management panels are more than screens where users sign in. These applications usually provide access to customer information, financial data, operational records, reports and critical business processes.
That is why reducing the security approach to the question “are the username and password correct?” is not enough.
In a modern customer portal, alongside authentication, how the session is started, how long it stays open, how tokens are refreshed, how the user is signed out and whether additional verification is required for critical operations are all essential parts of the security architecture.
In this article we cover SSO, the token lifecycle, session management, secure logout and step-up authentication in enterprise customer portals, focusing on the core principles.
• • •
Single Sign-On (SSO) is a structure that lets a user access multiple systems or applications with a single authentication step.
For example, once an employee or business partner signs in through the organisation’s central identity provider, they can access the customer portal without entering a password again.
One of the most important advantages of SSO is that it reduces the need for users to create separate passwords for different systems. This improves the user experience and helps reduce risks such as password reuse, weak password choices and password management overhead.
There is an important point here, however:
- Using SSO alone does not make an application secure.
- How the session created after SSO is managed matters at least as much as authentication itself.
• • •
Central Authentication Simplifies Security Management
In enterprise environments, having each application manage its own username
and password system can become complex over time.
When an employee leaves
the company or a partner’s access needs to be revoked, separate actions may be
required across multiple systems.
With a central identity provider, user access can be managed in a much more controlled way.
Identity systems built on widely adopted standards such as OpenID Connect, OAuth 2.0 and SAML help integrate enterprise applications with central identity infrastructures.
User verification can then be handled by an identity infrastructure specialised in this area rather than being kept inside the application itself.
• • •
Token Security Is the Invisible Side of SSO
After a user signs in, applications typically work with tokens that represent the user’s session.
Two fundamental building blocks are usually involved:
The Access Token allows the user to access specific resources.
The Refresh Token helps obtain a new access token when the current one expires, without asking the user to sign in again.
The security balance here is very important.
If an access token remains valid for too long, an attacker who obtains it can use the system for a longer period.
If the token lifetime is too short, the user experience suffers and users are forced to re-authenticate unnecessarily often.
For this reason, enterprise applications should not pick token lifetimes arbitrarily; a token lifecycle policy should be defined according to the system’s risk level.
• • •
How Should the Token Lifecycle Be Designed?
When a token is created, answering “when does it expire?” is not enough on its own.
The conditions under which the token can be renewed, when it is fully invalidated and how changes to user permissions are reflected in active sessions should also be considered.
For example, when a user’s access is revoked, a long-lived token created earlier should not remain usable for hours.
Similarly, when a user’s password changes or suspicious activity is detected on the account, open sessions may need to be terminated.
A secure session architecture should clearly define the access token lifetime, refresh token lifetime, renewal policies, inactivity timeout, maximum session duration, permission changes and suspicious sign-in scenarios.
Defining these policies while the system is being built helps reduce security risks that could emerge later.
• • •
Why Refresh Token Rotation Matters
Because refresh tokens are usually valid for longer than access tokens, they must be protected more carefully.
One of the common methods in modern security architectures is refresh token rotation.
In this approach, every time a refresh token is used, a new refresh token is issued and the old one is invalidated.
This prevents a previously used refresh token from being replayed if it has been compromised.
Especially in customer portals that require high security, token rotation and token revocation mechanisms form an important security layer.
• • •
Session Duration Must Balance User Experience and Security
One of the fundamental problems in session management is the balance between security and ease of use.
If a session is too short, users may have to sign in repeatedly.
If it is too long, the portal can remain accessible even after the user has walked away from the computer.
That is why two different duration concepts are usually considered together.
Idle Timeout means the session ends when the user has not performed any action for a certain period.
Absolute Timeout requires re-authentication after a certain total duration, even if the user is actively using the system.
Particularly in enterprise systems holding financial or sensitive data, sessions staying open for uncontrolled periods is a security concern that must be addressed.
• • •
“Remember Me” Must Be Designed Carefully
Many applications offer a “Remember Me” option to improve the user experience.
In enterprise systems, however, this feature must be designed with care.
Using “Remember Me” should not mean the active session stays open indefinitely.
Instead, a long-lived but controlled authentication mechanism can be used. The user’s device, session history and risk level can be evaluated and re-authentication requested when necessary.
It should be remembered that persistent session mechanisms pose a greater risk on shared computers.
• • •
Secure Logout Is More Than Pressing the “Logout” Button
In many applications, logging out is implemented simply as clearing the user information held in the browser.
In systems using SSO, this approach is not always sufficient.
When a user signs out of the portal, the application’s own session may end while the session at the central identity provider continues.
In that case, when the user reopens the portal they can sign in again without entering a password.
In enterprise applications this behaviour must be designed deliberately.
Whether “Log Out” signs the user out of the application only or of the central identity session as well should be decided explicitly according to product and security policies.
• • •
Session Management Across Multiple Tabs
One frequently encountered but often overlooked scenario in web applications is the multiple browser tab problem.
For example, a user may have the customer portal open in three different tabs.
If they press “Log Out” in the first tab while the other two keep behaving as if a session is still open, the result is confusing for the user and risky from a security standpoint.
Ideally, session changes should be reflected across open tabs as consistently as possible.
When a user signs out in one tab, actions in the other tabs should recognise that the session is no longer valid and redirect the user safely to the sign-in screen.
• • •
Where Should Tokens Be Stored?
One of the critical security topics in web applications is how tokens are stored on the client side.
Keeping long-lived credentials in storage areas that are easily accessible from the client can amplify the impact of other vulnerabilities in the application.
When designing the architecture, which data is kept in the browser, which data JavaScript can access and how cookie security settings are configured should be evaluated carefully.
In cookie-based setups, attributes such as HttpOnly, Secure and SameSite should be used correctly, and protection against web application attacks such as CSRF and XSS must be designed separately.
What matters here is not using a particular technology but building a session architecture that fits the application’s threat model.
• • •
Authorisation Is Not the Same as Authentication
A common mistake in security design is assuming that because a user has signed in, they are authorised to perform every operation.
Authentication verifies who the user is.
Authorisation determines which operations that user may perform.
Even after successfully signing in to a customer portal, a user should only be able to access their own company, their own customers or the resources assigned to them.
This is why tenant isolation is critical, especially in multi-tenant SaaS and B2B systems.
One customer being able to access another customer’s data is one of the most serious security problems a system can have.
• • •
Sessions Must Be Traceable
Audit logging and traceability are also important parts of enterprise security.
Recording who performed critical operations, when and through which session can provide vital information during incident investigations.
Successful and failed sign-in attempts, sign-in and sign-out events, permission changes, critical account activity and suspicious behaviour can be recorded in line with security policies.
The logging system itself can contain sensitive information, however.
Passwords, full token values or unnecessary personal data must not be written to logs.
• • •
A Layered Approach to a Secure Customer Portal
Customer portal security is not something a single technology can solve.
Using SSO can be an important step, but a secure system requires authentication, session management, token policies, authorisation, MFA, secure logout, monitoring and application security to be considered together.
When designing the security architecture of an enterprise portal in particular, the answers to the following questions should be clear:
- How does a user sign in to the system?
- How does the session continue?
- How are their permissions checked?
- How are they verified for critical operations?
- When they sign out, does their access really end?
An architecture that can answer each of these questions clearly strengthens the security foundation of the customer portal significantly.
• • •
Security Is a Process, Not a Feature
Security work is not finished when a customer portal goes live.
New threats, changing user needs, infrastructure updates and new integrations require security policies to be re-evaluated continuously.
SSO configurations, token lifetimes, access policies, user roles, dependencies and security logs should be reviewed regularly.
Because in enterprise applications, security is not only about protecting the sign-in.
It is about ensuring that the right user accesses the right resource at the right time with the right permissions, and that this access ends securely when it should.
Subscribe to blog and news
Get an email when we publish. Unsubscribe any time.
Related posts
Software Buyer Guides
Gaziantep Software Partner: Export ERP, e-Invoicing and B2B Portals
A guide to Gaziantep software needs for textile, carpet and food exporters: export ERP, e-invoice and customs integration, multi-plant production and B2B dealer portals.
Software Buyer Guides
Malatya Software Partner: Apricot Exports, Traceability and Business Continuity
How Malatya software projects can support apricot processing and exports, OIZ textiles and post-earthquake rebuilding: traceability, export documents, cloud backups and business continuity.