Skip to content

CyberlifeCN/cyber-auth-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

cyber-auth-api

任何一个信息系统软件,用户认证都是最基础的模块,创建一个新项目时,首先就要完成这一部分。把多年项目中的实践归纳、整理出来这个最精简的模块,供大家参考,HTTP Restful API。它包含8个API:

  • 登录
  • 登出
  • 获取注册验证码
  • 注册
  • 获取重置密码验证码
  • 忘记密码
  • 通过存储在cookie中access_token重新获取session_ticket
  • 通过存储在cookie中refresh_token重新获取session_ticket

Demo

API文档

安装golang

# yum install go

编辑环境变量

$ vi ~/.bashrc
export GOROOT=/usr/lib/golang
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

安装beego

$ go get github.com/astaxie/beego
$ go get github.com/beego/bee

安装依赖包

$ go get -u github.com/go-sql-driver/mysql
$ go get github.com/satori/go.uuid
$ go get gopkg.in/mgo.v2
$ go get github.com/bradfitz/gomemcache/memcache
$ go get github.com/casbin/casbin

创建工程

$ go get github.com/CyberlifeCN/cyber-auth-api
$ cd github.com/CyberlifeCN/cyber-auth-api

启动

$ cd rpc
$ go run rpc_server.go &
$ cd ..
$ bee run -gendoc=true -downdoc=true &

Linux下通过端口查看进程

# netstat -anp|grep 8086
# netstat -anp|grep 12345

About

Golang API project for Authentication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages