¶ SDK for Ruby
Update Time: 2024-10-10 07:28:40
¶ Install
gem install authing
¶ How to use
¶ Initialization
Initialize by token
authing = Authing::Client.new({
userPoolId: "<Your userPoolId>",
token: "<Your Token>"
})
Initialize by UserPoolId + Secret
authing = Authing::Client.new({
userPoolId: "<Your userPoolId>",
secret: "<Your Token>"
})
Initialize by user login information
authing = Authing::Client.new({userPoolId: "<Your userPoolId>"})
res = authing.register({
userInfo: {
email: "c11j@authing.cn",
password: "username",
username: "233",
},
})
¶ Functions
All method names and parameters must be consistent with Graphql.
⚠️ The current version only supports the Authing Graphql interface, and Restful needs additional support.
More interfaces: Authing Graphql (opens new window)
¶ Part of Demo
Login
authing.login({
email: "authing@tmp.cn",
password: "authing",
username: "authing",
})
Register
res = authing.register({
userInfo: {
email: "authing@tmp.cn",
password: "authing",
username: "authing",
}
})
Create user roles:
res = authing.createRBACRole({
input: {
userPoolId: "5f0c2597061ec4de51237379",
name: "tmp",
description: "tmp",
},
description: "tmp",
name: "tmp",
userPoolId: "5f0c2597061ec4de51237379",
})