Changeset 15311
- Timestamp:
- 10/09/2026 02:25:28 PM (2 weeks ago)
- Location:
- sites/trunk/freescout.wordpress.net
- Files:
-
- 5 edited
-
Modules/WPOrgSSO/Config/config.php (modified) (1 diff)
-
Modules/WPOrgSSO/Http/Controllers/SsoController.php (modified) (1 diff)
-
Modules/WPOrgSSO/Services/Saml.php (modified) (2 diffs)
-
Modules/WPOrgSSO/tests/Support/IdentityProvider.php (modified) (1 diff)
-
README.md (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/freescout.wordpress.net/Modules/WPOrgSSO/Config/config.php
r15246 r15311 19 19 // The WordPress.org SAML identity provider, as its settings page lists it. 20 20 'idp' => array( 21 'entity_id' => env( 'WPORG_SSO_IDP_ENTITY_ID', 'https:// login.wordpress.org' ),21 'entity_id' => env( 'WPORG_SSO_IDP_ENTITY_ID', 'https://wordpress.org' ), 22 22 'url' => env( 'WPORG_SSO_IDP_URL', 'https://login.wordpress.org/wp-login.php?action=idp' ), 23 23 -
sites/trunk/freescout.wordpress.net/Modules/WPOrgSSO/Http/Controllers/SsoController.php
r15262 r15311 79 79 $result = Saml::from_config()->validate( (string) $request->input( 'SAMLResponse', '' ) ); 80 80 } catch ( \Throwable $e ) { 81 \Log:: warning( '[WPOrgSSO] ' . $e->getMessage() );81 \Log::error( '[WPOrgSSO] ' . $e->getMessage() ); 82 82 83 83 return redirect()->away( $complete, 303 ); -
sites/trunk/freescout.wordpress.net/Modules/WPOrgSSO/Services/Saml.php
r15246 r15311 150 150 151 151 $username = (string) $response->getNameId(); 152 $in_response_to = (string) $response->getXMLDocument()->documentElement->getAttribute( 'InResponseTo');152 $in_response_to = self::in_response_to( $response->getXMLDocument() ); 153 153 } catch ( RuntimeException $e ) { 154 154 throw $e; … … 167 167 'in_response_to' => $in_response_to, 168 168 ); 169 } 170 171 /** 172 * Gets the ID of the login request a response answers. 173 * 174 * WordPress.org's identity provider only names it in the assertion's bearer confirmation, not on the response 175 * itself. The whole response is signed, so it's as trustworthy there. 176 * 177 * @param \DOMDocument $document Validated response. 178 * @return string Login request ID, or empty. 179 */ 180 private static function in_response_to( \DOMDocument $document ): string { 181 $xpath = new \DOMXPath( $document ); 182 $xpath->registerNamespace( 'samlp', Constants::NS_SAMLP ); 183 $xpath->registerNamespace( 'saml', Constants::NS_SAML ); 184 185 return (string) $xpath->evaluate( 'string(/samlp:Response/saml:Assertion/saml:Subject/saml:SubjectConfirmation[@Method="' . Constants::CM_BEARER . '"]/saml:SubjectConfirmationData/@InResponseTo)' ); 169 186 } 170 187 -
sites/trunk/freescout.wordpress.net/Modules/WPOrgSSO/tests/Support/IdentityProvider.php
r15246 r15311 139 139 $id = '_' . bin2hex( random_bytes( 16 ) ); 140 140 141 // Like wp-saml-idp, only the bearer confirmation names the login request, not the response itself. 141 142 $xml = sprintf( 142 '<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="%1$s" Version="2.0" IssueInstant="%3$s" Destination="%6$s" InResponseTo="%8$s">' .143 '<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="%1$s" Version="2.0" IssueInstant="%3$s" Destination="%6$s">' . 143 144 '<saml:Issuer>%5$s</saml:Issuer>' . 144 145 '<samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status>' . -
sites/trunk/freescout.wordpress.net/README.md
r15265 r15311 51 51 |---|---|---| 52 52 | `WPORG_API_URL` | `https://api.wordpress.org/dotorg/freescout/` | Where the helpdesk endpoints are. | 53 | `WPORG_SSO_IDP_ENTITY_ID` | `https:// login.wordpress.org` | The identity provider's entity ID, from its settings page on login.wordpress.org. |53 | `WPORG_SSO_IDP_ENTITY_ID` | `https://wordpress.org` | The identity provider's entity ID, from its settings page on login.wordpress.org. | 54 54 | `WPORG_SSO_IDP_URL` | `https://login.wordpress.org/wp-login.php?action=idp` | The identity provider's login URL, from the same page. | 55 55 | `WPORG_HELPSCOUT_APP_ID`, `WPORG_HELPSCOUT_APP_SECRET` | | A HelpScout app's credentials, for `WPOrgHelpScoutImport`. Only needed while mailboxes move; delete the app after the last import. |
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)