Giang Nam Posted February 3, 2019 Share Posted February 3, 2019 Hi there, How do we authenticate with the rest api? There's swagger doc for the rest api but no information on how to connect to them, 403 Unauthorized is all I see right now. Thanks Link to comment Share on other sites More sharing options...
0 Selim Emre Posted February 3, 2019 Share Posted February 3, 2019 Hi giang,Thank you for your interest. You can access rest service in localhost. You must log in to the server for other connections. You can also delete the rest auth filter according to the below tutorial information. If you want to remove this rest filtering mechanism please remove the below lines from webapps-> {Application} -> WEBINF -> web.xml <filter> <filter-name>RestAuthenticationFiler</filter-name> <filter-class>io.antmedia.serverapp.pscp.filter.RestAuthenticationFilter</filter-class></filter><filter-mapping> <filter-name>RestAuthenticationFiler</filter-name> <url-pattern>/rest/*</url-pattern></filter-mapping> If you have any question, please feel free to ask us. Best Regards, Selim Link to comment Share on other sites More sharing options...
0 Giang Nam Posted February 4, 2019 Author Share Posted February 4, 2019 Thanks Selim, "You must log in to the server for other connections" --> How do I do this with my REST client? For example, using curl? Thanks Link to comment Share on other sites More sharing options...
0 Selim Emre Posted February 8, 2019 Share Posted February 8, 2019 Hi giang,Sorry for the delay. You can access Rest Service without Login when you insert RemoteIPfilter in Application/WEBINF/Web.xml. Please inform us, if you have any question. Good Luck! Best Regards, Selim Link to comment Share on other sites More sharing options...
0 Denner Navarro Posted March 8, 2019 Share Posted March 8, 2019 Sorry Selim, I didn't get.. What is the right way to connect through api? Is there any token to get and pass to the request? I'm trying to create a broadcast following the documentation `/broadcast/create` but i don't understand the auth since in the documentation I couldn't see any reference to the authentication part. Could you elaborate more? Link to comment Share on other sites More sharing options...
0 Selim Emre Posted March 8, 2019 Share Posted March 8, 2019 Hi Denner, Thank you for your feedback. We solved this situation in the new version. For now, you can remove the REST Filter for the application you are using. For example; you want to access LiveApp Rest Service. - You should edit SERVER_FOLDER/webapp/LiveApp/WEB-INF/web.xml - You need to delete the following lines. <filter> <filter-name>AuthenticationFilter</filter-name> <filter-class>io.antmedia.console.rest.AuthenticationFilter</filter-class> </filter> <filter-mapping> <filter-name>AuthenticationFilter</filter-name> <url-pattern>/rest/*</url-pattern> </filter-mapping> I'm hoping that I was able to answer your queries. If you have any question, please feel free to ask us. Thanks. Best Regards, Selim Link to comment Share on other sites More sharing options...
0 Denner Navarro Posted March 8, 2019 Share Posted March 8, 2019 Nice Selim Emre! It works as it supposed to :) But how about security? So now anyone can make a request to the API and create a broadcast? Link to comment Share on other sites More sharing options...
Question
Giang Nam
Link to comment
Share on other sites
Top Posters For This Question
3
2
2
Popular Days
Mar 8
3
Feb 3
2
Feb 4
1
Feb 8
1
Top Posters For This Question
Selim Emre 3 posts
Giang Nam 2 posts
Denner Navarro 2 posts
Popular Days
Mar 8 2019
3 posts
Feb 3 2019
2 posts
Feb 4 2019
1 post
Feb 8 2019
1 post
6 answers to this question
Recommended Posts