Skip to content

Add test for Proxy SPNEGO auth #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

iboukris
Copy link
Contributor

@iboukris iboukris commented Aug 9, 2015

The Authorization headers are initially added (generated by gssapi module).

As discussed at #48

Thanks,
Isaac B.

The Authorization headers are initially added (generated by gssapi module).

As discussed at gssapi#48

Thanks,
Isaac B.
@iboukris
Copy link
Contributor Author

Hi Simo,

I am having some troubles with SPNEGO using python-gssapi module.

The following cause "Segmentation fault (core dumped)" when I run it.

def getAuthToken(target):
    spnego_mech = gssapi.raw.OID.from_int_seq('1.3.6.1.5.5.2')

    name = gssapi.Name('HTTP@%s' % target,
                       gssapi.NameType.hostbased_service)

    ctx = gssapi.SecurityContext(name=name, mech=spnego_mech)
    token = ctx.step()

    return 'Negotiate %s' % b64encode(token)

Any idea what I do wrong?
Do you think it is worth pursuing or I could embed a little C code to do the job?

BTW note that when we use 'HTTPKerberosAuth' in 't_spnego.py' it also generates a KRB5 token rather than SPNEGO one.

Thanks!

@iboukris
Copy link
Contributor Author

BTW2 - it seem to work fine when the OID is KRB5 - '1.2.840.113554.1.2.2'

@simo5
Copy link
Contributor

simo5 commented Aug 10, 2015

Can you send me privately a backtrace when it segfaults ?

When using default mech ususally KRB5 is used, so SPNEGO
needs to be explicitly elected.

Requires recent version of python-gssapi module.
@iboukris
Copy link
Contributor Author

As the python fix was accepted upstream, I have added a commit to use SPNEGO indeed.
We might want to use the same technique in 't_spnego' as well.

@iboukris iboukris closed this Aug 11, 2015
@iboukris iboukris deleted the proxy_spnego_test branch August 11, 2015 20:04
@iboukris iboukris restored the proxy_spnego_test branch August 11, 2015 20:05
@iboukris
Copy link
Contributor Author

Oups, deleted the branch by mistake and restored it - sorry.

@iboukris iboukris reopened this Aug 11, 2015
@simo5 simo5 closed this in 5e72093 Sep 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants