Skip to content

Simplify kerberos auth token creation #353

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

Merged
merged 1 commit into from
Apr 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions driver/src/main/java/org/neo4j/driver/v1/AuthTokens.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ public static AuthToken basic( String username, String password, String realm )
"realm", realm).asMap( Values.ofValue() ) );
}

/**
* The kerberos authentication scheme, using a base64 encoded ticket
* @param base64EncodedTicket a base64 encoded service ticket
* @return an authentication token that can be used to connect to Neo4j
* @see GraphDatabase#driver(String, AuthToken)
* @since 1.3
*/
public static AuthToken kerberos( String base64EncodedTicket )
{
return new InternalAuthToken( parameters(
"scheme", "kerberos",
"credentials", base64EncodedTicket).asMap( Values.ofValue() ) );
}

/**
* A custom authentication token used for doing custom authentication on the server side.
Expand All @@ -73,7 +86,7 @@ public static AuthToken basic( String username, String password, String realm )
* @param realm this is the "realm:, specifying the authentication provider.
* @param scheme this it the authentication scheme, specifying what kind of authentication that should be used
* @return an authentication token that can be used to connect to Neo4j
* * @see GraphDatabase#driver(String, AuthToken)
* @see GraphDatabase#driver(String, AuthToken)
*/
public static AuthToken custom( String principal, String credentials, String realm, String scheme)
{
Expand All @@ -92,7 +105,7 @@ public static AuthToken custom( String principal, String credentials, String rea
* @param scheme this it the authentication scheme, specifying what kind of authentication that shoud be used
* @param parameters extra parameters to be sent along the authentication provider.
* @return an authentication token that can be used to connect to Neo4j
* * @see GraphDatabase#driver(String, AuthToken)
* @see GraphDatabase#driver(String, AuthToken)
*/
public static AuthToken custom( String principal, String credentials, String realm, String scheme, Map<String, Object> parameters)
{
Expand Down