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.54k stars 4.02k forks source link

Add (optional) support for Social Login via SpringSocial #684

Closed dwelch2344 closed 9 years ago

dwelch2344 commented 10 years ago

I was thinking of adapting the approach in the following article and adding it to the build process. I'm currently implementing it in a generated app at the moment. I haven't done much with Yeoman generators before, but if there's interest I'd be happy to contribute it.

http://www.petrikainulainen.net/programming/spring-framework/adding-social-sign-in-to-a-spring-mvc-web-application-configuration/

jcr216 commented 10 years ago

I'm interested. I followed a similar approach and have also implemented it in a generated app as well. Were you able to get the Spring Social login to work when using OAuth2? I had a bit of trouble there and only have it working with cookie-based authentication.

jcr216 commented 10 years ago

If there's any interest from the JHipster team I'm between projects at work right now and have the time to work on it this week. I have this mostly working with Google and Facebook in my own app but have not yet done the work to edit the yeoman generator.

If there is any interest, there's a few things that I could use some input on:

I'd be happy to share an example of what I have so far and revise as necessary to incorporate social login into the project. David, you mentioned that you've also done this. If you're still interested perhaps we could work together on it.

8cells commented 10 years ago

+1

jdubois commented 10 years ago

@jcr216 of course there is interest! As this is an option in the generator (with the cookie-based and OAuth2 options), this does not have big consequences on the rest of the codebase, which is of course the best for us. So to answer your questions in order:

If you have questions, anything, please add them to this thread or ping me by mail (firstname.lastname@gmail.com).

dwelch2344 commented 10 years ago

Sorry, been a hectic week. I'd be happy to collaborate on it!

Some thoughts:

I'm hoping to start work on a reference app this weekend. Would be happy to share.

jdubois commented 10 years ago

Great, but there is no need for a sub generator: if the user selects "social login" you prompt him a new multiple choice question, with twitter, facebook, etc But first finish your reference app, then we'll see how best to transform it into a template

jcr216 commented 10 years ago

Ok I have a very rough version of this working. It supports login and registration using Google and Facebook. The fork is here. To run the app:

  1. Clone it, and then run "bower install" to bring in some new dependencies
  2. In application-dev.yml, configure your client id and secret for Google and Facebook.
  3. mvn spring-boot:run
  4. Go to localhost:8080. It's important NOT to use 0.0.0.0 (like grunt server defaults to). The app is using server side redirection for the OAuth2 authentication with Google and Facebook. Neither of these services will accept a redirect from 0.0.0.0.

Regarding #2, you need to register an application with Google and Facebook (see the comments in the YML file). You also need to add http://localhost:8080 as an authorized redirection source. In case anyone wants to test this out without going through the required Google/Facebook setup, send me an email (my Github username at gmail dot com) and I'll share client ids/secrets that you can plugin to your YML.

Per Julien's suggestion, I did the work in the form of an updated sample rather than modify the templates. Per David's suggestion, I modeled the external accounts as a one-to-many to allow multiple external accounts to be associated with a single internal account (see T_EXTERNAL_ACCOUNT table.

A few things to note:

David, it sounds like you have some interesting ideas. You also have it working with the OAuth2 token based stuff whereas mine only works with session based logins. Feel free to use what I started and make massive changes. I spent longer than I'd care to admit screwing around with Spring Security. If you're in the same boat hopefully my work will give you a jumpstart. If you just want to start your own thing that's cool too.

jjb3rd commented 9 years ago

@jcr216 you probably want to take your secret keys out of the repo, and/or change them! Sorry for telling you through a message thread, but I don't know how else to reach you. Thanks for all the great work!

jcr216 commented 9 years ago

D'oh! Thanks for the heads up. Totally forgot about that before I committed last night.

On Wed, Nov 5, 2014 at 9:27 AM, John Becker notifications@github.com wrote:

@jcr216 https://github.com/jcr216 you probably want to take your secret keys out of the repo, and/or change them! Sorry for telling you through a message thread, but I don't know how else to reach you. Thanks for all the great work!

— Reply to this email directly or view it on GitHub https://github.com/jhipster/generator-jhipster/issues/684#issuecomment-61814101 .

jcr216 commented 9 years ago

Besides accidently sharing my client secrets with the entire world last night, this is moving along well. Screenshots are available here.

Here's where the code is:

If anyone is interested in helping, here's what's left:

jcr216 commented 9 years ago

Mongo support: https://github.com/jcr216/jhipster-sample-app/tree/mongo

nectic commented 9 years ago

How to get user birthday via facebook/google using spring social class org.springframework.social.connect.UserProfile?

MartinLichtblau commented 9 years ago

Long time no news. Will you intergrate this feature in jhipster? I would really appreciate it!

8cells commented 9 years ago

:+1:

jdubois commented 9 years ago

@MartinLichtblau I would love to integrate it, but it's not finished yet (as far as I understand), and then the integration process can be quite long. So don't expect this for too soon! @jcr216 are you still working on this?

MartinLichtblau commented 9 years ago

Hopefully @jcr216 replies :+1:

Here are two helpful webpages on the topic: UpToDate tutorial about spring Social with MVC HowTo define localhost as valid domain name P.S.: I tried your fork and it worked!

MartinLichtblau commented 9 years ago

I just found out that facebook will shutdown Graph API v.1 in April 2015 and use their new v.2 instead. Spring Social is still working on a new version. But I tried the pre-version and your authentication still works.

jcr216 commented 9 years ago

I was a bit busy with the holidays and whatnot. I'm working on this again today.

jcr216 commented 9 years ago

I have the backend changes merged into the generator: https://github.com/jcr216/generator-jhipster. It compiles and runs and I can confirm that I didn't break the existing login system.

I need to make some changes to the frontend code given that the frontend has been reorganized since I originally wrote the social auth stuff.

jcr216 commented 9 years ago

I've finished adding the social changes to the generator. At this point, it's functional and builds an app that works out of the box with Google. The code for Facebook is there and was working in my modified sample app, I just haven't had a chance to test it after incorporating it into the generator.

There are still a few minor issues to resolve, but this is pretty close to becoming a pull request. If anyone has the time to test my changes that would be helpful.

svennela commented 9 years ago

I can put some time for testing. please let me know the repo or steps

PeterEltgroth commented 9 years ago

I also have interest in this, and will find time to test in the next few days.

@svennela the repo is https://github.com/jcr216/generator-jhipster

svennela commented 9 years ago

Hi Peter,

how do i start? do you have any steps? or check list? please help with starting, will take it from their.

jcr216 commented 9 years ago

First clone the repo. After you've cloned the repo, use npm link to replace the default generator with my version. Run yo jhipster and select cookie based auth and at least one social provider. Next, add your client id and secret in application.ym. Finally, do mvn -DskipTests spring-boot:run on the new application to fire it up.

Not sure why the tests are failing. I was getting something like "metric already registered" when I tried to run the tests (which is not at all related to the changes that I made).

svennela commented 9 years ago

I am able to link your repo but running into when I did yo jhipster Error: Cannot find module 'underscore' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/Users/generator-jhipster/app/index.js:6:9) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

gmarziou commented 9 years ago

Run npm install underscore in your generator-jhipster directory

svennela commented 9 years ago

Thank you. I am creating appid in facebook. Do you know what is the call back URL?

PeterEltgroth commented 9 years ago

A quick update. I spent some time on this last night. When I generated using cookie auth, SQL, mvn, grunt, java 8 the application starts without error and gives me the Buttons for Google and Facebook login. Unfortunately, I have something misconfigured currently at both providers.

With Google I need to register localhost as a redirect URI, but haven't found where to configure it on Googles site, and when clicking the Facebook button it sends me to http://localhost:8080/auth/facebook?scope=public_profile,email, which returns a 404.

I also generated a project using cookie auth, NoSQL, mvn, grunt and java 8, upon running it with mvn -DskipTests spring-boot:run I received the error below, setUser() is missing, but I have not attempted to debug it beyond that yet. Is mongo expected to work on this branch?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jhipster: Compilation failure
[ERROR]
.../src/main/java/com/mycompany/myapp/service/UserService.java:[86,28] cannot find symbol
[ERROR] symbol:   method setUser(com.mycompany.myapp.domain.User)
[ERROR] location: variable externalAccount of type com.mycompany.myapp.domain.ExternalAccount

I'll continue looking at it tonight.

MartinLichtblau commented 9 years ago

Did you setup the facebook graph api like mentioned here?

jjb3rd commented 9 years ago

I think you'll need to set up an alias for local host in your /etc/hosts file for a fake domain and set up that domain in Facebook et al. Facebook doesn't let you use localhost.

On Jan 8, 2015, at 11:16 AM, Peter Eltgroth notifications@github.com wrote:

A quick update. I spent some time on this last night. When I generated using cookie auth, SQL, mvn, grunt, java 8 the application starts without error and gives me the Buttons for Google and Facebook login. Unfortunately, I have something misconfigured currently at both providers.

With Google I need to register localhost as a redirect URI, but haven't found where to configure it on Googles site, and when clicking the Facebook button it sends me to http://localhost:8080/auth/facebook?scope=public_profile,email, which returns a 404.

I also generated a project using cookie auth, NoSQL, mvn, grunt and java 8, upon running it with mvn -DskipTests spring-boot:run I received the error below, setUser() is missing, but I have not attempted to debug it beyond that yet. Is mongo expected to work on this branch?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jhipster: Compilation failure [ERROR] .../src/main/java/com/mycompany/myapp/service/UserService.java:[86,28] cannot find symbol [ERROR] symbol: method setUser(com.mycompany.myapp.domain.User) [ERROR] location: variable externalAccount of type com.mycompany.myapp.domain.ExternalAccount I'll continue looking at it tonight.

— Reply to this email directly or view it on GitHub.

davykiala commented 9 years ago

I am new in the project. I am interested by the project. I've tried to test. I've followed instruction as suggested by jcr216. I did :

  1. Clone the repo https://github.com/jcr216/generator-jhipster in my PC
  2. Run "npm link jhipster" to replace the default generator with the generator cloned version.
  3. In the generator-jhipster, i run "npm install underscore"
  4. Run yo jhipster and select cookie based auth and at the both social provider.
  5. Add your client id and secret in application.ym.
  6. Finally, do mvn -DskipTests spring-boot:run on the new application to fire it up. I add the following error : [INFO] Scanning for projects... [INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1 [INFO]
    [INFO] ------------------------------------------------------------------------ [INFO] Building recruting 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> spring-boot-maven-plugin:1.2.0.RELEASE:run (default-cli) @ recruting >>> [INFO] [INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ recruting --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ recruting --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 4 resources [INFO] Copying 11 resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ recruting --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 95 source files to C:\Programming\WORKSPACE_JHIPSTER\target\classes [INFO] ------------------------------------------------------------- [WARNING] COMPILATION WARNING : [INFO] ------------------------------------------------------------- [WARNING] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java: C:\Programming\WORKSPACE_JHIPSTER\src\main\java\com\daytech\recrut\config\SecurityConfiguration.java uses unchecked or unsafe operations. [WARNING] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java: Recompile with -Xlint:unchecked for details. [INFO] 2 warnings [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/repository/UserRepository.java:[4,34] package com.mycompany.myapp.domain does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/repository/UserRepository.java:[31,45] cannot find symbol symbol: class ExternalAccountProvider location: interface com.daytech.recrut.repository.UserRepository [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java:[4,43] package com.mycompany.myapp.security.social does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/service/UserService.java:[4,34] package com.mycompany.myapp.domain does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/service/UserService.java:[75,62] cannot find symbol symbol: class ExternalAccount location: class com.daytech.recrut.service.UserService [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/service/UserService.java:[113,55] cannot find symbol symbol: class ExternalAccount location: class com.daytech.recrut.service.UserService [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[3,34] package com.mycompany.myapp.domain does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[28,17] cannot find symbol symbol: class ExternalAccount location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[45,44] cannot find symbol symbol: class ExternalAccount location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[56,69] cannot find symbol symbol: class ExternalAccount location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[92,16] cannot find symbol symbol: class ExternalAccount location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java:[77,15] cannot find symbol symbol: class SocialLoginExceptionMapper location: class com.daytech.recrut.config.SecurityConfiguration [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java:[77,56] cannot find symbol symbol: class SocialLoginExceptionMapper location: class com.daytech.recrut.config.SecurityConfiguration [INFO] 13 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.218 s [INFO] Finished at: 2015-01-08T22:36:32+01:00 [INFO] Final Memory: 31M/239M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project recruting: Compilation failure: Compilation failure: [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/repository/UserRepository.java:[4,34] package com.mycompany.myapp.domain does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/repository/UserRepository.java:[31,45] cannot find symbol [ERROR] symbol: class ExternalAccountProvider [ERROR] location: interface com.daytech.recrut.repository.UserRepository [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java:[4,43] package com.mycompany.myapp.security.social does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/service/UserService.java:[4,34] package com.mycompany.myapp.domain does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/service/UserService.java:[75,62] cannot find symbol [ERROR] symbol: class ExternalAccount [ERROR] location: class com.daytech.recrut.service.UserService [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/service/UserService.java:[113,55] cannot find symbol [ERROR] symbol: class ExternalAccount [ERROR] location: class com.daytech.recrut.service.UserService [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[3,34] package com.mycompany.myapp.domain does not exist [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[28,17] cannot find symbol [ERROR] symbol: class ExternalAccount [ERROR] location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[45,44] cannot find symbol [ERROR] symbol: class ExternalAccount [ERROR] location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[56,69] cannot find symbol [ERROR] symbol: class ExternalAccount [ERROR] location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/web/rest/dto/UserDTO.java:[92,16] cannot find symbol [ERROR] symbol: class ExternalAccount [ERROR] location: class com.daytech.recrut.web.rest.dto.UserDTO [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java:[77,15] cannot find symbol [ERROR] symbol: class SocialLoginExceptionMapper [ERROR] location: class com.daytech.recrut.config.SecurityConfiguration [ERROR] /C:/Programming/WORKSPACE_JHIPSTER/src/main/java/com/daytech/recrut/config/SecurityConfiguration.java:[77,56] cannot find symbol [ERROR] symbol: class SocialLoginExceptionMapper [ERROR] location: class com.daytech.recrut.config.SecurityConfiguration [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

The error happens in the Class : UserRepository. The import of ExternalAccountProvider contains a strange package with does not exist.

import com.mycompany.myapp.domain.ExternalAccountProvider; import com.daytech.recrut.domain.User;

import org.joda.time.DateTime; import org.springframework.data.jpa.repository.JpaRepository; import java.util.Optional; import org.springframework.data.jpa.repository.Query;

import java.util.List; import java.util.Optional;

/**

PeterEltgroth commented 9 years ago

@MartinLichtblau thanks for the link, I have set it up that way, and tried a few additional variations, but it is still not working.

@jjb3rd Facebook let me save localhost in App Domains (localhost), Site Url (http://localhost:8080/), and Valid OAuth redirect URIs (http://localhost:8080/). Do you know if this is a recent change? Or do they let you save localhost, but it will not work (which would be bad form on their part)?

@jcr216 Any suggestions on the Facebook config?

For Google, I have the Identity Toolkit API enabled, created a Client ID for web application with a Redirect URI of http://localhost:8080/auth/google, and configured the Consent Screen with my email and a Product Name of jhipster. After doing so, I:

and I get: Registration failed! Please try again later.

Per the logs below, it appears AccountResource.registerAccount() and UserService.createUserInformation() need refactoring to handle nulls in most of the fields (or perhaps I'm not getting as much information back from Google as expected). I'll take a crack at refactoring it in the next few days, unless you or someone else beats me to it.

[DEBUG] com.mycompany.myapp.aop.logging.LoggingAspect - Enter: com.mycompany.myapp.web.rest.AccountResource.registerAccount() with argument[s] = [UserDTO{login='peter', password='null', firstName='null', lastName='null', email='null', langKey='en', roles=null, externalAccounts=[]}, SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.context.HttpSessionSecurityContextRepository$Servlet3SaveToSessionRequestWrapper@49c4444f]]
[ERROR] com.mycompany.myapp.aop.logging.LoggingAspect - Exception in com.mycompany.myapp.web.rest.AccountResource.registerAccount() with cause = null
java.lang.NullPointerException: null
    at com.mycompany.myapp.web.rest.AccountResource.registerAccount(AccountResource.java:205) ~[classes/:na]
    at com.mycompany.myapp.web.rest.AccountResource$$FastClassBySpringCGLIB$$bb2cce5e.invoke(<generated>) ~[spring-core-4.1.3.RELEASE.jar:na]
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE]
...
MartinLichtblau commented 9 years ago
jjb3rd commented 9 years ago

Not sure...when I tried to use localhost:8080 Facebook balked and said it had to be a fully qualified domain name...hence me tricking it with the /etc/hosts file. This was a little over a month ago and I thought it was a new policy at the time, but maybe they've relaxed it a bit.

On Jan 9, 2015, at 2:57 AM, Peter Eltgroth notifications@github.com wrote:

@MartinLichtblau thanks for the link, I have set it up that way, and tried a few additional variations, but it is still not working.

@jjb3rd Facebook let me save localhost in App Domains (localhost), Site Url (http://localhost:8080/), and Valid OAuth redirect URIs (http://localhost:8080/). Do you know if this is a recent change? Or do they let you save localhost, but it will not work (which would be bad form on their part)?

@jcr216 Any suggestions on the Facebook config?

For Google, I have the Identity Toolkit API enabled, created a Client ID for web application with a Redirect URI of http://localhost:8080/auth/google, and configured the Consent Screen with my email and a Product Name of jhipster. After doing so, I:

Click on the SIgn in with Google button Select my Google account Agree to the consent screen Enter 'peter' as a Login name on a Registration page and I get: Registration failed! Please try again later.

Per the logs below, it appears AccountResource.registerAccount() and UserService.createUserInformation() need refactoring to handle nulls in most of the fields (or perhaps I'm not getting as much information back from Google as expected). I'll take a crack at refactoring it in the next few days, unless you or someone else beats me to it.

[DEBUG] com.mycompany.myapp.aop.logging.LoggingAspect - Enter: com.mycompany.myapp.web.rest.AccountResource.registerAccount() with argument[s] = [UserDTO{login='peter', password='null', firstName='null', lastName='null', email='null', langKey='en', roles=null, externalAccounts=[]}, SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.context.HttpSessionSecurityContextRepository$Servlet3SaveToSessionRequestWrapper@49c4444f]] [ERROR] com.mycompany.myapp.aop.logging.LoggingAspect - Exception in com.mycompany.myapp.web.rest.AccountResource.registerAccount() with cause = null java.lang.NullPointerException: null at com.mycompany.myapp.web.rest.AccountResource.registerAccount(AccountResource.java:205) ~[classes/:na] at com.mycompany.myapp.web.rest.AccountResource$$FastClassBySpringCGLIB$$bb2cce5e.invoke() ~[spring-core-4.1.3.RELEASE.jar:na] at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] ... — Reply to this email directly or view it on GitHub.

davykiala commented 9 years ago

I have run the application with the default configuration package com.mycompany.myapp. I want just to let you know that i think there is a problem when we change the package com.mycompanny.myapp when this is proposed to us in command line interface. If we change the package name, ExternalAccountProvider.java will not have the correct package in it. Could you tell me where to configure the facebookAppId and secret ?

PeterEltgroth commented 9 years ago

@davykiala application.yml

PeterEltgroth commented 9 years ago

FYI: I haven't gotten this working yet, but have had little time in the last week. I will get back to it as soon as I can, but don't know exactly when that will be.

spereverziev commented 9 years ago

I'am also interesting in this feature. Is anyone working on this ? Thanks

PeterEltgroth commented 9 years ago

Sorry, still on my list, but swamped at work and home. Please join the effort, the posts above detail where I left off an and suggestions on how to get get beyond my state.

davykiala commented 9 years ago

I want to integrate social login as you explain in project generated by jhipster 2.1.1. Which authentication option i have to choose. ❯ HTTP Session Authentication (stateful, default Spring Security mechanism) OAuth2 Authentication (stateless, with an OAuth2 server implementation) Token-based authentication (stateless, with a token)

I think it is OAuth2 Authentication (stateless, with OAuth2 server implementation). Is this suitable for an mobile client app ? I am creating a POC with a Jhipster project with login with social and want to create the mobile app client with ionic.

iceman91176 commented 9 years ago

Hello, i am currently working on an implemetation of OpenId-Connect Authentication, since we would like a single-sign-on approach,but using facebook/google/etc. accounts for our company-internal applications is not an option. I did use some parts of this fork, especially the database part. I have it up and running, and would like to share my work. The question is - shall i create an entire new fork of jhipster ? I am pretty new to github ;-)

Here is a Sample-JHipster App https://github.com/iceman91176/jhipster-oidc-sample

Generator is also available -> https://github.com/iceman91176/generator-jhipster

jjb3rd commented 9 years ago

Don't they all use OAuth2 now?

On Mar 3, 2015, at 2:46 AM, iceman91176 notifications@github.com wrote:

Hello, i am currently working on an implemetation of OpenId-Connect Authentication, since we would like a single-sign-on approach,but using facebook/google/etc. accounts for our company-internal applications is not an option. I did use some parts of this fork, especially the database part. I have it up and running, and would like to share my work. The question is - shall i create an entire new fork of jhipster ? I am pretty new to github ;-)

— Reply to this email directly or view it on GitHub.

iceman91176 commented 9 years ago

More or less, yes. It probably could have been done with a spring-social extension for WSO2 identity server. But sice the authentication-stuff had been done before by us, it was easier to integrate it, than creating a new extension.

jdubois commented 9 years ago

I'm closing this ticket as the work that has been done is not possible to merge, and as no work as been done for a long time. I'd love to merge this, so if anybody wants to implement this, feel free to open up a new ticket.