-
Notifications
You must be signed in to change notification settings - Fork 20
/
api.go
33 lines (28 loc) · 1.08 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package okta
import (
"github.com/Symantec/Dominator/lib/log"
"github.com/Symantec/keymaster/lib/simplestorage"
)
type PasswordAuthenticator struct {
authnURL string
logger log.Logger
}
// New creates a new PasswordAuthenticator using Okta as the backend. The Okta
// Public Application API is used, so rate limits apply.
// The Okta domain to check must be given by oktaDomain.
// Log messages are written to logger. A new *PasswordAuthenticator is returned.
func NewPublic(oktaDomain string, logger log.Logger) (
*PasswordAuthenticator, error) {
return newPublicAuthenticator(oktaDomain, logger)
}
// PasswordAuthenticate will authenticate a user using the provided username and
// password.
// It returns true if the user is authenticated, else false (due to either
// invalid username or incorrect password), and an error.
func (pa *PasswordAuthenticator) PasswordAuthenticate(username string,
password []byte) (bool, error) {
return pa.passwordAuthenticate(username, password)
}
func (pa *PasswordAuthenticator) UpdateStorage(storage simplestorage.SimpleStore) error {
return nil
}