diff --git a/pierone/api.py b/pierone/api.py
index 35542be..9b0c76a 100644
--- a/pierone/api.py
+++ b/pierone/api.py
@@ -71,6 +71,9 @@ def docker_login_with_token(url, access_token):
     basic_auth = codecs.encode('oauth2:{}'.format(access_token).encode('utf-8'), 'base64').strip().decode('utf-8')
     if 'auths' not in dockercfg:
         dockercfg['auths'] = {}
+    if 'credsStore' in dockercfg:
+        del dockercfg['credsStore']
+
     dockercfg['auths'][url] = {'auth': basic_auth,
                                'email': 'no-mail-required@example.org'}
     with Action('Storing Docker client configuration in {}..'.format(path)):

diff --git a/tests/test_api.py b/tests/test_api.py
index 62e1f0a..3ee83be 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -21,6 +21,29 @@ def test_docker_login(monkeypatch, tmpdir):
         assert {'auth': 'b2F1dGgyOjEyMzc3',
                 'email': 'no-mail-required@example.org'} == data.get('auths').get('https://pierone.example.org')
 
+def test_docker_login_with_credsstore(monkeypatch, tmpdir):
+    monkeypatch.setattr('os.path.expanduser', lambda x: x.replace('~', str(tmpdir)))
+    monkeypatch.setattr('pierone.api.get_token', MagicMock(return_value='12377'))
+    path = os.path.expanduser('~/.docker/config.json')
+    os.makedirs(os.path.dirname(path))
+    with open(path, 'w') as fd:
+        json.dump({
+            "auths": {
+                "https://pierone.stups.zalan.do": {
+                    "auth": "xxx",
+                    "email": "no-mail-required@example.org"
+                }
+            },
+            "credsStore": "osxkeychain"
+        }, fd)
+    docker_login('https://pierone.example.org', 'services', 'mytok',
+                 'myuser', 'mypass', 'https://token.example.org', use_keyring=False)
+    with open(path) as fd:
+        data = yaml.safe_load(fd)
+        assert {'auth': 'b2F1dGgyOjEyMzc3',
+                'email': 'no-mail-required@example.org'} == data.get('auths').get('https://pierone.example.org')
+        assert 'credsStore' not in data
+
 
 def test_docker_login_service_token(monkeypatch, tmpdir):
     monkeypatch.setattr('os.path.expanduser', lambda x: x.replace('~', str(tmpdir)))

no basic auth credentials
Today I had an auth issue. While trying to do `docker push` I was getting the following log:

    ➜ pierone login             
    Getting OAuth2 token "pierone".. OK
    Storing Docker client configuration in /Users/whoever/.docker/config.json.. OK
    ➜ docker push myrepo/...
    The push refers to a repository [myrepo/...]
    a5f591aacc10: Preparing 
    ...
    cb11ba605400: Waiting 
    no basic auth credentials

Recreating `~/config.json` saved me.  
There was `"credsStore": "osxkeychain"` setting In the previous version of the `~/config.json` which was causing me troubles.

BTW 
mac os 10.12.3
pierone cli 1.1.27
docker 17.06.0-ce, build 02c1d87
tests/test_api.py::test_docker_login_with_credsstore
tests/test_api.py::test_docker_login tests/test_api.py::test_docker_login_service_token tests/test_api.py::test_docker_login_with_iid tests/test_api.py::test_keep_dockercfg_entries tests/test_api.py::test_get_latest_tag tests/test_api.py::test_get_latest_tag_IOException tests/test_api.py::test_get_latest_tag_non_json tests/test_api.py::test_image_exists tests/test_api.py::test_image_exists_IOException tests/test_api.py::test_image_exists_but_other_version tests/test_api.py::test_image_not_exists tests/test_api.py::test_get_image_tags tests/test_api.py::test_get_image_tag tests/test_api.py::test_get_image_tag_that_does_not_exist