chore: archi package du projet
This commit is contained in:
11
main.go
11
main.go
@@ -6,6 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/ldrogou/goauth20/routeserv"
|
||||||
"github.com/ldrogou/goauth20/store"
|
"github.com/ldrogou/goauth20/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -19,16 +20,16 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func run() error {
|
func run() error {
|
||||||
srv := newServer()
|
srv := routeserv.NewServer()
|
||||||
srv.store = &store.DbStore{}
|
srv.Store = &store.DbStore{}
|
||||||
|
|
||||||
err := srv.store.Open()
|
err := srv.Store.Open()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer srv.store.Close()
|
defer srv.Store.Close()
|
||||||
|
|
||||||
http.HandleFunc("/", srv.serveHTTP)
|
http.HandleFunc("/", srv.ServeHTTP)
|
||||||
|
|
||||||
port := 8090
|
port := 8090
|
||||||
log.Printf("servering http port %v", port)
|
log.Printf("servering http port %v", port)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package main
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func logRequestMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
func LogRequestMiddleware(next http.HandlerFunc) http.HandlerFunc {
|
||||||
|
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(rw http.ResponseWriter, r *http.Request) {
|
||||||
log.Printf("[%v] %v", r.Method, r.RequestURI)
|
log.Printf("[%v] %v", r.Method, r.RequestURI)
|
||||||
11
routes.go
11
routes.go
@@ -1,11 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
func (s *server) routes() {
|
|
||||||
s.router.HandleFunc("/index", s.handleIndex()).Methods("GET")
|
|
||||||
s.router.HandleFunc("/oauth/redirect", s.handleRedirect()).Methods("GET")
|
|
||||||
s.router.HandleFunc("/local", s.handleLocal()).Methods("POST")
|
|
||||||
s.router.HandleFunc("/oauth20", s.handleOAuth20()).Methods("POST")
|
|
||||||
s.router.HandleFunc("/jwt/{id}", s.handleJSONWebToken()).Methods("GET")
|
|
||||||
s.router.HandleFunc("/jwt/refresh/{id}", s.handleRefreshToken()).Methods("POST")
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package routeserv
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
@@ -18,14 +19,14 @@ import (
|
|||||||
//Claim claims to export
|
//Claim claims to export
|
||||||
type Claims struct {
|
type Claims struct {
|
||||||
Sub string `json:"sub"`
|
Sub string `json:"sub"`
|
||||||
IDEntreprise string `json:"idEntreprise"`
|
IDEntreprise string `json:"idEntreprise,omitempty"`
|
||||||
RcaPartnerID string `json:"rcaPartnerId"`
|
RcaPartnerID string `json:"rcaPartnerId"`
|
||||||
Scopes []string `json:"scopes"`
|
Scopes []string `json:"scopes"`
|
||||||
Roles []string `json:"roles"`
|
Roles []string `json:"roles"`
|
||||||
jwt.StandardClaims
|
jwt.StandardClaims
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) handleIndex() http.HandlerFunc {
|
func (s *Server) handleIndex() http.HandlerFunc {
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
rw.Header().Set("Content-Type", "text/html")
|
rw.Header().Set("Content-Type", "text/html")
|
||||||
@@ -43,7 +44,7 @@ func (s *server) handleIndex() http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
func (s *server) handleLocal() http.HandlerFunc {
|
func (s *Server) handleLocal() http.HandlerFunc {
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
sub := r.FormValue("sub")
|
sub := r.FormValue("sub")
|
||||||
@@ -63,16 +64,18 @@ func (s *server) handleLocal() http.HandlerFunc {
|
|||||||
expirationTime := time.Now().Add(5 * time.Hour)
|
expirationTime := time.Now().Add(5 * time.Hour)
|
||||||
// Create the JWT claims, which includes the username and expiry time
|
// Create the JWT claims, which includes the username and expiry time
|
||||||
claims := &Claims{
|
claims := &Claims{
|
||||||
Sub: sub,
|
|
||||||
IDEntreprise: idEntreprise,
|
|
||||||
RcaPartnerID: rcaPartnerID,
|
|
||||||
Roles: rs,
|
|
||||||
Scopes: sc,
|
|
||||||
StandardClaims: jwt.StandardClaims{
|
StandardClaims: jwt.StandardClaims{
|
||||||
// In JWT, the expiry time is expressed as unix milliseconds
|
// In JWT, the expiry time is expressed as unix milliseconds
|
||||||
ExpiresAt: expirationTime.Unix(),
|
ExpiresAt: expirationTime.Unix(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
if idEntreprise != "0" {
|
||||||
|
claims.IDEntreprise = idEntreprise
|
||||||
|
}
|
||||||
|
claims.Sub = sub
|
||||||
|
claims.RcaPartnerID = rcaPartnerID
|
||||||
|
claims.Roles = rs
|
||||||
|
claims.Scopes = sc
|
||||||
|
|
||||||
secretBase64, err := jwt.DecodeSegment(jwtKey)
|
secretBase64, err := jwt.DecodeSegment(jwtKey)
|
||||||
// Declare the token with the algorithm used for signing, and the claims
|
// Declare the token with the algorithm used for signing, and the claims
|
||||||
@@ -95,7 +98,7 @@ func (s *server) handleLocal() http.HandlerFunc {
|
|||||||
ExpiresIN: -1,
|
ExpiresIN: -1,
|
||||||
RefreshToken: "refresh",
|
RefreshToken: "refresh",
|
||||||
}
|
}
|
||||||
err = s.store.CreateOauth(o)
|
err = s.Store.CreateOauth(o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("erreur suivante %v", err)
|
fmt.Printf("erreur suivante %v", err)
|
||||||
}
|
}
|
||||||
@@ -109,19 +112,14 @@ func (s *server) handleLocal() http.HandlerFunc {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) handleOAuth20() http.HandlerFunc {
|
func (s *Server) handleOAuth20() http.HandlerFunc {
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
d := r.FormValue("domain")
|
d := r.FormValue("domain")
|
||||||
ci := r.FormValue("clientId")
|
ci := r.FormValue("clientId")
|
||||||
cs := r.FormValue("clientSecret")
|
cs := r.FormValue("clientSecret")
|
||||||
sc := r.FormValue("scopes")
|
sc := r.FormValue("clientScopes")
|
||||||
cc := r.FormValue("currentCompany")
|
cc := r.FormValue("currentCompany")
|
||||||
if len(cc) == 0 {
|
|
||||||
cc = "false"
|
|
||||||
} else {
|
|
||||||
cc = "true"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Création du nombre aléatoire pour la state
|
// Création du nombre aléatoire pour la state
|
||||||
nr := rand.NewSource(time.Now().UnixNano())
|
nr := rand.NewSource(time.Now().UnixNano())
|
||||||
@@ -138,7 +136,7 @@ func (s *server) handleOAuth20() http.HandlerFunc {
|
|||||||
GrantType: "authorization_code",
|
GrantType: "authorization_code",
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.store.CreateParam(p)
|
err := s.Store.CreateParam(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("erreur suivante %v", err)
|
fmt.Printf("erreur suivante %v", err)
|
||||||
}
|
}
|
||||||
@@ -146,13 +144,28 @@ func (s *server) handleOAuth20() http.HandlerFunc {
|
|||||||
// on appelle les méthodes de l'instance de `rand.Rand` obtenue comme les autres méthodes du package.
|
// on appelle les méthodes de l'instance de `rand.Rand` obtenue comme les autres méthodes du package.
|
||||||
//fmt.Print(r1.Intn(100), ",")
|
//fmt.Print(r1.Intn(100), ",")
|
||||||
|
|
||||||
rhttp := "https://" + d + "/entreprise-partenaire/authorize?client_id=" + ci +
|
var b bytes.Buffer
|
||||||
"&scope=" + sc +
|
if cc == "none" {
|
||||||
"¤t_company=" + cc +
|
b.WriteString("https://api.")
|
||||||
"&redirect_uri=http://localhost:8090/oauth/redirect%3Fstate=" + st +
|
b.WriteString(d)
|
||||||
"&abort_uri=http://localhost:8090/index"
|
b.WriteString("/auth/v1/oauth2.0/authorize?response_type=code")
|
||||||
http.Redirect(rw, r, rhttp, http.StatusMovedPermanently)
|
} else {
|
||||||
|
b.WriteString("https://")
|
||||||
|
b.WriteString(d)
|
||||||
|
b.WriteString("/entreprise-partenaire/authorize?")
|
||||||
|
b.WriteString("current_company=")
|
||||||
|
b.WriteString(cc)
|
||||||
|
b.WriteString("&abort_uri=http://localhost:8090/index")
|
||||||
|
}
|
||||||
|
|
||||||
|
b.WriteString("&client_id=")
|
||||||
|
b.WriteString(ci)
|
||||||
|
b.WriteString("&scope=")
|
||||||
|
b.WriteString(sc)
|
||||||
|
b.WriteString("&redirect_uri=http://localhost:8090/oauth/redirect%3Fstate=")
|
||||||
|
b.WriteString(st)
|
||||||
|
|
||||||
|
http.Redirect(rw, r, b.String(), http.StatusMovedPermanently)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
11
routeserv/routes.go
Normal file
11
routeserv/routes.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package routeserv
|
||||||
|
|
||||||
|
func (s *Server) routes() {
|
||||||
|
s.Router.HandleFunc("/index", s.handleIndex()).Methods("GET")
|
||||||
|
s.Router.HandleFunc("/oauth/redirect", s.handleRedirect()).Methods("GET")
|
||||||
|
s.Router.HandleFunc("/local", s.handleLocal()).Methods("POST")
|
||||||
|
s.Router.HandleFunc("/oauth20", s.handleOAuth20()).Methods("POST")
|
||||||
|
s.Router.HandleFunc("/jwt/{id}", s.handleJSONWebToken()).Methods("GET")
|
||||||
|
s.Router.HandleFunc("/jwt/refresh/{id}", s.handleRefreshToken()).Methods("POST")
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package main
|
package routeserv
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -17,6 +17,7 @@ import (
|
|||||||
templateoauth "github.com/ldrogou/goauth20/templateOAuth"
|
templateoauth "github.com/ldrogou/goauth20/templateOAuth"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//"YNVZF88dD4vny59k")
|
||||||
//JSONToken json token
|
//JSONToken json token
|
||||||
type JSONToken struct {
|
type JSONToken struct {
|
||||||
ClientID string `json:"client_id"`
|
ClientID string `json:"client_id"`
|
||||||
@@ -26,14 +27,14 @@ type JSONToken struct {
|
|||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) handleRedirect() http.HandlerFunc {
|
func (s *Server) handleRedirect() http.HandlerFunc {
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
c := r.URL.Query().Get("code")
|
c := r.URL.Query().Get("code")
|
||||||
st := r.URL.Query().Get("state")
|
st := r.URL.Query().Get("state")
|
||||||
|
|
||||||
// ici jouter la récupération du param
|
// ici jouter la récupération du param
|
||||||
p, err := s.store.GetParam(st)
|
p, err := s.Store.GetParam(st)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("erreur à la recupération des param (err=%v)", err)
|
fmt.Printf("erreur à la recupération des param (err=%v)", err)
|
||||||
}
|
}
|
||||||
@@ -44,7 +45,6 @@ func (s *server) handleRedirect() http.HandlerFunc {
|
|||||||
log.Printf("data %v", data)
|
log.Printf("data %v", data)
|
||||||
data.Set("client_id", jsonStr.ClientID)
|
data.Set("client_id", jsonStr.ClientID)
|
||||||
data.Set("client_secret", jsonStr.ClientSecret)
|
data.Set("client_secret", jsonStr.ClientSecret)
|
||||||
//"YNVZF88dD4vny59k")
|
|
||||||
data.Set("grant_type", jsonStr.GrantType)
|
data.Set("grant_type", jsonStr.GrantType)
|
||||||
data.Set("redirect_uri", jsonStr.RedirectURI)
|
data.Set("redirect_uri", jsonStr.RedirectURI)
|
||||||
data.Set("code", jsonStr.Code)
|
data.Set("code", jsonStr.Code)
|
||||||
@@ -87,7 +87,7 @@ func (s *server) handleRedirect() http.HandlerFunc {
|
|||||||
ExpiresIN: t["expires_in"].(float64),
|
ExpiresIN: t["expires_in"].(float64),
|
||||||
RefreshToken: t["refresh_token"].(string),
|
RefreshToken: t["refresh_token"].(string),
|
||||||
}
|
}
|
||||||
err = s.store.CreateOauth(o)
|
err = s.Store.CreateOauth(o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("erreur suivante %v", err)
|
fmt.Printf("erreur suivante %v", err)
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ func (s *server) handleRedirect() http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) handleJSONWebToken() http.HandlerFunc {
|
func (s *Server) handleJSONWebToken() http.HandlerFunc {
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
vars, _ := mux.Vars(r)["id"]
|
vars, _ := mux.Vars(r)["id"]
|
||||||
@@ -116,7 +116,7 @@ func (s *server) handleJSONWebToken() http.HandlerFunc {
|
|||||||
fmt.Printf("erreur suivante %v", err)
|
fmt.Printf("erreur suivante %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
oauth, err := s.store.GetOauth(jwtID)
|
oauth, err := s.Store.GetOauth(jwtID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("erreur a la récupération oauth (err=%v)", err)
|
log.Printf("erreur a la récupération oauth (err=%v)", err)
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package main
|
package routeserv
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *server) handleRefreshToken() http.HandlerFunc {
|
func (s *Server) handleRefreshToken() http.HandlerFunc {
|
||||||
return func(rw http.ResponseWriter, r *http.Request) {
|
return func(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
vars, _ := mux.Vars(r)["id"]
|
vars, _ := mux.Vars(r)["id"]
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package main
|
package routeserv
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@@ -6,12 +6,13 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
"github.com/ldrogou/goauth20/middleware"
|
||||||
"github.com/ldrogou/goauth20/store"
|
"github.com/ldrogou/goauth20/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
type server struct {
|
type Server struct {
|
||||||
router *mux.Router
|
Router *mux.Router
|
||||||
store store.Store
|
Store store.Store
|
||||||
}
|
}
|
||||||
|
|
||||||
//File structure du fichier
|
//File structure du fichier
|
||||||
@@ -23,19 +24,19 @@ type File struct {
|
|||||||
Sign string
|
Sign string
|
||||||
}
|
}
|
||||||
|
|
||||||
func newServer() *server {
|
func NewServer() *Server {
|
||||||
s := &server{
|
s := &Server{
|
||||||
router: mux.NewRouter(),
|
Router: mux.NewRouter(),
|
||||||
}
|
}
|
||||||
s.routes()
|
s.routes()
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) serveHTTP(rw http.ResponseWriter, r *http.Request) {
|
func (s *Server) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
logRequestMiddleware(s.router.ServeHTTP).ServeHTTP(rw, r)
|
middleware.LogRequestMiddleware(s.Router.ServeHTTP).ServeHTTP(rw, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) response(rw http.ResponseWriter, _ *http.Request, data interface{}, status int) {
|
func (s *Server) response(rw http.ResponseWriter, _ *http.Request, data interface{}, status int) {
|
||||||
rw.Header().Add("Content-type", "application/json")
|
rw.Header().Add("Content-type", "application/json")
|
||||||
rw.WriteHeader(status)
|
rw.WriteHeader(status)
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ func (s *server) response(rw http.ResponseWriter, _ *http.Request, data interfac
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) decode(rw http.ResponseWriter, r *http.Request, v interface{}) error {
|
func (s *Server) decode(rw http.ResponseWriter, r *http.Request, v interface{}) error {
|
||||||
return json.NewDecoder(r.Body).Decode(v)
|
return json.NewDecoder(r.Body).Decode(v)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -26,9 +26,13 @@ var TemplateIndex = `<!DOCTYPE html>
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div class="container">
|
||||||
<h1 class="center-align">JWT</h1>
|
<div class="row">
|
||||||
</div>
|
<div>
|
||||||
|
<h1 class="center-align">JWT</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<form class="col s6 light-blue lighten-5" id="formLocal" method="post" action="/local">
|
<form class="col s6 light-blue lighten-5" id="formLocal" method="post" action="/local">
|
||||||
@@ -39,27 +43,6 @@ var TemplateIndex = `<!DOCTYPE html>
|
|||||||
<label for="name">Subject :</label>
|
<label for="name">Subject :</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<div class="input-field col s12">
|
|
||||||
<i class="material-icons prefix">account_balance</i>
|
|
||||||
<input type="text" id="id_entreprise" name="id_entreprise" value="1">
|
|
||||||
<label for="name">Id entreprise :</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="input-field col s12">
|
|
||||||
<i class="material-icons prefix">fiber_pin</i>
|
|
||||||
<input type="text" id="scopes" name="scopes" value="purchase">
|
|
||||||
<label for="name">Scopes :</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="input-field col s12">
|
|
||||||
<i class="material-icons prefix">fiber_pin</i>
|
|
||||||
<input type="text" id="roles" name="roles" value="RCA_CLOUD_EXPERT_COMPTABLE E_COLLECTE_BO_CREA E_CREATION_CREA E_QUESTIONNAIRE_CREA">
|
|
||||||
<label for="name">Roles :</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
<i class="material-icons prefix">account_balance</i>
|
<i class="material-icons prefix">account_balance</i>
|
||||||
@@ -74,6 +57,27 @@ var TemplateIndex = `<!DOCTYPE html>
|
|||||||
<label for="name">Secret :</label>
|
<label for="name">Secret :</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="input-field col s12">
|
||||||
|
<i class="material-icons prefix">fiber_pin</i>
|
||||||
|
<input type="text" id="scopes" name="scopes" value="purchase">
|
||||||
|
<label for="name">Scopes :</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="input-field col s12">
|
||||||
|
<i class="material-icons prefix">account_balance</i>
|
||||||
|
<input type="text" id="id_entreprise" name="id_entreprise" value="1">
|
||||||
|
<label for="name">Id entreprise : (0 absent du token)</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="input-field col s12">
|
||||||
|
<i class="material-icons prefix">fiber_pin</i>
|
||||||
|
<input type="text" id="roles" name="roles" value="RCA_CLOUD_EXPERT_COMPTABLE E_COLLECTE_BO_CREA E_CREATION_CREA E_QUESTIONNAIRE_CREA">
|
||||||
|
<label for="name">Roles :</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a class="waves-effect waves-light btn" onclick="generateToken('formLocal');"><i
|
<a class="waves-effect waves-light btn" onclick="generateToken('formLocal');"><i
|
||||||
class="material-icons left">cloud</i>Local</a>
|
class="material-icons left">cloud</i>Local</a>
|
||||||
@@ -97,29 +101,31 @@ var TemplateIndex = `<!DOCTYPE html>
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
<i class="material-icons prefix">account_balance</i>
|
<i class="material-icons prefix">fiber_pin</i>
|
||||||
<input type="text" id="clientSecret" name="clientSecret" value="xxxxxxxx">
|
<input type="text" id="clientSecret" name="clientSecret" value="xxxxxxxx">
|
||||||
<label for="name">Client Secret :</label>
|
<label for="name">Client Secret :</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="input-field col s12">
|
<div class="input-field col s12">
|
||||||
<i class="material-icons prefix">account_balance</i>
|
<i class="material-icons prefix">fiber_pin</i>
|
||||||
<input type="text" id="scopes" name="scopes" value="user">
|
<input type="text" id="clientScopes" name="clientScopes" value="user">
|
||||||
<label for="name">Scopes</label>
|
<label for="name">clientScopes</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="checkbox col s12">
|
<div class="input-field center-align col s12">
|
||||||
<label>
|
<select id="currentCompany" name="currentCompany">
|
||||||
<input type="checkbox" id="currentCompany" name="currentCompany" checked="checked" />
|
<option value="true" selected>entreprise partenaire</option>
|
||||||
<span>Company courante</span>
|
<option value="false" >Sans entreprise</option>
|
||||||
</label>
|
<option value="none" >CAS</option>
|
||||||
|
</select>
|
||||||
|
<label>Entreprise</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a class="waves-effect waves-light btn" onclick="generateToken('formOAtuh20');"><i
|
<a class="waves-effect waves-light btn" onclick="generateToken('formOAtuh20');">
|
||||||
class="material-icons left">cloud</i>OAuth2.0</a>
|
<i class="material-icons left">cloud</i>OAuth2.0</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -128,4 +134,12 @@ var TemplateIndex = `<!DOCTYPE html>
|
|||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
var elems = document.querySelectorAll('select');
|
||||||
|
var instances = M.FormSelect.init(elems, {});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
</html>`
|
</html>`
|
||||||
|
|||||||
Reference in New Issue
Block a user