-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Read access tokens from the backend server #4
base: master
Are you sure you want to change the base?
Conversation
n -= iv->iov_len; | ||
++iv; | ||
} | ||
*((unsigned char **)&iv->iov_base) += n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong...
n -= iv->iov_len; | ||
++iv; | ||
} | ||
*((unsigned char **)&iv->iov_base) += n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong...
n -= p_wsiv->len; | ||
++p_wsiv; | ||
} | ||
*((unsigned char **)&p_wsiv->buf) += n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong...
++p_wsiv; | ||
--nivs; | ||
} | ||
*((unsigned char **)&p_wsiv->buf) += n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong...
if (AF_UNIX == info.af) { | ||
#ifdef WIN32_UDS | ||
tmp.ai_family = info.af; | ||
tmp.ai_protocol = AF_INET; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct?
err = SASL_FAIL; | ||
goto out; | ||
} | ||
/*{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check out the reason for commenting this out.
{ | ||
const xoauth2_plugin_socket_iovec_t *p, *e = ivs + nivs; | ||
for (p = ivs; p < e; p++) { | ||
size_t new_total_len = total_len + p->iov_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
Heads up: this is an experimental feature and may still contain serious vulnerability, and the specification is also subject to change.
Summary
SASL_XOAUTH2_CLIENT_TOKEN_CONV
environment variable is set to the endpoint of the backend server.SASL_CB_PASS
or the interaction forSASL_CB_PASS
yields an empty string or a single hyphen-
.SASL_XOAUTH2_CLIENT_TOKEN_CONV
environment variableIt can take a string of the following form:
Communication Protocol
The communication is done in the following phases:
Handshake Phase
Client sends a Signature and its highest available protocol version, which are concatenated, to Server.
The Signature is a 4 octet string,
%x81 %x9d %x74 %x13
. The version is a 32-bit big-endian unsigned integer.Server verifies the Signature and must terminate the session if it doesn't correspond to the string. Otherwise, it responds to Client with a Signature and the protocol version which will be used in further communication.
The Signature is a 4 octet string,
%x81 %x9d %x74 %x13
(same as the above). The version is a 32-bit big-endian unsigned integer. If Server has backward compatibility with Client's protocol, it is advised that it return the same protocol version as Client.Upon reception of the response from Server, Client must terminate the session if the signature doesn't match, and may do so if the Server's protocol version doesn't meet its version.
Client and Server step to Query Phase.
Query Phase
Client sends a Packet with the following content:
A Packet starts with a 32-bit big-endian unsigned integer that stores the length of the packet content (length octets excluded) and is immediately followed by the packet content.
Server receives the query Packet and responds with the access token that corresponds to the authentication ID contained in the query.
Client may repeat queries.