|
| 1 | +openapi: 3.0.0 |
| 2 | +info: |
| 3 | + description: | |
| 4 | + The Credential Management REST API provides a comprehensive interface to list and delete |
| 5 | + credentials enrolled by end-users within the WSO2 Identity Server. The administrators who are assigned with privileges to list and delete |
| 6 | + users (with scopes internal_user_mgt_view and internal_user_mgt_delete) are able to perform these operations. This API currently supports passkey and push |
| 7 | + authentication credentials. |
| 8 | +
|
| 9 | + version: '1.0' |
| 10 | + title: WSO2 Identity Server - User Credential Management Rest API |
| 11 | + |
| 12 | +security: |
| 13 | + - OAuth2: [] |
| 14 | + - BasicAuth: [] |
| 15 | + |
| 16 | +servers: |
| 17 | + - url: https://{server-url}/t/{tenant-domain}/api/server/v1 |
| 18 | + variables: |
| 19 | + tenant-domain: |
| 20 | + default: carbon.super |
| 21 | + server-url: |
| 22 | + default: localhost:9443 |
| 23 | + |
| 24 | +paths: |
| 25 | + /users/{user-id}/credentials: |
| 26 | + get: |
| 27 | + summary: List end-user enrolled credentials |
| 28 | + description: "Retrieves a list of all user-enrolled credentials. |
| 29 | + \n\n <b>Scope (Permission) required:</b> ``internal_user_mgt_view``\n\n" |
| 30 | + operationId: getUserCredentialsById |
| 31 | + tags: |
| 32 | + - List User Credentials |
| 33 | + parameters: |
| 34 | + - name: user-id |
| 35 | + in: path |
| 36 | + description: The unique identifier of the user. |
| 37 | + required: true |
| 38 | + schema: |
| 39 | + type: string |
| 40 | + responses: |
| 41 | + '200': |
| 42 | + description: OK |
| 43 | + content: |
| 44 | + application/json: |
| 45 | + schema: |
| 46 | + type: array |
| 47 | + items: |
| 48 | + $ref: '#/components/schemas/Credential' |
| 49 | + examples: |
| 50 | + response: |
| 51 | + value: |
| 52 | + [ |
| 53 | + { |
| 54 | + "credentialId": "TJwhlvGKrEk7xSSKLrhoCsaA", |
| 55 | + "displayName": "My Security Key", |
| 56 | + "type": "PASSKEY" |
| 57 | + }, |
| 58 | + { |
| 59 | + "credentialId": "996a12a0-b9aab-48ab-8016-d0ffd99ebe1b", |
| 60 | + "displayName": "My phone", |
| 61 | + "type": "PUSH_AUTH" |
| 62 | + } |
| 63 | + ] |
| 64 | + '400': |
| 65 | + description: Bad Request. |
| 66 | + content: |
| 67 | + application/json: |
| 68 | + schema: |
| 69 | + $ref: '#/components/schemas/Error' |
| 70 | + '401': |
| 71 | + description: Unauthorized. |
| 72 | + content: |
| 73 | + application/json: |
| 74 | + schema: |
| 75 | + $ref: '#/components/schemas/Error' |
| 76 | + '403': |
| 77 | + description: Forbidden. |
| 78 | + content: |
| 79 | + application/json: |
| 80 | + schema: |
| 81 | + $ref: '#/components/schemas/Error' |
| 82 | + '404': |
| 83 | + description: User Not Found. |
| 84 | + content: |
| 85 | + application/json: |
| 86 | + schema: |
| 87 | + $ref: '#/components/schemas/Error' |
| 88 | + '500': |
| 89 | + description: Internal Server Error. |
| 90 | + content: |
| 91 | + application/json: |
| 92 | + schema: |
| 93 | + $ref: '#/components/schemas/Error' |
| 94 | + |
| 95 | + /users/{user-id}/credentials/{type}/{credential-id}: |
| 96 | + delete: |
| 97 | + summary: Delete a user-enrolled credential. |
| 98 | + description: "Deletes a specific enrolled credential for a user. |
| 99 | + \n\n <b>Scope (Permission) required:</b> ``internal_user_mgt_delete``\n\n" |
| 100 | + operationId: deleteUserCredentialById |
| 101 | + tags: |
| 102 | + - Delete User Credential |
| 103 | + parameters: |
| 104 | + - name: user-id |
| 105 | + in: path |
| 106 | + description: The unique identifier of the user. |
| 107 | + required: true |
| 108 | + schema: |
| 109 | + type: string |
| 110 | + - name: type |
| 111 | + in: path |
| 112 | + description: The type of the credential. |
| 113 | + required: true |
| 114 | + schema: |
| 115 | + type: string |
| 116 | + enum: [passkey, push-auth] |
| 117 | + - name: credential-id |
| 118 | + in: path |
| 119 | + description: The unique identifier of the device to be deleted. |
| 120 | + required: true |
| 121 | + schema: |
| 122 | + type: string |
| 123 | + responses: |
| 124 | + '204': |
| 125 | + description: User Credential Deleted. |
| 126 | + '400': |
| 127 | + description: Bad Request. |
| 128 | + content: |
| 129 | + application/json: |
| 130 | + schema: |
| 131 | + $ref: '#/components/schemas/Error' |
| 132 | + '401': |
| 133 | + description: Unauthorized. |
| 134 | + content: |
| 135 | + application/json: |
| 136 | + schema: |
| 137 | + $ref: '#/components/schemas/Error' |
| 138 | + '403': |
| 139 | + description: Forbidden. |
| 140 | + content: |
| 141 | + application/json: |
| 142 | + schema: |
| 143 | + $ref: '#/components/schemas/Error' |
| 144 | + '500': |
| 145 | + description: Internal Server Error. |
| 146 | + content: |
| 147 | + application/json: |
| 148 | + schema: |
| 149 | + $ref: '#/components/schemas/Error' |
| 150 | +components: |
| 151 | + securitySchemes: |
| 152 | + BasicAuth: |
| 153 | + type: http |
| 154 | + scheme: basic |
| 155 | + OAuth2: |
| 156 | + type: oauth2 |
| 157 | + flows: |
| 158 | + authorizationCode: |
| 159 | + authorizationUrl: 'https://localhost:9443/oauth2/authorize' |
| 160 | + tokenUrl: 'https://localhost:9443/oauth2/token' |
| 161 | + scopes: |
| 162 | + read: internal_user_mgt_view |
| 163 | + delete: internal_user_mgt_delete |
| 164 | + schemas: |
| 165 | + Credential: |
| 166 | + type: object |
| 167 | + properties: |
| 168 | + credentialId: |
| 169 | + type: string |
| 170 | + description: The unique identifier for the credential. |
| 171 | + example: 'a5a81c76-27a3-42d4-82a8-55285d82a4a1' |
| 172 | + displayName: |
| 173 | + type: string |
| 174 | + description: A user-friendly name for the credential. |
| 175 | + example: "YubiKey 5C" |
| 176 | + type: |
| 177 | + type: string |
| 178 | + description: The type of the credential. |
| 179 | + enum: [passkey, push-auth] |
| 180 | + Error: |
| 181 | + type: object |
| 182 | + properties: |
| 183 | + code: |
| 184 | + type: string |
| 185 | + description: Some error description. |
| 186 | + example: 'CM-00001' |
| 187 | + message: |
| 188 | + type: string |
| 189 | + description: Some error message. |
| 190 | + example: 'Some error message.' |
| 191 | + description: |
| 192 | + type: string |
| 193 | + description: A more detailed explanation of the error. |
| 194 | + example: 'Some error description.' |
| 195 | + traceId: |
| 196 | + type: string |
| 197 | + description: The unique identifier for the request. |
| 198 | + example: '8a5f5d4e-1d2c-4f3b-9c6e-7d8f9a0b1c2d' |
0 commit comments