Git Product home page Git Product logo

authing_ruby's Introduction

Authing Ruby SDK - Ruby Gems 地址

这里是 Authing 的 Ruby SDK

如何安装

Gemfile 中写上

gem "authing_ruby"

或者

gem install authing_ruby

基本例子(用户名+密码进行注册)

require 'authing_ruby'

options = {
  appId: "appId 填写应用 id, 如 60800b9151d040af9016d60b, 应用->App ID",
  appHost: "appHost 例子: https://rails-demo.authing.cn, 应用->基础设置->认证地址",
}
authenticationClient = AuthingRuby::AuthenticationClient.new(options)
username = "user#{rand(0...9999)}" # 用户名
password = "12345678" # 密码
resp = authenticationClient.registerByUsername(username, password)
puts resp # 返回注册成功的用户信息

这个例子来自于 example/2.registerByUsername.rb

如何使用

  1. example/ 目录有使用例子
  2. Ruby SDK 是参照 JS SDK 实现的。方法名,参数完全一致,可以翻阅 JS/Node SDK 文档 参考
  3. 也可以参照测试代码 lib/test/mini_test/ 进行使用。
  4. 目前实现了最常用最基础的功能,而不是 100% 的 Authing API (因为实在太多),具体实现了什么功能,参照 doc/README.md
  5. 这个 gem 说到底只是一个工具,重点是使用 Authing 本身,所以务必阅读 Authing 的文档,理解核心概念

时间表

  • 发布 1.1.1 版:2021-6-1
  • 发布 1.1.0 版:2021-5-25
  • 发布 1.0.9 版:2021-5-25
  • 发布 1.0.8 版:2021-5-13
  • 发布 1.0.7 版:2021-5
  • 发布 1.0.0 版:2021-4-30
  • 写下第一行代码: 2021-4-22

Ruby on Rails 参考项目

这个 gem 可以单独使用,非 Rails 项目也可以用,因为本质上它只是发 GraphQL HTTP 请求而已。
但如果你希望在 Ruby on Rails 项目中使用这个 Ruby SDK,希望找例子参考。
例子: https://github.com/1c7/authing_ruby_rails_example

更多文档请阅读

authing_ruby's People

Contributors

1c7 avatar zkuns avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.