Introduce Credential structure to define auth type

For now we are planning to support Password and OAuthToken.
In the future, we would like to add certificate-based authentication.
This commit is contained in:
Mickael Remond
2019-10-01 10:59:55 +02:00
committed by Mickaël Rémond
parent 3b66e31888
commit 9c8353d081
10 changed files with 50 additions and 23 deletions

View File

@@ -17,7 +17,7 @@ func main() {
config := xmpp.Config{
Address: "localhost:5222",
Jid: "test@localhost",
Password: "test",
Credential: xmpp.Password("test"),
StreamLogger: os.Stdout,
Insecure: true,
// TLSConfig: tls.Config{InsecureSkipVerify: true},

View File

@@ -32,9 +32,9 @@ func main() {
// 2. Prepare XMPP client
config := xmpp.Config{
Address: *address,
Jid: *jid,
Password: *password,
Address: *address,
Jid: *jid,
Credential: xmpp.Password(*password),
// StreamLogger: os.Stdout,
Insecure: true,
}