由同一Spring Boot应用程序支持的多个Facebook应用程序 [英] Multiple Facebook Apps backed by same Spring Boot application

查看:159
本文介绍了由同一Spring Boot应用程序支持的多个Facebook应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我遵循以下有关使用facebook进行春季启动的(经典)教程:

So I was following the below (classic) tutorial for spring boot with facebook:

https://spring.io/guides/tutorials/spring-boot-oauth2/

一切正常,但是我找不到文档来帮助实现特定的用例.这样就可以了:

Everything is working fine, however I can't find documentation to help me implement my specific use case. So here it goes:

  1. 我将拥有两个Facebook应用程序:一个用于所有者,另一个用于常规用户
  2. 这两个Facebook应用程序将要求不同的权限(例如:对于所有者应用程序,它将要求在粉丝页面上发布权限,对于常规用户,它是' ll仅用于基本用户信息)
  3. 将有两个真实的应用程序,一个是移动(iOS和Android),另一个是基于浏览器的应用程序(实际上并不相关)
  4. REST API将基于角色进行保护,这意味着所有者将具有 OWNER 角色,而常规用户将具有 REGULAR_USER 角色,例如,常规用户将无法调用该API张贴在粉丝页面上
  5. 这两个应用程序都可以使用或不使用facebook进行登录,因为我需要一个users表来存储更多信息,等等.
  6. 最终,常规用户可以以所有者的身份登录,如果他/她下载了所有者*"应用程序
  1. I'll have two facebook apps: one for the owner and another for the regular user
  2. These two facebook apps will ask for different permissions (ex: for owner app it'll ask for permission to post in the fanpage and for the regular user it'll only for basic user info)
  3. There will be two real application being one mobile (iOS and Android) and another browser based application (that's not really relevant)
  4. REST API will be secured based on roles, meaning that the owner will have the OWNER role and the regular user will have the REGULAR_USER role, so that, for example, the regular user won't be able to call the API to post on the fanpage
  5. Both applications will make it possible to login with or without facebook, because I need an users table to store more information and so
  6. Eventually regular user can login as owner if he/she downloads the **owner* app

因此,总而言之,我需要:

So, to summarize, I need:

  1. 两个facebook应用程序将由相同的春季启动应用程序支持
  2. 授权具有 APP ID X 的用户并分配 OWNER 角色的能力以及授权具有 APP ID Y 的用户的能力和分配角色 REGULAR_USER
  3. 要能够在YML中配置两个不同的Facebook应用
  4. 如果用户稍后再授权,则可以将现有帐户与facebook合并
  1. Two facebook apps to be backed by same spring boot application
  2. The ability to authorize an user with APP ID X and assign OWNER role and the ability to authorize an user with APP ID Y and assign role REGULAR_USER
  3. To be able to configure (in the YML) two different facebook apps
  4. The user to be able to merge existing account with facebook if he authorizes later on

我想就是这样.如果我能提供更多有用的信息,我将在稍后进行编辑.

I guess that's it. I'll edit later if I find more useful information to provide.

谢谢!

推荐答案

Dave Syer的项目显示了如何在同一应用中设置授权服务器和多个资源服务器.

There is Dave Syer's project that shows how to set up an Authorization Server and multiple Resource Servers in the same app.

与解决方案类似的问题:

Similar question with solution: OAuth2 SSO for multiple resource servers with spring boot and jHipster

这篇关于由同一Spring Boot应用程序支持的多个Facebook应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆