Page MenuHomePhabricator

D21023.id50084.diff
No OneTemporary

D21023.id50084.diff

diff --git a/src/applications/auth/adapter/PhutilJIRAAuthAdapter.php b/src/applications/auth/adapter/PhutilJIRAAuthAdapter.php
--- a/src/applications/auth/adapter/PhutilJIRAAuthAdapter.php
+++ b/src/applications/auth/adapter/PhutilJIRAAuthAdapter.php
@@ -22,12 +22,33 @@
return $this->jiraBaseURI;
}
- public function getAccountID() {
+ protected function newAccountIdentifiers() {
// Make sure the handshake is finished; this method is used for its
// side effect by Auth providers.
$this->getHandshakeData();
- return idx($this->getUserInfo(), 'key');
+ $info = $this->getUserInfo();
+
+ // See T13493. Older versions of JIRA provide a "key" with a username or
+ // email address. Newer versions of JIRA provide a GUID "accountId".
+ // Intermediate versions of JIRA provide both.
+
+ $identifiers = array();
+
+ $account_key = idx($info, 'key');
+ if ($account_key !== null) {
+ $identifiers[] = $this->newAccountIdentifier($account_key);
+ }
+
+ $account_id = idx($info, 'accountId');
+ if ($account_id !== null) {
+ $identifiers[] = $this->newAccountIdentifier(
+ sprintf(
+ 'accountId(%s)',
+ $account_id));
+ }
+
+ return $identifiers;
}
public function getAccountName() {

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 27, 6:54 PM (6 d, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7383294
Default Alt Text
D21023.id50084.diff (1 KB)

Event Timeline