0.1.6 • Published 7 years ago
wso2is-wrapper v0.1.6
WSO2 Identity Server Wrapper
This module aim to act as a wrapper to WSO2 Identity Server APIs.
How to
In a terminal execute
npm install wso2is-wrapper --save
Open your favorite editor and type:
var config = {
"protocol": "https",
"host": "[HOST]",
"port": "[PORT]",
"basicAuth": "[BASE64 user:pass]",
"clientId": "[CLIENT ID]",
"client_secret": "[ClIENT SECRET]",
"newUserEndpoint": "/api/identity/user/v0.9/me",
"oauthTokenEndpoint": "/oauth2/token"
}
var wso2isWrapper = require('wso2is-wrapper')(config);
var addNewUser = wso2isWrapper.addNewUser;
var login = wso2isWrapper.login;
/*
* results = {
* data: "[DATA FROM Identity Server]",
* code: "[RESPONSE CODE]"
* }
* add new user
*/
addNewUser(user)
.then(function(results) {
}).catch(function(err) {
});
Methods
login
To log into the system with credentials use this method. This one consider the password flow
{
"username": "foo",
"password": "123456"
}
addNewUser
Receives as parameter the user to be registered against IS.
{
"user": {
"username": "foo",
"realm": "PRIMARY",
"password": "123456",
"claims": [
{
"uri": "http://wso2.org/claims/givenname",
"value": "foo"
},
{
"uri": "http://wso2.org/claims/lastname",
"value": "last"
},
{
"uri": "http://wso2.org/claims/emailaddress",
"value": "email@ee.com"
},
{
"uri": "http://wso2.org/claims/mobile",
"value": "12345"
}
]
},
"properties": []
}
Roadmap
- Performe connection using WSO2Carbon certificate
- Error handle
- AdminForcePasswordReset
- Change password
- SAML connection for federate login