- pig获取token
- pig-学习-oauth2逻辑
- pig-学习-cloud
- feign学习
- 用户模块
- 注册登录
- 部门管理
- 菜单管理
- 角色管理
- 字典管理
v1.0+ 访问authen接口
开发中
POST
http://127.0.0.1:8081/authen/index
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://127.0.0.1:8081/authen/index'
返回响应
🟢200成功
application/json
Body
object {0}
示例
{
"code": 0,
"msg": "身份已认证,访问成功",
"data": {
"authorities": [
{
"authority": "SCOPE_server"
}
],
"details": {
"remoteAddress": "127.0.0.1",
"sessionId": null
},
"authenticated": true,
"principal": {
"name": "qc",
"attributes": {
"active": true,
"sub": "qc",
"aud": [
"qingchen"
],
"license": "https://pig4cloud.com",
"nbf": "2022-09-24T06:59:51Z",
"clientId": "qingchen",
"user_info": {
"password": null,
"username": "qc",
"authorities": [
{
"authority": "ROLE_write"
}
],
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true
},
"scope": [
"server"
],
"iss": "https://pig4cloud.com",
"exp": "2022-09-24T07:59:51Z",
"iat": "2022-09-24T06:59:51Z",
"jti": "2b58897e-313f-45db-a5f5-cbe112ce26e6",
"client_id": "qingchen",
"token_type": "Bearer"
},
"authorities": [
{
"authority": "SCOPE_server"
}
],
"claims": {
"active": true,
"sub": "qc",
"aud": [
"qingchen"
],
"license": "https://pig4cloud.com",
"nbf": "2022-09-24T06:59:51Z",
"clientId": "qingchen",
"user_info": {
"password": null,
"username": "qc",
"authorities": [
{
"authority": "ROLE_write"
}
],
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true
},
"scope": [
"server"
],
"iss": "https://pig4cloud.com",
"exp": "2022-09-24T07:59:51Z",
"iat": "2022-09-24T06:59:51Z",
"jti": "2b58897e-313f-45db-a5f5-cbe112ce26e6",
"client_id": "qingchen",
"token_type": "Bearer"
},
"scope": "[server]",
"id": "2b58897e-313f-45db-a5f5-cbe112ce26e6",
"active": true,
"subject": "qc",
"scopes": [
"server"
],
"tokenType": "Bearer",
"expiresAt": "2022-09-24T07:59:51Z",
"issuedAt": "2022-09-24T06:59:51Z",
"audience": [
"qingchen"
],
"issuer": "https://pig4cloud.com",
"notBefore": "2022-09-24T06:59:51Z",
"username": null,
"clientId": "qingchen"
},
"credentials": {
"tokenValue": "qingchen::qc::e512f75a-75e7-4889-b025-1217b3fe7bc3",
"issuedAt": "2022-09-24T06:59:51Z",
"expiresAt": "2022-09-24T07:59:51Z",
"tokenType": {
"value": "Bearer"
},
"scopes": []
},
"token": {
"tokenValue": "qingchen::qc::e512f75a-75e7-4889-b025-1217b3fe7bc3",
"issuedAt": "2022-09-24T06:59:51Z",
"expiresAt": "2022-09-24T07:59:51Z",
"tokenType": {
"value": "Bearer"
},
"scopes": []
},
"tokenAttributes": {
"active": true,
"sub": "qc",
"aud": [
"qingchen"
],
"license": "https://pig4cloud.com",
"nbf": "2022-09-24T06:59:51Z",
"clientId": "qingchen",
"user_info": {
"password": null,
"username": "qc",
"authorities": [
{
"authority": "ROLE_write"
}
],
"accountNonExpired": true,
"accountNonLocked": true,
"credentialsNonExpired": true,
"enabled": true
},
"scope": [
"server"
],
"iss": "https://pig4cloud.com",
"exp": "2022-09-24T07:59:51Z",
"iat": "2022-09-24T06:59:51Z",
"jti": "2b58897e-313f-45db-a5f5-cbe112ce26e6",
"client_id": "qingchen",
"token_type": "Bearer"
},
"name": "qc"
}
}