Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
bef01c48
Commit
bef01c48
authored
Jan 18, 2016
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor session API documentation [ci skip]
parent
835f1961
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
doc/api/session.md
doc/api/session.md
+25
-17
No files found.
doc/api/session.md
View file @
bef01c48
# Session
# Session
Login to get private token
You can login with both GitLab and LDAP credentials in order to obtain the
private token.
```
```
POST /session
POST /session
```
```
Parameters:
| Attribute | Type | Required | Description |
| ---------- | ------- | -------- | -------- |
|
`login`
| string | yes | The username of the user|
|
`email`
| string | yes if login is not provided | The email of the user |
|
`password`
| string | yes | The password of the user |
-
`login`
(required) - The login of user
```
bash
-
`email`
(required if login missing) - The email of user
curl
-X
POST
"https://gitlab.example.com/api/v3/session?login=john_smith&password=strongpassw0rd"
-
`password`
(required) - Valid password
```
**You can login with both GitLab and LDAP credentials now**
Example response:
```
json
```
json
{
{
"id"
:
1
,
"username"
:
"john_smith"
,
"email"
:
"john@example.com"
,
"name"
:
"John Smith"
,
"name"
:
"John Smith"
,
"private_token"
:
"dd34asd13as"
,
"username"
:
"john_smith"
,
"blocked"
:
false
,
"id"
:
32
,
"created_at"
:
"2012-05-23T08:00:58Z"
,
"state"
:
"active"
,
"avatar_url"
:
null
,
"created_at"
:
"2015-01-29T21:07:19.440Z"
,
"is_admin"
:
true
,
"bio"
:
null
,
"bio"
:
null
,
"skype"
:
""
,
"skype"
:
""
,
"linkedin"
:
""
,
"linkedin"
:
""
,
"twitter"
:
""
,
"twitter"
:
""
,
"website_url"
:
""
,
"website_url"
:
""
,
"
dark_scheme"
:
false
,
"
email"
:
"john@example.com"
,
"theme_id"
:
1
,
"theme_id"
:
1
,
"is_admin"
:
false
,
"color_scheme_id"
:
1
,
"projects_limit"
:
10
,
"current_sign_in_at"
:
"2015-07-07T07:10:58.392Z"
,
"identities"
:
[],
"can_create_group"
:
true
,
"can_create_group"
:
true
,
"can_create_team"
:
true
,
"can_create_project"
:
true
,
"can_create_project"
:
true
"two_factor_enabled"
:
false
,
"private_token"
:
"9koXpg98eAheJpvBs5tK"
}
}
```
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment