Release notes: (v5.6)
v5.6.1:
- Allow to override the “computation” of the defaultUrlin theDefaultLogoutLogic
- Security fix on the logoutUrlPattern
v5.6.0:
- Added a new pac4j-springbootv3module for Spring Boot v3 (JDK 17)
- Can control if the CSRF token is added as an attribute (trueby default), as a header (falseby default) or as a cookie (trueby default) for theCsrfTokenGeneratorMatcher
- Removed all javax.annotation.Nullableandjavax.annotation.Nonnullreferences from thepac4j-samlmodule
- Added the JEEAdapterclass in thepac4j-coremodule based on theJEEAdapterImplclass in thepac4j-javaeeorpac4j-jakartaeemodule
- Removed unwanted “javax” dependencies
- Removed any org.jasig.cas.client.util.CommonUtilsusage from thepac4j-casmodule
- Added a addClientmethod to theClientscomponent
- Made the Configparameter optional for theSecurityEndpointBuilder
v5.5.0:
- Allow to override a default Matcher(even thesecurityheadersshortcut)
- Remove the deprecated pac4j-jeemodule
- Allow to include paths for the PathMatcher
- Add the Pac4jConstants.EMPTY_STRINGconstant
- Can set the content on the BadRequestAction,ForbiddenAction,StatusActionandUnauthorizedActionactions
- Add the new concept of SessionStoreFactoryto replace any directSessionStoreinstantation
- Add a SecurityEndpointBuilderto help build configuration for security endpoints from multiple parameters
- Improve (SAML) user attribute types handling
- Use destroySessionBackonDefaultLogoutHandlerwhen session can’t be inferred from the Logout Request’s context
- Fix “nosuchelement error” on SessionStore.getSessionId(context, true)
v5.4.6:
- Disable JWT access token parsing by default, use OidcConfiguration.setIncludeAccessTokenClaimsInProfileto re-enable.
- Upgrade nimbus-jwt to v9.24.2
- Deprecate the static methods: Config.set|defaultProfileManagerFactory(name,ProfileManagerFactory)in favor of the class methods:config.set|defaultProfileManagerFactory(ProfileManagerFactory). Add theconfig.defaultSessionStore(SessionStore)method
v5.4.5:
- Deprecated the new PathMatcher(regex)constructor
- Fix NPE on JWT access token parsing
v5.4.4:
- Fixes the behavior of the RequireAnyRoleAuthorizerandRequireAnyPermissionAuthorizerwith no roles or permissions
- Allows the DefaultSAML2MetadataSignerto accept aSAML2Configuration
- Fixes pac4j-springbootdependencies
- OIDC support: collect claims from the access token if it is a valid JWT
v5.4.3:
- Fix CVE-2022-22968
v5.4.2:
- Fix CVE-2022-22965
v5.4.0:
- Deprecated the pac4j-jeedependency (JEE components in theorg.pac4j.coreandorg.pac4j.samlpackages, based on thejavax.servlet-apilibrary v4) to be replaced by:- the pac4j-javaeedependency (JEE components in theorg.pac4j.jeepackage, based on thejavax.servlet-apilibrary v4) or
- the pac4j-jakartaeedependency (JEE components in theorg.pac4j.jeepackage, based on thejakarta.servlet-apilibrary v5)
 
- the 
- Refactored the SAML2 attributes conversion (from the SAML2 authn response) to rely on a defined AttributeConverterat theSAML2Configurationlevel
- Implemented RFC 9207 OAuth 2.0 Authorization Server Issuer Identification in pac4j-oidc
v5.3.1:
- Added Cronofy support (OAuth v2)
- Fully fix CVE-2021-44878 by checking the OIDC response type when creating the token validator
v5.3.0:
- InitializableObject: the number of attempts and the last attempt time are tracked and checked with the max attempts and the min time interval between attempts (for the CAS implementation)
- InitializableObject: allow re-initialization
- Refactor the CasOAuthWrapperClientconfiguration
v5.2.1:
- Update log4j-to-slf4jandlog4j-apito v2.17.0 although onlylog4j-corehas security vulnerabilities
v5.2.0:
- The JEE core components are now in the pac4j-jeedependency (and no longer in thepac4j-coredependency)
- CVE-2021-44878: reinforce security on the OIDC protocol support: the nonealgorithm must be explicitly accepted on client side (allowUnsignedIdTokens)
v5.1.5:
- Fixed a NPE on the SAML2AuthnResponseValidator
- Added the setExpiration(Date)method on theOidcProfile
- Fixed the expireSessionWithTokenbehavior for theOidcProfile
- Set the secureandhttpOnlyflag totruefor the CSRF cookie
- Fix multi-values attribute duplication in SAML2Profile
v5.1.4:
- SAML2 configuration can now accept custom socket factories and hostname verification options
- Ability to ignore an existing authentication via the loadProfilesFromSessionflag at the security filter level.
v5.1.3:
- Treat SAML partial logout responses as success
v5.1.2:
- Support SAML2 Scopingin authentication requests
- WebContextis now able to provide the request url directly
- Fix SAML2 response attributes resolution when using ADFS as IdP
- Add claims mapping for the OIDC support.
v5.1.1:
- Removed the ORCID OAuth client which no longer works. Use the OidcClientinstead
- Fixed PKCE OIDC flow support
- Properly parse SAML complex attributes
- For the CAS server OIDC support: allow to disable the checking of authentication attempts
v5.1.0:
- SAML2 identity provider metadata resolver can optionally be forced to download the metadata again.
- SAML2 identity provider metadata resolver is given the ability to support last-modifiedattributes for URLs.
- SAML2 response validation can now disable the validation of authnInstantby assigning a zero/negative value toSAML2Configuration#configuration.setMaximumAuthenticationLifetime(). This setting should not be using sparingly.
- Clients can be changed at any time in the Clientscomponent
v5.0.1:
- Hazelcast-based implementation for SAMLMessageStore
- Added an option to tolerate missing SAML response Destinationattribute
- SAML support: don’t add the friendly name if it is the same as the (mapped) name (avoid duplication of values)
- Improve JWT parsing for nested attributes
v5.0.0 (see: what’s new in pac4j v5?):
- Upgraded to JDK 11
- Removed the pac4j-saml-opensamlv3andpac4j-openidmodules
- Removed deprecated methods and classes
- Removed most generics
- Slightly refactored the auto-initialization
- Refactored the session management (mainly ProfileManagerandSessionStore): reading in the web session does not create it while writing a none-null value in the session always create it. The multi-profile and save-profile-in-session-or-not options can now be defined at theClientlevel, and no longer in the “security filter” and “callback endpoint”. Theget(readFromSession)andgetAll(readFromSession)methods of theProfileManagerare replaced by thegetProfile()andgetProfiles()methods
- The SAML central logout does not perform any local logout
- When no authorizers is defined, one of the default authorizers is isAuthenticatedif theAnonymousClientis not used
- Serialize profiles in JSON (instead of using the Java serialization) for the MongoDB, SQL, LDAP and CouchDB ProfileServicesupports; Added aJsonSerializerand turned theJavaSerializationHelperinto aJavaSerializer; Removed theProfileServiceSerializer
- Removed the 307 HTTP code for a new POST request after a POST request (use 200 instead)
- Turned the UserProfilecomponent into a pure interface and use it as much as possible (especially in theJwtGeneratorandJwtAuthenticator)
- The ProfileHelper.restoreOrBuildProfilemethod has been removed and the behavior is controlled by theProfileDefinitionand itssetRestoreProfileFromTypedIdmethod (enabled for JWT, disabled for others)
- Authorizers and matchers can be defined additionaly with “+”
- CSRF security improvements proposed by Xhelal Likaj (https://github.com/xhlika): longer CSRF token values (32 bytes), CSRF tokens generated per HTTP request and with an internal expiration date (4 hours), CSRF token verification protected against time-based attacks
- Improved responses for unauthenticated users: 401 with “WWW-Authenticate” header or 403 to be compliant with the HTTP spec
- Default authorizers and matchers can be re-defined by users
- Separate the SessionStorefrom theWebContext
- Signing operations for SAML2 metadata can now be done using the existing default method or via XMLSec. The choice for the signer component can be decided via SAML2Configuration.
- Ability to specify the SAML2 SLO url in the SAML2Configurationand metadata.
- Options in SAML2Configurationto determine how to URLs should be compared when doing endpoint verifications with SAML2 responses.
- SAML2 logout validation can be given an expected destination so as to not just rely on the SLO endpoint defined in the SAML2 metadata.
- SAML2 requested authentication context class refs are now checked and enforced again in SAML responses.
- The presence of NameIDelements in SAML2 responses is now made optional, if theSAML2Configurationis configured to build the final credential using a SAML2 attribute found in the assertion. If the attribute is not found or is undefined,NameIDis expected as the default.
- Handle the “same site policy” in cookies (default: lax). RenamedContextHelperasWebContextHelper
- Authentication requests for protocols that support forced/passive authentication can now be modified on a per-request basis using pre-defined HTTP attributes to control the type of authentication request sent to the provider.
 The 4.x stream is no longer maintained except via the LTS program.
v4.5.7:
- Security fix on the logoutUrlPattern
v4.5.6:
- 
    Fix CVE-2022-22965 
- v4.5.5:
- Fix CVE-2021-44878
v4.5.4:
- Update log4j-to-slf4jandlog4j-apito v2.17.0 although onlylog4j-corehas security vulnerabilities
v4.5.1:
- Removed the ORCID OAuth client which no longer works. Use the OidcClientinstead
- Fixed PKCE OIDC flow support
v4.5.0:
- SAML2 identity provider metadata resolver can optionally be forced to download the metadata again.
- SAML2 identity provider metadata resolver is given the ability to support last-modifiedattributes for URLs.
- Improve JWT parsing for nested attributes
- Avoid NPE with nulldomain for cookies onJEEContext
v4.4.0:
- For SAML IdP metadata defined as files, the metadata are reloaded if the file is changed
v4.3.0:
- Added a ChainingConverterfor attributes
- Fix expired access tokens for the OIDC protocol
v4.2.0:
- Apple SignIn support (OIDC protocol)
- Serialize profiles in JSON (instead of using the Java serialization) for the MongoDB, SQL, LDAP and CouchDB ProfileServicesupports
v4.1.0 (see: what’s new in pac4j v4.1?):
- The RememberMeAuthorizationGeneratoris deprecated and will be removed in the next version (v5)
- The OpenID support (YahooOpenIdClient) is deprecated and will be removed in the next version (v5)
- The ProfileManagerFactory2is deprecated and will be removed in the next version (v5)
- Removed the InternalAttributeHandler
- The default matchers/authorizers are securityHeaders/nonefor web services instead ofcsrfToken,securityHeaders/csrfCheckfor web applications
v4.0.3:
- Fix the expiration date for the SAML generated certificate
- Added a new ValueRetrieverinterface and its implementationSessionStoreValueRetrieverfor the OpenID Connect protocol
- Added support for PKCE to the OpenID Connect protocol RFC-7636
- Improved handling of expired tokens in OidcProfile
v4.0.2:
- Fix the ClassCastExceptionwhen receiving a SAML logout response
- Send the access token as a header for the GithubClient
- CAS front channel logout: fix the 401 error after the logout
- Fix default CallbackUrlResolverinCasClient
v4.0.1:
- Type parameters: add the ? extends Credentialstype parameter for theClientin the return type of the methodfindof theClientFinderand add theUserProfiletype parameter for theProfileManagerin the return type of thegetProfileManagermethod of theProfileManagerFactoryAware*
- Add setters on Color
- Pull the pac4j-saml-opensamlv3dependency instead of thepac4j-samldependency
- Remove deprecated behaviors: the retrieval of one CommonProfilein request or session via theProfileManagerand the retrieval of aStringas the requested URL
- The default client name parameter used for security has a new value (force_client) to avoid conflicting with the default client name parameter (client_name) used on the callback (the old value is still used as a fallback, but will be removed)
- Allow pac4j-samlto store and generate SAML metadata and keystores using a REST API and provide options for extensibility so custom components can be designed and injected to manage metadata artifacts externally. Resolution of SAML2 identity provider metadata can be controlled/overridden.
- Handle a strange use case for the JEEContextwhere therequest.getRequestURI()returns a path starting by a double slash
- Can return a custom profile when the authentication fails or is cancelled (“silent login”)
- Fix the CAS logout URL computation (for central logout without prefix)
- Introduce the WebContextFactoryconcept and theJEEContextFactoryimplementation
v4.0.0:
- Improved the profile manager configuration
- Renamed J2Ecomponents asJEE
- Started updating dependencies via Renovate
- A client can return any kind of profile (using a custom AuthorizationGeneratororProfileCreator) and even a minimal user profile (UserProfile)
- HTTP actions are no longer applied automatically to the web context (the setResponseStatusandwriteResponseContentmethods have been removed from theWebContextinterface), anHttpActionAdaptermust be used for that. Multiple HTTP actions (inheriting fromHttpAction) are created to handle the necessary HTTP actions. TheRedirectActionis replaced by the new HTTP actions inheriting fromRedirectionAction. Theredirectmethod is renamed asgetRedirectionAction
- By default, the CSRF check applies on the PUT, PATCH and DELETE requests in addition to the POST requests
- Renamed the SAMLMessageStorage*classes asSAMLMessageStore*(based onStore)
- For Google2Client, change profile URL fromhttps://www.googleapis.com/plus/v1/people/metohttps://www.googleapis.com/oauth2/v3/userinfo. This change is to prepare for the shutdown of Google plus API. This change will remove thebirthdayandemailsattribute forGoogle2Client.
- For an AJAX request, only generates the redirection URL when requested (addRedirectionUrlAsHeaderproperty of theDefaultAjaxRequestResolver)
- Updated the APIs to use Optionalinstead of returningnull
- Use the 303 “See Other” and 307 “Temporary Redirect” HTTP actions after a POST request (RedirectionActionHelper)
- Handles originally requested URLs with POST method
- Add HTTP POST Simple-Sign protocol implementation
- Properly handle states and nonces for multiple OIDC clients
- A profile can be renewed by its client when it’s expired
- Most web authorizers are now matchers. The default matchers are “securityHeaders,csrfToken” and the default authorizer is “csrfCheck”. Use “none” for no matcher or authorizer
- Use the FindBestutility class to find the best adapter, logic…
- Support for the OIDC back-channel and front-channel logouts
- Load the profiles in the ProfileManager(from the session or not) like in theDefaultSecurityLogicvia thegetLikeDefaultSecurityLogicandgetAllLikeDefaultSecurityLogicmethods
- REVERT: remove the ID token in the removeLoginDatamethod (previouslyclearSensitiveData)
- The pac4j-samlmodule is saved as the legacypac4j-saml-opensamlv3module and upgraded to JDK 11 and OpenSAML v4