Skip to content

Commit

Permalink
add qr issuer name to settngs
Browse files Browse the repository at this point in the history
  • Loading branch information
abbas-gheydi committed Dec 13, 2021
1 parent 46a4e68 commit 0a12983
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Download [RadOTP](https://github.com/Abbas-gheydi/radotp/releases) and install i
```bash
sudo install ./radotp /usr/local/bin/
````
if you want to launch it as a service, you must make a new [systemd serivce](https://www.suse.com/support/kb/doc/?id=000019672).
if you want to run it as a service, you must make a new [systemd serivce](https://www.suse.com/support/kb/doc/?id=000019672).

### How to Use it:
- install PostgreSQL and configure it.
Expand All @@ -31,7 +31,7 @@ radotp

- Then Download [Google Authenticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en_US&gl=US) and scan the QR code.

- Config Cisco or Fortinet firewalls to use radOTP as authentication source:
- Config Cisco or Fortinet firewalls to use radOTP (Radius) as authentication source:
[Fortigate](https://docs.fortinet.com/document/fortigate/6.0.0/cookbook/200757/connecting-the-fortigate-to-the-radius-server)
[Cisco ASA](https://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-firewalls/98594-configure-radius-authentication.html)

Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func loadConfigs() {

//web configs
web.ListenAddr = cfg.Web.Listen
web.QrIssuer = cfg.Web.Isuuer

//ldap configs
rad.Auth_Provider = cfg.Ldap
Expand Down
1 change: 1 addition & 0 deletions pkgs/confs/confs.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func (c *Configurations) Load() {

type webconf struct {
Listen string
Isuuer string
}
type metrics struct {
EnablePrometheusExporter bool
Expand Down
3 changes: 2 additions & 1 deletion pkgs/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
)

var ListenAddr = "0.0.0.0:8080"
var QrIssuer = "radotp"

//go:embed templates
var templates embed.FS
Expand Down Expand Up @@ -70,7 +71,7 @@ func (t *templateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}

func createuser(user *userCode) {
user.Code, user.Qr = authentiate.NewOtpUser(user.UserName, "test")
user.Code, user.Qr = authentiate.NewOtpUser(user.UserName, QrIssuer)
user.Err = storage.Set(user.UserName, user.Code)
if user.Err != nil {
fmt.Print("errorr opts.err")
Expand Down
4 changes: 3 additions & 1 deletion radotp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@

[web]
Listen = "0.0.0.0:8080"
Isuuer = "radOTP"


[database]

server = "127.0.0.1"
port = "5432"
username = "postgres"
password = "123"
password = "dbpassword"
dbname = "postgres"
connection_max = "5"
sslmode = "disable"
Expand Down

0 comments on commit 0a12983

Please sign in to comment.