1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-22 04:17:03 +00:00

New feature: Auth support for social networks, dropbox, amazon and so on. Untested

https://github.com/iris-contrib/goth/ is the main package which has been
converted to work with Iris from the ...
https://github.com/markbates/goth/ . Not yet tested on real application.
This commit is contained in:
Makis Maropoulos
2016-06-22 04:22:12 +03:00
parent 74bbc34d5b
commit 70b5e3d090
3 changed files with 53 additions and 14 deletions

View File

@@ -2,12 +2,12 @@ package context
import (
"bufio"
"github.com/iris-contrib/goth"
"github.com/kataras/iris/sessions/store"
"github.com/valyala/fasthttp"
"html/template"
"io"
"time"
"github.com/kataras/iris/sessions/store"
"github.com/valyala/fasthttp"
)
type (
@@ -18,6 +18,7 @@ type (
IContextBinder
IContextRequest
IContextResponse
IContextAuth
SendMail(string, string, ...string) error
Log(string, ...interface{})
Reset(*fasthttp.RequestCtx)
@@ -131,4 +132,16 @@ type (
Session() store.IStore
SessionDestroy()
}
// IContextAuth handles the authentication/authorization
IContextAuth interface {
// CompleteUserAuth does what it says on the tin. It completes the authentication
// process and fetches all of the basic information about the user from the provider.
//
// It expects to be able to get the name of the provider from the named parameters
// as either "provider" or ":provider".
//
// See https://github.com/iris-contrib/goth/examples/main.go to see this in action.
CompleteUserAuth() (goth.User, error)
}
)