All Projects → ameizi → Oltu Oauth2 Example

ameizi / Oltu Oauth2 Example

Licence: apache-2.0
使用Apache Oltu 搭建Oauth2 Server及Client开放授权

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Oltu Oauth2 Example

Cola Cloud
Cola Cloud 基于 Spring Boot, Spring Cloud 构建微服务架构企业级开发平台,集成OAuth2认证、集成短信验证码登录、微信小程序登录、FlyWay数据库版本管理、网关集成Swagger聚合所有服务API文档。基于SpringBootAdmin集成Hystrix、Turbine监控。开发用户中心、权限管理、组织架构、数据字典、消息中心、通知中心等模块。基于MyBatisPlus Generator 开发代码生成器
Stars: ✭ 285 (-14.93%)
Mutual labels:  oauth2
Oauth2orize
OAuth 2.0 authorization server toolkit for Node.js.
Stars: ✭ 3,273 (+877.01%)
Mutual labels:  oauth2
React Aad
A React wrapper for Azure AD using the Microsoft Authentication Library (MSAL). The easiest way to integrate AzureAD with your React for authentication.
Stars: ✭ 324 (-3.28%)
Mutual labels:  oauth2
Oauth2 Client
Easy integration with OAuth 2.0 service providers.
Stars: ✭ 3,182 (+849.85%)
Mutual labels:  oauth2
Caddy Auth Portal
Authentication Plugin for Caddy v2 implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication
Stars: ✭ 291 (-13.13%)
Mutual labels:  oauth2
Grant
OAuth Proxy
Stars: ✭ 3,509 (+947.46%)
Mutual labels:  oauth2
Firefly
Firefly is an asynchronous web framework for rapid development of high-performance web application.
Stars: ✭ 277 (-17.31%)
Mutual labels:  oauth2
Spring Boot Demo
spring boot demo 是一个Spring Boot、Spring Cloud的项目示例,根据市场主流的后端技术,共集成了30+个demo,未来将持续更新。该项目包含helloworld(快速入门)、web(ssh项目快速搭建)、aop(切面编程)、data-redis(redis缓存)、quartz(集群任务实现)、shiro(权限管理)、oauth2(四种认证模式)、shign(接口参数防篡改重放)、encoder(用户密码设计)、actuator(服务监控)、cloud-config(配置中心)、cloud-gateway(服务网关)等模块
Stars: ✭ 323 (-3.58%)
Mutual labels:  oauth2
Oxauth
OAuth 2.0 server and client; OpenID Connect Provider (OP) & UMA Authorization Server (AS)
Stars: ✭ 308 (-8.06%)
Mutual labels:  oauth2
Api
HeadHunter API: документация и библиотеки
Stars: ✭ 324 (-3.28%)
Mutual labels:  oauth2
Tkey
以材料最全、示例最多为目标的单点登录系统(SSO)
Stars: ✭ 295 (-11.94%)
Mutual labels:  oauth2
Jpproject.identityserver4.sso
🔒 ASP.NET Core 3.1 Open Source SSO. Built within IdentityServer4 🔑
Stars: ✭ 298 (-11.04%)
Mutual labels:  oauth2
Identitymodel.oidcclient
Certified C#/NetStandard OpenID Connect Client Library for native mobile/desktop Applications (RFC 8252)
Stars: ✭ 316 (-5.67%)
Mutual labels:  oauth2
Glewlwyd
Single Sign On server, OAuth2, Openid Connect, multiple factor authentication with, HOTP/TOTP, FIDO2, TLS Certificates, etc. extensible via plugins
Stars: ✭ 292 (-12.84%)
Mutual labels:  oauth2
Yurunoauthlogin
PHP 第三方登录授权 SDK,集成了QQ、微信、微博、Github等常用接口。支持 php-fpm 和 Swoole,所有框架通用。QQ群:17916227
Stars: ✭ 330 (-1.49%)
Mutual labels:  oauth2
Graphik
Graphik is a Backend as a Service implemented as an identity-aware document & graph database with support for gRPC and graphQL
Stars: ✭ 277 (-17.31%)
Mutual labels:  oauth2
Xboot
基于Spring Boot 2.x的一站式前后端分离快速开发平台XBoot 微信小程序+Uniapp 前端:Vue+iView Admin 后端:Spring Boot 2.x/Spring Security/JWT/JPA+Mybatis-Plus/Redis/Elasticsearch/Activiti 分布式限流/同步锁/验证码/SnowFlake雪花算法ID 动态权限 数据权限 工作流 代码生成 定时任务 社交账号 短信登录 单点登录 OAuth2开放平台 客服机器人 数据大屏 暗黑模式
Stars: ✭ 3,432 (+924.48%)
Mutual labels:  oauth2
Oauth
🔗 OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (+0.3%)
Mutual labels:  oauth2
Gmvault
gmail backup software
Stars: ✭ 3,396 (+913.73%)
Mutual labels:  oauth2
Django Oidc Provider
OpenID Connect and OAuth2 provider implementation for Djangonauts.
Stars: ✭ 320 (-4.48%)
Mutual labels:  oauth2

Apache Oltu OAuth2 Server + Client

使用Apache Oltu 搭建Oauth2 Server及Client开放授权

OAuth应用接入授权演示

纯代码方式接入OAuth演示

Oauth2 Server端执行流程

打包运行

mvn jetty:run
或
mvn tomcat7:run

1. 先注册应用

http://localhost:8080/zetark-oauth2-server/client

会生成client_id和client_secret这两个以后会用到

client_id               c1ebe466-1cdc-4bd3-ab69-77c3561b9dee    应用id
client_secret           d8346ea2-6017-43ed-ad68-19c0f971738b    应用secret

2. 请求授权码

http://localhost:8080/zetark-oauth2-server/authorize?client_id=c1ebe466-1cdc-4bd3-ab69-77c3561b9dee&response_type=code&redirect_uri=http://notes.coding.me

参数说明

client_id               应用id
response_type           返回授权码的标识
redirect_uri            回调地址

上面的网站会打开oauth server的用户登录页面。用户输入正确的用户名和密码以POST方式提交后会重定向到用户所填的回调地址并在地址后携带授权码.

请求成功后会返回如下的页面:

http://notes.coding.me/?code=63910432da9186b22b1ad888d55ae8ae

这里code=63910432da9186b22b1ad888d55ae8ae即授权码

3. 换取accessToken (POST操作)

首先GET方式请求 http://localhost:8080/zetark-oauth2-server/access 会打开一个表单在该表单中填入必填项,具体表单参数详见说明部分

表单将会以POST方式提交到 http://localhost:8080/zetark-oauth2-server/accessToken ,最终返回accessToken

需要以POST方式提交以下参数换取accessToken

client_id       c1ebe466-1cdc-4bd3-ab69-77c3561b9dee            应用id
client_secret   d8346ea2-6017-43ed-ad68-19c0f971738b            应用secret
grant_type      authorization_code                              用于传递授权码的参数名authorization_code
code            63910432da9186b22b1ad888d55ae8ae                用户登录授权后的授权码
redirect_uri    http://notes.coding.me                          回调地址

最终返回如下数据

{"expires_in":3600,"access_token":"223ae05dfbb0794396fb60a0960c197e"}

4. 使用accessToken测试开放数据服务

http://localhost:8080/zetark-oauth2-server/v1/openapi/userInfo?access_token=223ae05dfbb0794396fb60a0960c197e

测试ok的话返回用户名信息,access_token=223ae05dfbb0794396fb60a0960c197e为上一步获取的access_token

注:其中的参数名不要随意更改,固定写法。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].