jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.02k forks source link

Social Login Failure "Cannot POST" Angular2 #5314

Closed jd-carroll closed 7 years ago

jd-carroll commented 7 years ago
Overview of the issue

Social login does not appear to be working. When I navigate to the registration page and click on Google or Facebook I see something similar to: Cannot POST /signin/facebook

(Angular2)

Motivation for or Use Case

All default social login connectors seem to be broken

Reproduce the error

Install latest version of JHipster and use the yo-rc provided below. Navigate to the registration page and select one of the connectors.

Related issues

Not sure how or if this is related to #5002

Suggest a Fix

Not sure what the issue is... (Maybe something I am [not] doing)

JHipster Version(s)

JHipster: v4.0.6

JHipster configuration
{
  "generator-jhipster": {
    "jhipsterVersion": "4.0.6",
    "baseName": "sample",
    "packageName": "com.sample",
    "packageFolder": "com/sample",
    "serverPort": "8080",
    "authenticationType": "jwt",
    "hibernateCache": "no",
    "clusteredHttpSession": false,
    "websocket": "spring-websocket",
    "databaseType": "mongodb",
    "devDatabaseType": "mongodb",
    "prodDatabaseType": "mongodb",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSocialSignIn": true,
    "jwtSecretKey": "13a3f6c1bd19073e8203f8873f0708108ebaa6ee",
    "clientFramework": "angular2",
    "useSass": true,
    "clientPackageManager": "npm",
    "applicationType": "monolith",
    "testFrameworks": [
      "gatling",
      "cucumber",
      "protractor"
    ],
    "jhiPrefix": "jhi",
    "enableTranslation": false
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

OS X: 10.11.6 Chrome: 56.0.2924.87 (64-bit)

jdubois commented 7 years ago

Did you follow the Spring Social documentation, and set up your API keys?

jd-carroll commented 7 years ago

That's probably it, I was just prototyping something quickly (never used the social connectors) and missed the doc's in the .yml files. I'll try creating those, which I'm fairly confident will solve the issue. Closing pre-emptively

s-t-x commented 7 years ago

This looks exactly like your spring security is not enabled.

AndersonSM commented 7 years ago

I'm having the same issue and my API keys are set up fine. Any advices?

s-t-x commented 7 years ago

API keys are not enough. If you are accessing the app via http, enable spring security and when you do switch to https, it will work.

AndersonSM commented 7 years ago

Sorry, but can you be a little more specific? My backend is running on HTTPS now, but not my frontend. This is how my application.yml file looks like. untitled

jdubois commented 7 years ago

I'm sorry but this isn't a bug -> can you discuss this on Stackoverflow, using the "jhipster" tag? As written in the guidelines, this bug tracker is just for tracking bug, it's not a support forum. The right place for this is Stackoverflow, and you will have there more people helping you (and you will also help more people there)