6060# TODO: This class is not tested
6161class Auth :
6262 """ Container for auth details.
63+
64+ :param scheme: specifies the type of authentication, examples: "basic", "kerberos"
65+ :type scheme: str
66+ :param principal: specifies who is being authenticated
67+ :type principal: str
68+ :param credentials: authenticates the principal
69+ :type credentials: str
70+ :param realm: specifies the authentication provider
71+ :type realm: str
72+ :param parameters: extra key word parameters passed along to the authentication provider
73+ :type parameters: str
6374 """
6475
6576 #: By default we should not send any realm
@@ -82,32 +93,42 @@ def __init__(self, scheme, principal, credentials, realm=None, **parameters):
8293def basic_auth (user , password , realm = None ):
8394 """ Generate a basic auth token for a given user and password.
8495
85- :param user: user name
86- :param password: current password
96+ This will set the scheme to "basic" for the auth token.
97+
98+ :param user: user name, this will set the principal
99+ :param password: current password, this will set the credentials
87100 :param realm: specifies the authentication provider
101+
88102 :return: auth token for use with :meth:`GraphDatabase.driver`
103+ :rtype: :class:`neo4j.Auth`
89104 """
90105 return Auth ("basic" , user , password , realm )
91106
92107
93108def kerberos_auth (base64_encoded_ticket ):
94109 """ Generate a kerberos auth token with the base64 encoded ticket
95110
96- :param base64_encoded_ticket: a base64 encoded service ticket
97- :return: an authentication token that can be used to connect to Neo4j
111+ This will set the scheme to "kerberos" for the auth token.
112+
113+ :param base64_encoded_ticket: a base64 encoded service ticket, this will set the credentials
114+
115+ :return: auth token for use with :meth:`GraphDatabase.driver`
116+ :rtype: :class:`neo4j.Auth`
98117 """
99118 return Auth ("kerberos" , "" , base64_encoded_ticket )
100119
101120
102121def custom_auth (principal , credentials , realm , scheme , ** parameters ):
103- """ Generate a basic auth token for a given user and password .
122+ """ Generate a custom auth token.
104123
105124 :param principal: specifies who is being authenticated
106125 :param credentials: authenticates the principal
107126 :param realm: specifies the authentication provider
108127 :param scheme: specifies the type of authentication
109- :param parameters: parameters passed along to the authentication provider
128+ :param parameters: extra key word parameters passed along to the authentication provider
129+
110130 :return: auth token for use with :meth:`GraphDatabase.driver`
131+ :rtype: :class:`neo4j.Auth`
111132 """
112133 return Auth (scheme , principal , credentials , realm , ** parameters )
113134
0 commit comments