Closed suretrust closed 4 years ago
From response, it seems related with token authorization. Do you enable token on your agora console?
How do I enable that? @yoreland
did you check this url? https://docs.agora.io/en/faq/restful_authentication
Yes, @yoreland, I followed it and added it. It's in the .env
file of the repo I added in the post above.
Just double check your .env file. The restful_token need using base64 encoded token. Currently your are using plain text, try to use MzgzMzM3MGJiZGRmNGE1MTkzMDdjOTYwNDFmMTdjMjM6YjE2MTRlMWUzOTM0NGI0ZWI4MjI5ZGY4MDcwNGNhZTQ=
I used it and still didn't work. 😢
What should be my REACT_APP_AGORA_RTM_ENDPOINT
? @yoreland
Also, am I supposed to enclose each constant as a string? For example:
REACT_APP_AGORA_RESTFULL_TOKEN="Basic MzgzMzM3MGJiZGRmNGE1MTkzMDdjOTYwNDFmMTdjMjM6YjE2MTRlMWUzOTM0NGI0ZWI4MjI5ZGY4MDcwNGNhZTQ="
Or it's fine as shown below without the quotes?
REACT_APP_AGORA_RESTFULL_TOKEN=Basic MzgzMzM3MGJiZGRmNGE1MTkzMDdjOTYwNDFmMTdjMjM6YjE2MTRlMWUzOTM0NGI0ZWI4MjI5ZGY4MDcwNGNhZTQ=
it should be enclosed with quotes, and the word "Basic" could be removed from string like: REACT_APP_AGORA_RESTFULL_TOKEN="MzgzMzM3MGJiZGRmNGE1MTkzMDdjOTYwNDFmMTdjMjM6YjE2MTRlMWUzOTM0NGI0ZWI4MjI5ZGY4MDcwNGNhZTQ="
Thanks so much, I finally got it to work!
@suretrust Hi,Would you please paste your env.local here after omit your IDs.And can you give me the program you generate the base64 code?Thank you.
@alexwenbj which platform are you on? i think base64 is a pretty common lib which is available on almost every platform
@plutoless Java platform, I pasted my Java code in #157 .
Hi @alexwenbj, 👋
REACT_APP_AGORA_APP_ID=agora_app_id_without_quotes
REACT_APP_AGORA_LOG=true
REACT_APP_AGORA_CUSTOMER_ID=customer_id_without_quotes
REACT_APP_AGORA_CUSTOMER_CERTIFICATE=customer_certificate_without_quotes
REACT_APP_AGORA_RTM_ENDPOINT=your_server_rtm_endpoint_api
REACT_APP_AGORA_EDU_ENDPOINT_PREFIX=https://api.agora.io/edu
REACT_APP_YOUR_BACKEND_WHITEBOARD_API=https://api.agora.io/edu/v1/apps/%app_id%/room/%room_id%/board
REACT_APP_AGORA_RESTFULL_TOKEN=Basic MzgzMzM3MGJiZGRmNGE1MTkzMDdjOTYwNDFmMTdjMjM6YjE2MTRlMWUzOTM0NGI0ZWI4MjI5ZGY4MDcwNGNhZTQ=
REACT_APP_YOUR_OWN_OSS_BUCKET_NAME=your_oss_bucket_name
REACT_APP_YOUR_OWN_OSS_BUCKET_FOLDER=your_oss_bucket_folder
REACT_APP_YOUR_OWN_OSS_BUCKET_REGION=your_bucket_region
REACT_APP_YOUR_OWN_OSS_BUCKET_KEY=your_bucket_ak
REACT_APP_YOUR_OWN_OSS_BUCKET_SECRET=your_bucket_sk
REACT_APP_YOUR_OWN_OSS_CDN_ACCELERATE=your_cdn_accelerate_endpoint
[ ] I didn't use quotes, as in string quotes and it works fine.
[ ] You can encode your base64 here. Just click encode and fire on.
[ ] Your agora_restful_token
is your customer_id:customer_certificate
encoded in base64 and proceeded by Basic
as shown above.
Please feel free to ask any other question, hope that helps!
@suretrust Thank you. I resolved this problem.
I cloned the repo and I'm trying to set up locally but I get the error in the image attached (
login failure, please check your network
) each time I try to join a room. Here is the repo I'm working on setting up. Am I setting the.env
file wrongly?In the console, I am getting:
index.ts:71 Error: Unauthorized at onResponse