Przeglądaj źródła

Fix CORS config

Matt Raible 7 lat temu
rodzic
commit
97fdef3e12
1 zmienionych plików z 6 dodań i 2 usunięć
  1. 6
    2
      TUTORIAL.md

+ 6
- 2
TUTORIAL.md Wyświetl plik

@@ -281,9 +281,13 @@ the requested resource. Origin 'http://localhost:8100 is therefore not allowed a
281 281
 The response had HTTP status code 403.
282 282
 ```
283 283
 
284
-To fix this, you’ll need to login to https://api.stormpath.com, navigate to Applications > My Application, and modify the **Authorized Origin URIs** to include `http://localhost:8100`. 
284
+To fix this, open your Spring Boot application's `src/main/resources/application.properties` and add the following line. This enables cross-origin resource sharing (CORS) from both the browser and the mobile client. 
285 285
 
286
-At this point, you should see a login screen when you run `ionic serve`.
286
+```
287
+stormpath.web.cors.allowed.originUris = http://localhost:8100,file://
288
+```
289
+
290
+Restart Spring Boot and your Ionic app. You should see a login screen when you run `ionic serve`.
287 291
 
288 292
 ![Stormpath Login for Ionic](./static/ionic-login.png)
289 293