Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Authentication fails on macOS Mojave #87

Open
David-Noble-at-work opened this issue Aug 22, 2018 · 7 comments
Open

Authentication fails on macOS Mojave #87

David-Noble-at-work opened this issue Aug 22, 2018 · 7 comments
Labels

Comments

@David-Noble-at-work
Copy link

I've got the latest pre-release installed:

10.14 Beta (18A371a)

The credential manager is now popping an OAuth dialog and then failing to authenticate. Let me know if you'd like a Debug trace and I'll send one that removes personal information. Here's the relevant git config:

credential.helper = !/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/jre/bin/java -Ddebug=true -Djava.net.useSystemProxies=true -jar /Users/david-noble/local/lib/git-credential-manager-2.0.3.jar
@novak
Copy link
Contributor

novak commented Sep 13, 2018

This is likely related to issues with newer versions of Java, specifically 9+. Version 2.0.4 of Git Credential Manager was just released, it is available on Github and will be on Homebrew soon.

Let me know if you still see issues on Mojave with that new version.

@novak
Copy link
Contributor

novak commented Sep 14, 2018

Feel free to re-open this issue if the bug still exists in 2.0.4

@novak novak closed this as completed Sep 14, 2018
@maxmilton
Copy link

maxmilton commented Sep 19, 2018

I'm running into the same issue. I'm absolutely sure I'm entering the correct user/pass but still get:

Fatal: java.lang.Error encountered.  Details:
/usr/bin/security exited with result 51.
stdOut:
stdErr: security: SecKeychainItemCreateFromContent (<default>): The user name or passphrase you entered is not correct.
add-generic-password: returned -25293


fatal: credential helper '!/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/bin/java -Ddebug=false -Djava.net.useSystemProxies=true -jar /usr/local/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar' told us to quit

This is on:

 uname -a
Darwin XXXX-MacBook-Pro.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64 i386 MacBookPro14,3 Darwin

@novak
Copy link
Contributor

novak commented Sep 19, 2018

@maxmilton thanks for the additional information. Would it be possible for you to run it again with the credential manager flag -Ddebug=true?

@novak novak reopened this Sep 19, 2018
@novak novak added the bug label Sep 19, 2018
@jasonwist
Copy link

Hi @novak,

I believe I'm getting a similar issue. While it still pulls correctly (I'm using Azure & a PAT) I get the same error thrown.
Darwin XXXXX 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64

When running git clone it prompts for a password. I enter my PAT and this is the following I get when I run it with debug on.

`Cloning into 'XXXX'...
Configuration::loadGitConfiguration
Configuration::ParseGitConfig
core.editor = vim
core.excludesfile = /Users/XXXX/.gitignore_global
credential.helper = !/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/bin/java -Ddebug=true -Djava.net.useSystemProxies=true -jar /usr/local/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar
filter.lfs.clean = git-lfs clean -- %f
filter.lfs.process = git-lfs filter-process
filter.lfs.required = true
filter.lfs.smudge = git-lfs smudge -- %f
user.email = XXXX
user.name = XXXX
Program::loadOperationArguments
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Program::EnableTraceLogging
Program::get
targetUri = https://dev.azure.com/
Program::ComponentFactory::createSecureStore
Getting a persistent token store that must be secure
Getting a persistent credential store that must be secure
Program::createAuthentication
detecting authority type
BaseVsoAuthentication::getAuthentication
BaseVsoAuthentication::detectAuthority
failed detection
authority is basic
BasicAuthentication::getCredentials
SecretStore::getTargetName
Secret::uriToName
target name = gcm4ml:git:https://dev.azure.com
SecretStore::readCredentials
SecretCache::readCredentials
SecretCache::_getTargetName
Secret::uriToName
target name = gcm4ml:git:https://dev.azure.com
BaseSecureStore::readCredentials
Password for 'https://XXXX@dev.azure.com/':
Configuration::loadGitConfiguration
Configuration::ParseGitConfig
core.editor = vim
core.excludesfile = /Users/XXXX/.gitignore_global
credential.helper = !/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/bin/java -Ddebug=true -Djava.net.useSystemProxies=true -jar /usr/local/Cellar/git-credential-manager/2.0.4/libexec/git-credential-manager-2.0.4.jar
filter.lfs.clean = git-lfs clean -- %f
filter.lfs.process = git-lfs filter-process
filter.lfs.required = true
filter.lfs.smudge = git-lfs smudge -- %f
user.email = XXXX
user.name = XXXX
Program::loadOperationArguments
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Configuration::tryGetEntry
Program::EnableTraceLogging
Program::store
targetUri = https://dev.azure.com/
Program::ComponentFactory::createSecureStore
Getting a persistent token store that must be secure
Getting a persistent credential store that must be secure
Program::createAuthentication
detecting authority type
BaseVsoAuthentication::getAuthentication
BaseVsoAuthentication::detectAuthority
failed detection
authority is basic
BasicAuthentication::setCredentials
SecretStore::writeCredentials
SecretStore::getTargetName
Secret::uriToName
target name = gcm4ml:git:https://dev.azure.com
BaseSecureStore::writeCredential
Fatal error encountered. Details:
java.lang.Error: /usr/bin/security exited with result 51.
stdOut:
stdErr: security: SecKeychainItemCreateFromContent (): The user name or passphrase you entered is not correct.
add-generic-password: returned -25293

    at com.microsoft.alm.storage.macosx.KeychainSecurityCliStore.checkResult(KeychainSecurityCliStore.java:325)
    at com.microsoft.alm.storage.macosx.KeychainSecurityCliStore.write(KeychainSecurityCliStore.java:412)
    at com.microsoft.alm.storage.macosx.KeychainSecurityCliStore.writeCredential(KeychainSecurityCliStore.java:421)
    at com.microsoft.alm.storage.macosx.KeychainSecurityBackedCredentialStore.writeCredential(KeychainSecurityBackedCredentialStore.java:9)
    at com.microsoft.alm.storage.macosx.KeychainSecurityBackedCredentialStore.add(KeychainSecurityBackedCredentialStore.java:19)
    at com.microsoft.alm.storage.macosx.KeychainSecurityBackedCredentialStore.add(KeychainSecurityBackedCredentialStore.java:9)
    at com.microsoft.alm.authentication.SecretStoreAdapter.writeCredential(SecretStoreAdapter.java:53)
    at com.microsoft.alm.authentication.BaseSecureStore.writeCredential(BaseSecureStore.java:57)
    at com.microsoft.alm.authentication.SecretStore.writeCredentials(SecretStore.java:153)
    at com.microsoft.alm.authentication.BasicAuthentication.setCredentials(BasicAuthentication.java:83)
    at com.microsoft.alm.gitcredentialmanager.Program.store(Program.java:437)
    at com.microsoft.alm.gitcredentialmanager.Program.store(Program.java:428)
    at com.microsoft.alm.gitcredentialmanager.Program.access$300(Program.java:63)
    at com.microsoft.alm.gitcredentialmanager.Program$4.call(Program.java:414)
    at com.microsoft.alm.gitcredentialmanager.Program$4.call(Program.java:411)
    at com.microsoft.alm.gitcredentialmanager.Program.innerMain(Program.java:195)
    at com.microsoft.alm.gitcredentialmanager.Program.main(Program.java:123)

remote: Azure Repos
remote: Found 9 objects to send. (158 ms)
Unpacking objects: 100% (9/9), done.`

Hope this helps.

@nathanrobinson
Copy link

git-credential-manager-2.0.4.jar would not open a browser for https://[organization]@dev.azure.com/[organization]... It kept trying to fall back to basic auth. But it did oauth and clone correctly when using the https://[organization].visualstudio.com/... url. Both urls were copied from the "Clone" https link.

@jrbriggs
Copy link
Member

jrbriggs commented Jun 21, 2019

I'd recommend trying GCM Core's macOS preview release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants