krbcontext / python-krbcontext

A Kerberos context manager
https://krbcontext.github.io/
GNU General Public License v3.0
25 stars 10 forks source link

Doesn't work with default ccache specified by KRB5CCNAME #16

Open tkdchen opened 7 years ago

tkdchen commented 7 years ago

User story

I want to initialize a Kerberos context in default ccache, which is specified by KRB5CCNAME.

For example,

import os
os.environ['KRB5CCNAME'] = '/tmp/mycc'

with krbContext(using_keytab=True, principal='...', keytab_file='...'):
    import subprocess
    subprocess.call(['klist'])

Credential cannot be acquired in ccache /tmp/mycc, and error is raised

GSSError: Major (851968): Unspecified GSS failure. Minor code may provide more information, Minor (39756032): Principal in credential cache does not match desired name