This may be a silly question, but is it possible to obtain GSSAPI token for current logged in user from Active Directory?
I have a simple library that connects to server. I can pass user name, password and domain name or GSS Token (base64). For now first method works for me, but it is annoying to users that they must put their password.
I couldn't find any informations about GSSAPI and it's integration with Active Directory.
Is it possible in C#?
Some more informations based on @Harvey Kwok comment:
Library is called Altair COM
and it is used for document management
Here is some API reference about Login with GSS:
HRESULT LoginGSS(
[in] VARIANT *token,
[in] VARIANT_BOOL forceCreateNew,
[out,retval] VARIANT *retToken)
And below is sample usage in VB:
Dim token(tokensize) As Byte 'token size-1
’fill token buffer
...
Dim outToken() As Byte
outToken = altair.LoginGSS(token,True)
'if GetLastStatus == AXAPI_ALTAIR_LOGIN_CONTINUE then
'outToken contains return GSS API token
And VC++ usage
SAFEARRAYBOUND sab[1];
sab[0].lLbound=0;
sab[0].cElements=tokensize;
SAFEARRAY *sa;
sa=SafeArrayCreate(VT_UI1,1,sab);
unsigned char HUGEP *buf=NULL;
SafeArrayAccessData(sa,(void HUGEP**)&buf);
//fill token buffer
...
SafeArrayUnaccessData(sa);
v.vt=VT_ARRAY|VT_UI1;
v.pparray=sa;
VARIANT vOut;
pAltair->LoginGSS(&v,true,&vOut);
SafeArrayDestroy(sa);
'if GetLastStatus == AXAPI_ALTAIR_LOGIN_CONTINUE then
'outToken contains return GSS API token
This are all informations that I have.
I found some code snippet showing login procedure:
byte[] token;
token = Convert.FromBase64String(tbToken.Text);
Object o;
o = (Object)token;
Program.altair.LoginGSS(ref o, true);
if ((AXAPILib.AxAPIStatus)altair.GetLastStatus()==AXAPILib.AxAPIStatus.AxAltairLoginOK)
{
//login ok
}
But I must enter that token and I'm still trying to generate it for current user.