Skip to content

Commit

Permalink
added option to configure redirect_uri for auth requests, fixes #199
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Sep 24, 2020
1 parent ff2b739 commit 4d8c1f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -691,6 +691,12 @@ pointing to the URL of your Scoold server.

**If you skip this step, authentication will most likely not work.**

In some cases ([see related issue](https://github.com/Erudika/scoold/issues/199)) you want to have Scoold connect to
Para which is hosted somewhere on your local network and logging in with some authentication providers, like Microsoft,
doesn't work. In such cases you would see an error "redirect_uri mismatch" or "invalid redirect_uri - must start with
https:// or http://localhost". To make it work you can set `para.security.redirect_uri = "https://public-para.host"`
while still keeping `para.endpoint = "http://local-ip:8080"`.

## OAuth 2.0 login

You can authenticate users against any OAuth 2.0/OpenID Connect server through the generic OAuth 2 filter in Para.
Expand Down
Expand Up @@ -127,7 +127,7 @@ public String get(HttpServletRequest req, Model model) {
model.addAttribute("title", utils.getLang(req).get("administration.title"));
model.addAttribute("configMap", configMap);
model.addAttribute("version", pc.getServerVersion());
model.addAttribute("endpoint", pc.getEndpoint());
model.addAttribute("endpoint", Config.getConfigParam("security.redirect_uri", pc.getEndpoint()));
model.addAttribute("paraapp", Config.getConfigParam("access_key", "x"));
model.addAttribute("spaces", pc.findQuery("scooldspace", "*", itemcount));
model.addAttribute("webhooks", pc.findQuery(Utils.type(Webhook.class), "*", itemcount1));
Expand Down
Expand Up @@ -238,7 +238,7 @@ public String post(HttpServletRequest req, HttpServletResponse res) {
public ResponseEntity<String> globals(HttpServletRequest req, HttpServletResponse res) {
StringBuilder sb = new StringBuilder();
sb.append("APPID = \"").append(Config.getConfigParam("access_key", "app:scoold").substring(4)).append("\"; ");
sb.append("ENDPOINT = \"").append(pc.getEndpoint()).append("\"; ");
sb.append("ENDPOINT = \"").append(Config.getConfigParam("security.redirect_uri", pc.getEndpoint())).append("\"; ");
sb.append("CONTEXT_PATH = \"").append(CONTEXT_PATH).append("\"; ");
sb.append("FB_APP_ID = \"").append(Config.FB_APP_ID).append("\"; ");
sb.append("GOOGLE_CLIENT_ID = \"").append(Config.getConfigParam("google_client_id", "")).append("\"; ");
Expand Down

0 comments on commit 4d8c1f6

Please sign in to comment.