Need Help Deploying Authgear with Specific Email and SMS Providers #4432
Replies: 6 comments 15 replies
-
Hi @ilyas-sudo , Thanks for your message. I noticed your // yours
authenticator:
oob_otp:
sms:
// The expected config, referenced from https://docs.authgear.com/deploy-on-your-cloud/configurations/authgear.yaml#annotated-example
# Configure different authenticator behavior.
authenticator:
oob_otp:
email:
maximum: 1
sms:
maximum: 1 I would appreciate if you could send your YAML configuration again with by wrapping in triple backticks (```yaml). That way I can help check if your other yaml configuration conform to suggested schema 👍 I suspect your Once you've updated your file, try restarting your Authgear server and see if the issue is resolved. Hope it helps. Let me know if you have any other questions! |
Beta Was this translation helpful? Give feedback.
-
Hi,
|
Beta Was this translation helpful? Give feedback.
-
Hi @ilyas-sudo, thank you for the response. Similarly, I noticed you have # yours
verification:
claims:
email:
enabled: true
required: true
sms:
default:
url: https://manage.smsniaga.com/sms/api
# expected config from https://docs.authgear.com/deploy-on-your-cloud/configurations/authgear.yaml#annotated-example
verification:
claims:
email:
enabled: true
required: true
phone_number: # notice this is `phone_number` instead of `sms`, and it is under `verification.claims`
enabled: true
required: true I highly recommend you review our documentation on Let me know if you have other questions! |
Beta Was this translation helpful? Give feedback.
-
hi @ilyas-sudo . Thanks for reaching out. I guess you want to set up a custom Email provider and a custom SMS provider. For delivering emails, Authgear supports SMTP, so as long as your provider supports SMTP, you can provide the credentials in authgear.secrets.yaml For delivering SMS, Authgear natively support Twilio. If you are using a provider other than Twilio, then you need to write a simple HTTP server to work as a bridge between Authgear and your provider. Here is the example configuration authgear.yaml # Only changes are shown here. You keep all your original fields.
messaging:
sms_provider: custom authgear.secrets.yaml # Only changes are shown here. You keep all your original fields.
# secrets is an array. You keep all your original items.
secrets:
# Add this secret to configure SMTP provider
- data:
# https://developers.sparkpost.com/api/smtp/
# I assume you are NOT using SparkPost EU.
# If you do use SparkPost EU, then
# host: smtp.eu.sparkpostmail.com
host: smtp.sparkpostmail.com
port: 587
username: SMTP_Injection
password: "REPLACE_YOUR_API_KEY_HERE"
key: mail.smtp
# Add this secret to configure a custom SMS gateway
- data:
# The URL to your simple HTTP server that bridges Authgear and your SMS provider.
# Here I suppose your simple HTTP server serves at /
url: http://localhost:9876/
timeout: 10
key: sms.custom Then you need to ensure your simple HTTP server run at http://localhost:9876 Here is an example written in Golang package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// Here we just dump the request to see what Authgear gives us.
// You need to call your SMS provider to deliver SMS in your server!
b, _ := httputil.DumpRequest(r, true)
fmt.Printf("%v\n", string(b))
})
http.ListenAndServe(":9876", nil)
} The request you receive from Authgear looks like
You parse the request body as a JSON document. You extract the |
Beta Was this translation helpful? Give feedback.
-
Thank you for response. this is my after changes authgear.yaml
and this is my authgear.secret.yaml
and this is the golang app
|
Beta Was this translation helpful? Give feedback.
-
and also give me this error authgear-1 | time="2024-07-10T07:21:50Z" level=warning msg="skip sending email in development mode" app=my-app body="Email Verification\n\nThis email is sent to verify wajdanahmad1122@gmail.com on Authgear. Use this code in the verification page.\n\n198888\n\nDon't share it with anyone. If you didn't sign in or sign up, please ignore this email.\n" logger=mail-sender recipient=wajdanahmad1122@gmail.com reply_to= sender=no-reply@authgear.com subject="[Authgear] Email Verification Instruction" |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I'm currently setting up Authgear on my server from this documents ( https://docs.authgear.com/deploy-on-your-cloud/local ) and encountering an issue. I've configured it to use Sparkpost for email and SMS Niaga for SMS services. However, I'm getting the following error during startup:
cannot parse app config: invalid configuration: /sms:
I've verified my authgear.yaml configuration, ensuring all necessary fields are correctly filled out. Despite this, the error persists. Could someone please assist me in troubleshooting this issue?
now i have remove the sms and email configration from my authgear.yaml
this is my simple authgear yaml file
root@racknerd-2b1f8ff:/home/myapp# cat authgear.yaml
authenticator:
oob_otp:
sms:
phone_otp_mode: sms
http:
public_origin: http://192.3.239.176:3000
id: my-app
oauth:
clients:
- client_id: 85baaca4cb4809f3
name: Portal
post_logout_redirect_uris:
- http://192.3.239.176:8000/
redirect_uris:
- http://192.3.239.176:8000/oauth-redirect
x_application_type: traditional_webapp
verification:
claims:
email:
enabled: true
required: true
kindly provide me a detailed configration to setup my email and sms provider
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions