You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Added
Introspection::isMachine(): whether a token is an app acting as itself (client_credentials): active, its subject is its client id, and it carries no act claim. A token issued to a person through an app also carries that app's client_id; ask this before treating client_id as the caller's identity. See Access tokens.
WebRedirectUri::loopbackWithoutPort() and WebRedirectUri::isCanonicalLoopback(): the one matcher for the loopback port exception, for a host whose own /authorize floats a loopback port.
Changed
MagicLinkService takes an optional trailing MailboxProof, and InvitationService optional trailing Subjects and MailboxProof. Both resolve them from the container when omitted; their other constructor parameters are unchanged.
SamlIdentityProviderService takes a trailing Subjects constructor parameter. It is resolved from the container; a host that constructs the service by hand passes its resolver.
Security
A role key or permission key an app declares reaches that app's token only from the app's own declaration.HierarchyAwareAccessChecker::forToken() collected bare names from every role relevant to the app, and an organization's own roles and manual permissions share that namespace with the app's declared ones, so a same-named organization row read to the app as its key and did not honor the app's tenant_assignable: false. A permission name the app declares is now emitted only from the app's own declared permission row, and a role key the app declares only from the app's own role; another row with the same name, compared case-insensitively and including a declaration the app has since dropped, is left out of the claim. The role's other permissions are unaffected. Names no app declares are unchanged. The signed token, UserInfo, the identity_claims ID token, PermissionDecisions and the permission check on customer API keys all read forToken(), so all of them follow (AppDeclaredNameTest). can() and permissionsFor() answer across apps by contract and are unchanged.
A loopback redirect URI's port floats only when the URI is in canonical form.AuthorizationClient::allowsRedirectUri() let an http loopback redirect differ in port from the registered one (RFC 8252 §7.3) after reading it with parse_url(), which does not read every authority the way a browser does. The exception now requires both URIs to be in canonical form: http with host 127.0.0.1, [::1] or localhost, no credentials, fragment, backslash, whitespace or control character, and byte-identical to http://host[:port]path[?query] rebuilt from its own parse. Any other URI is accepted only by an exact match with a registered one. Native clients that send a plain loopback URI are unaffected (LoopbackRedirectUriTest).
A token somebody acts on no longer passes for the app's own. The decision endpoint, resource-server introspection access and the user-properties API treated a token as the app's machine token when its subject equalled its client id. They now use Introspection::isMachine(), which also requires an active token with no act claim (MachineTokenTest).
Cbox\Id\Identity\Contracts\MailboxProof, bound to Cbox\Id\Identity\DatabaseMailboxProof. claim(Subject $subject, string $provenEmail): Subject hands an account whose address was never verified to the person who just proved that mailbox: in one transaction it removes the password, second factors and recovery codes, passkeys, linked sign-ins, password-reset and sign-in links for the address, and the account's other credential records; revokes its personal API tokens and customer API keys, its OAuth grants and all its sessions; marks the address verified; and records user.unverified_account_claimed. A verified account, or an account under another address, is returned unchanged. A host with its own Subjects resolver overrides removePassword() or binds its own implementation.
Proving the mailbox claims an unverified account.MagicLinkService::redeem() claims an unverified account through MailboxProof before it starts the session, and InvitationService::accept() does the same before it adds the membership, when the accepting account is the one under the invited address. Before, both used the account as it stood. Email verification (EmailVerification::verify()) does not claim: its token is minted for one account at that account's request, and the person opening it is normally the person who set its password.
The SAML IdP asserts only a verified email address.issueResponse() took the email from its caller and signed it, as the NameID or as a mapped attribute, whether or not the subject had confirmed it. The IdP now asks the Subjects resolver. When the service provider would receive the email (an emailAddress or unspecified NameID taken from email, or an attribute mapped from email) and the address is not verified, or the caller supplies an address that is not the subject's verified one, issuance is refused with the new Cbox\Id\SamlIdp\Exceptions\EmailNotVerified (a SubjectNotPermitted, so a host that catches InvalidAuthnRequest answers the SP with a signed Responder / RequestDenied). The refusal comes before the request id is used, is audited and emitted as saml_idp.assertion_refused with reason email_not_verified. For any other service provider an unverified address is removed from the attributes before mapping. The package's SSO endpoint offers the email only once it is verified and answers the refusal with 403 "Confirm your email address before signing in to this service." UnverifiedEmailAssertionTest.