Comments (1)
直接使用POST /login 传用户名密码进行登录认证,然后取得access token ,而不是使用浏览器的登录页?
首先你说的这点是密码模式的认证方式,不适用与oauth2.1,或者你可以自己做增强让其支持密码模式,可以看我下面所说的demo的password分支
此外
前后端分离我已经找到一个最佳的方式实现了,主要开启客户端信息的 clientAuthenticationMethod(ClientAuthenticationMethod.NONE)
及 clientSettings
设置需要设置为 requireProofKey(true)
,前端应用可以加入 oidc-client-ts
依赖,或者按照oauth2的认证流程自己编写代码逻辑。
我实现的方式主要是OIDC + PKCE,具体实例是通过 sas 的 issues 的一个大佬中学习的 issues地址
也可以通过我最近弄的demo尝试,我里面用到的登陆页是按照react项目打包再嵌入到后端服务器使用的,习惯了写前端的伙伴可以使用这种方式整合到java后端,毕竟现在偷懒不写样式太难了,很多组件库都不支持CDN了。
在我学习这个oauth认证过程,感觉大家跟我一样主要卡在的位置是不理解前端一个登陆页,认证服务器一个登陆页应该怎么处理这个认证过程,如果密码模式就直接一个post请求过去就好了。但是用授权码模式的话要抛开这个概念,直接把前端的登录页干掉,没进行认证跳转到欢迎页就好,点击欢迎页的登录再跳转到认证服务器的登录页即可。这个过程你可以看看腾讯的应用,目前都已经看不见登陆页,基本都是oauth授权页是吧。各位不要被企业应用的包袱拖累了。
至于原生APP怎么实现呢,因为可能没办法优雅的嵌入完成,虽然可以弹出一个浏览器窗口进行认证也不是不行,之后再研究怎么实现比较好。
@bulldriver
@limng06
@MrQiaoLei
from id-server.
Related Issues (20)
- 老哥有计划将其单独封装为 SP 的 starter 模块吗? HOT 1
- 【Feature】增加C/S客户端登录
- 【Feature】提供会话管理功能 HOT 1
- 请问这种客户端模式还能把登录页面拆出来吗 HOT 3
- 【Update】依赖更新,升级Authorization Server版本 HOT 1
- 启动时找不到注入类 HOT 4
- 关于访问其他请求返回500错误的问题 HOT 3
- 请问针对前后端分离使用ajax请求的情况如何优雅的做到跳转登录 HOT 4
- 问一下客户端的private_key_jwt怎么配置呢? HOT 3
- 请问使用py语言开发的项目使用id-server,需要额外做哪些工作 HOT 3
- 【Feature】管理客户端的用户 HOT 1
- 关于资源服务器获取token的问题咨询
- Oidc的例子里, 返回重定向只能指定到"/"吗?? HOT 1
- 前后端分离版本 HOT 1
- id-server怎么结合现已有的权限呢? HOT 1
- client的授权方式改为refresh_token后跑不通 HOT 2
- 打包成jar包后运行,访问http://xxxx:9000/system/login报500错误,模板资源找不到
- [invalid_user_info_response] An error occurred while attempting to retrieve the UserInfo Resource: 403 : "{"error":"insufficient_scope"}" HOT 3
- Could not resolve placeholder 'server.port' in value "${server.port}" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from id-server.