DCR VS DCRM with WSO2 Identity server
What is DCR (Dynamic Client Registration)
Dynamic Client registration is a protocol which allows OAuth clients to register applications in an authorization server. Before this mechanism which is introduced from the spec [1] the client registration happened manually. With this implementation the client registration could be done in two ways.
- A client can be registered dynamically with the authorization server itself
- A programmer can register a client programmatically.
Following is the protocol flow of DCR
1. A client sends a registration request with as follows. This should be a post request.
2. Server sends information response with 201 created.
Request :
POST
https://localhost:9443/api/identity/oauth2/dcr/v1.0/register HTTP/1.1
Authorization
:
Basic
YWRtaW46YWRtaW4=Content-Type
:
application/json
Content-Length
:
114
Host:localhost
:9443
{
"redirect_uris"
: [
],
"client_name"
:
"client_test"
,
"grant_types"
: [
"password"
]
}
Response :
HTTP
/1.1
201
CreatedContent-Length
:
163
Content-Type
:
application/json
Connection: Close
{
"client_id"
:
"3701c489-3e03-4f2b-a125-ee3f8d25a501"
,
"client_secret"
:
"4bff3ec0-a5ab-4252-8768-126633278333"
,
"client_name"
:
"client_test"
}
What is DCRM (Dynamic Client Registration Management)
The main finctionalities introduced form this specification [2] are :
- Current registration state of a client (Client Read Request)
- Update request to an already registered client (Client Update Request)
- Delete request to unregister a client (Client Delete Request)
This specification is an extension of DCR specification. Following is the protocol flow of DCRM.
Client Read Request
Following is a sample client read request and response using WSO2 identity server.
Request :
Request :
Get https://localhost:9443/api/identity/oauth2/dcr/v1.0/register
/3701c489-3e03-4f2b-a125-ee3f8d25a501 HTTP/1.1
Host:localhost
:9443
Response:
HTTP
/1.1
200
OKContent-Length
:
163
Content-Type
:
application/json
Connection: Close
{
"client_id"
:
"3701c489-3e03-4f2b-a125-ee3f8d25a501"
,
"client_secret"
:
"4bff3ec0-a5ab-4252-8768-126633278333"
,
"client_name"
:
"name_1"
}
This request is made from concatenating a client identifier ti the DCR register EP. This client identifier is the client key of the application.
Client Update Request
This is used to update an already registerd client application. This update request is a HTTP put request.
Few considerations are there when doing the DCRM update request.
Few considerations are there when doing the DCRM update request.
- This request MUST include all client metadata field which is obtained from previos read / registration request.
- The fields which are not specified in the request should be filled with null values
- The 'client_id' in the should be included in the request and it MUST be the same as its currently issued client identifier.
- The 'client_secret' value can be included in the request, but the value should be matched with the currency issued 'client_secret'.
- The 'client_secret' of the request can not override the existing one of the application.
Following is a sample request and response using WSO2 identity server.
Request :
PUT https
://localhost:9443/api/identity/oauth2/dcr/v1.0/register/
3701c489-3e03-4f2b-a125-ee3f8d25a501 HTTP/1.1
Content-Type
:
application/json
Content-Length
:
115
Host
:
localhost:9443{
"redirect_uris"
: [
],
"client_name"
:
"name_1"
,
"grant_types"
: [
"password"
]
}
Response :
HTTP
/1.1
200
OKContent-Length
:
164
Content-Type
:
application/json
Connection: Close
{
"client_id"
:
"3701c489-3e03-4f2b-a125-ee3f8d25a501"
,
"client_secret"
:
"4bff3ec0-a5ab-4252-8768-126633278333"
,
"client_name"
:
"name_1"
}
Client Delete Request
By doing HTTP DELETE request the client can delete itself from the authorization server.
A delete request will invalidate all 'client_id' ,'client_secret' and 'registration_access_token' of the client.
Following is a sample request and response using WSO2 identity server.
A delete request will invalidate all 'client_id' ,'client_secret' and 'registration_access_token' of the client.
Following is a sample request and response using WSO2 identity server.
Request :
DELETE
https
://localhost:9443/api/identity/oauth2/dcr/v1.0/register/
3701c489-3e03-4f2b-a125-ee3f8d25a501 HTTP/1.1
Content-Type
:
application/json
Content-Length
:
0
Host
:
localhost:9443
Response :
HTTP
/1.1
204
No Content
The article is so informative. This is more helpful for our
ReplyDeleteBest online software testing training course institute in chennai with placement
Best selenium testing online course training in chennai
Learn best software testing online certification course class in chennai with placement
Magento 2 Developer course training institute in chennai
Thanks for sharing.
Very good information provided, Thanks a lot for sharing such useful information.
ReplyDeleteweb design company in velachery
This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
ReplyDeleteBig Data Hadoop Training In Chennai | Big Data Hadoop Training In anna nagar | Big Data Hadoop Training In omr | Big Data Hadoop Training In porur | Big Data Hadoop Training In tambaram | Big Data Hadoop Training In velachery