Coder Social home page Coder Social logo

jangocheng / single-sign-on Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kenmyzhang/single-sign-on

0.0 0.0 0.0 7.04 MB

基于Go语言实现的单点登录系统(sso) 支持手机号码+验证码、邮箱+验证码、微信第三方授权三种方式注册 支持手机号码、用户名、邮箱号码、微信登录 支持手机和邮箱找回密码 支持阿里云通信和互亿无线的短信验证码服务

Home Page: https://github.com/KenmyZhang/single-sign-on

Makefile 0.45% Go 98.44% HTML 1.11%

single-sign-on's Introduction

single-sign-on

温馨提示:程序运行起来后,会判断是否存在数据表,如果不存在会自动创建,无需另外另外执行sql脚本来创建数据表(因比较多人找我要sql脚本,所以在这里提醒一下,我这没有sql脚本)

安装数据库(基于ubuntu)

  • 利用apt-get install安装MySQl

    sudo apt-get install mysql-server

  • 以root用户登录MySQL

    mysql -u root -p

  • 创建sso用户'ssouser'

    mysql> create user 'ssouser'@'%' identified by 'ssouser-password'; 其中%表示网上的所有机器都可以连接上,使用具体的IP地址更安全点 mysql> create user 'ssouser'@'10.10.10.2' identified by 'ssouser-password';

  • 创建sso数据库

    mysql> create database sso

  • 允许ssouser用户的访问权限

    mysql> grant all privileges on sso.* to 'ssouser'@'%';

  • 退出MySQL

    mysql> exit

编译

make build

打包

make package

运行

./single-sing-on

api document

login

手机号、邮箱、用户名 + 密码

手机号 + 验证码

微信登录

sign up

判断手机是否已注册

判断邮箱是否已注册

发送手机短信验证码

发送邮箱验证码

手机号码注册

邮箱注册

forget password

邮件找回

手机找回

constraint

短信验证码有效期一分钟(MAX_SMS_TOKEN_EXIPRY_TIME),一分钟内只能发送一次验证码,24小时内只能发送60条短信(SEND_CODE_MAX,MAX_TOKEN_EXIPRY_TIME),以防止恶意用户

邮件验证码有效期一分钟 (MAX_EMAIL_TOKEN_EXIPRY_TIME),一分钟内只能发送一次验证码

密码长度最小长度5,最大长度72(USER_PASSWORD_MAX_LENGTH),必须包含大写字母、小写字母、数字

昵称长度小于64(USER_NICKNAME_MAX_RUNES)

邮箱长度小于128(USER_EMAIL_MAX_LENGTH)

用户名长度3 ~ 64(USER_NAME_MIN_LENGTH、USER_NAME_MAX_LENGTH)

用户名必须以字母开头,并且包含3到22个小写字母, '.', '-'和'_'.

Contact

[email protected]

single-sign-on's People

Contributors

hellokenmy avatar kenmyzhang 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.