oauth2

IMAP auth in Office 365 using OAuth2

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using an IMAP client in my program. I'm trying to access to Office 365 outlook by IMAP client using OAuth2 mechanism (using these instructions .) When I authenticate in IMAP client - authentication failes, but OAuth2 authentication of Google and Outlook.com works fine. Does Office 365 support OAuth2 authentication in IMAP? If it does, how to authenticate? 回答1: We don't support OAuth for IMAP access to Office 365 and we have no plans to do so as we recommend using our REST APIs to connect to Office 365 for your apps. OAuth is supported

Google OAuth2 returns “unsupported_grant_type” via cURL (PHP)

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to get data about google account. I use next code: $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://www.googleapis.com/oauth2/v4/token', CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Cache-Control: no-cache', 'Content-Type: application/x-www-form-urlencoded', ], CURLOPT_POSTFIELDS => [ 'code' => $code, 'client_id' => '{MY_CLIENT_ID}', 'client_secret' => '{MY_CLIENT_SECRET}', 'redirect_uri' => '{SOME_URL}' 'grant_type' => 'authorization_code'

JWE in Spring Security OAuth2 JWT

匿名 (未验证) 提交于 2019-12-03 00:58:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to use JSON Web Encryption(JWE) with Spring Security OAuth2 JWT ? Right now I have a following JwtAccessTokenConverter : @Bean public JwtAccessTokenConverter accessTokenConverter() { JwtAccessTokenConverter converter = new JwtAccessTokenConverter() { @Override public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) { DBUserDetails user = (DBUserDetails) authentication.getUserAuthentication().getPrincipal(); final Map<String, Object> additionalInfo = new HashMap<>(); additionalInfo

Accountmanager Auth token whithout clientID and clientSecret

匿名 (未验证) 提交于 2019-12-03 00:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hello I'm retrieving a auth token on my app with that code : private String updateToken(boolean invalidateToken, int accountref) { String authToken = "null"; try { AccountManager am = AccountManager.get(TestAuthActivity.this); Account[] accounts = am.getAccountsByType("com.google"); AccountManagerFuture<Bundle> accountManagerFuture; if(TestAuthActivity.this == null){//this is used when calling from an interval thread accountManagerFuture = am.getAuthToken(accounts[accountref], SCOPE_CONTACTS_API, false, null, null); } else {

Program type already present: org.apache.http.auth.AuthSchemeFactory

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I used Picasso as dependency for both the my App project and the chat library Here is the error I'm facing while compiling the code: Program type already present: org.apache.http.auth.AuthSchemeFactory Message{kind=ERROR, text=Program type already present: org.apache.http.auth.AuthSchemeFactory, sources=[Unknown source file], tool name=Optional.of(D8)} so how to use same dependency for two project? ---- Root project---- | | ---app | ---chat library EDIT Saturday - 2018 14 April in app>libs folder the following jar files exist: httpclient-4.3

Spring Security OAuth2 token存储Redis用户登出logOut

匿名 (未验证) 提交于 2019-12-03 00:44:02
Redis用户登出有两种方案,一种是通过资源服务器配置logoutSuccessHandler处理函数,并实现LogoutSuccessHandler接口来处理退出用户; 另外一种是自定义封装接口,通过RedisTokenStore来删除用户信息的形式; 1.通过资源服务器配置的方式 ResourceServerConfigurerAdapter配置 @Override public void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/auth_user/*").denyAll() .antMatchers("/oauth2/**","/oauth/**").permitAll() .anyRequest().authenticated() .and() .logout() // .logoutSuccessHandler(logoutSuccessHandler) .and() .csrf().disable(); } 退出成功处理LogoutSuccessHandler类 package com.yaomy.security.oauth2.handler; import com.yaomy.common.enums.HttpStatusMsg;

轻松搭建CAS 5.x系列(6)-在CAS Server上增加OAuth2.0协议

匿名 (未验证) 提交于 2019-12-03 00:43:02
概述说明 CAS Server默认搭建出来,客户端程序只能按照CAS自身的协议接入。CAS的强大在于,有官方的插件,可以支持其他的协议。本章节就让CAS Server怎么增加OAuth2.0的登录协议。 安装步骤 `1. 首先,您需要有个CAS Server端 如果您没有,可以按照我之前写的文章《 轻松搭建CAS 5.x系列文章 》系列的前3篇文章搭建好CAS Server。 ・2. 在pom.xml增加依赖包 1 <!-- OAuth/OpenID Authentication Begin --> 2 < dependency > 3 < groupId > org.apereo.cas </ groupId > 4 < artifactId > cas-server-support-oauth-webflow </ artifactId > 5 < version > ${cas.version} </ version > 6 </ dependency > 7 <!-- OAuth/OpenID Authentication End --> ・3. application.properties增加配置文件 (该文件路径:D:\casoverlay\cas-overlay-template\src\main\resources) 1 cas.authn.oauth

SSO单点登录之OAuth2.0登录认证(1)

匿名 (未验证) 提交于 2019-12-03 00:37:01
之前写了很多关于spring cloud的文章,今天我们对OAuth2.0的整合方式做一下笔记,首先我从网上找了一些关于OAuth2.0的一些基础知识点,帮助大家回顾一下知识点: 一、oauth中的角色 client:调用资源服务器API的应用 Oauth 2.0 Provider:包括Authorization Server和Resource Server (1)Authorization Server:认证服务器,进行认证和授权 (2)Resource Server:资源服务器,保护受保护的资源 user:资源的拥有者 二、下面详细介绍一下Oauth 2.0 Provider Authorization Server: (1)AuthorizationEndpoint:进行授权的服务,Default URL: /oauth/authorize (2)TokenEndpoint:获取token的服务,Default URL: /oauth/token Resource Server: OAuth2AuthenticationProcessingFilter:给带有访问令牌的请求加载认证 三、下面再来详细介绍一下Authorization Server: 2、@Beans:需要实现AuthorizationServerConfigurer

Spring Boot+Spring Security+Spring Social项目开发(七):使用JWT替换默认Token、JWT实现SSO单点登录

匿名 (未验证) 提交于 2019-12-03 00:22:01
基本的Token参数配置(代码中的解释很详细) 配置认证服务器TiHomAuthorizationServerConfig core中创建类OAuth2Properties和OAuth2ClientProperties,OAuth2Properties用来管理OAuth2ClientProperties对象,也就是多个第三方应用的client管理;OAuth2ClientProperties是对单个client属性的配置 把OAuth2Properties添加到SecurityProperties中 去application.properties中配置 tihom.security.oauth2.clients[0].clientId=tihom tihom.security.oauth2.clients[0].clientSecret=tihomsecret tihom.security.oauth2.clients[0].accessTokenValiditySeconds=3600 tihom.security.oauth2.clients[1].clientId=test tihom.security.oauth2.clients[1].clientSecret=test #tihom.security.oauth2.clients[1]

OAuth2.0规范简介

匿名 (未验证) 提交于 2019-12-03 00:18:01
花了点时间学习了一下OAuth2.0规范,整理一下备忘~~~~ 一个简单的例子来说明oauth是什么: 现在很多网站在登录时可以选择使用第三方账号登陆,比如这样: 你可以选择一个现有的账号来登了,比如GitHub。然后就会跳转到GitHub的登陆界面,要求你输入账号密码登陆GitHub,像这样: 当你登陆GitHub之后,会提示你:之前的网站需要访问你的信息,需要为之授权,像这样: 一旦你同意授权之后,就可以自动跳转到博客,并且使用GitHub账号登陆博客。 这是一个典型的OAuth认证授权过程,在这个过程中,涉及到以下角色: 资源所有者:GitHub账号所有者,也就是我 第三方应用:CSDN博客服务 授权服务器:GitHub服务 资源服务器:GitHub服务,这里的授权服务器和资源服务器是同一个,但这并不是必须的 代理客户端:浏览器 整个认证授权过程中,你并没有向CSDN提供你的GitHub密码,而是在GitHub上为CSDN授予访问你在GitHub上的资源(Account、Public data)的访问权限。你可以在所有支持GitHub账号登陆的网站上使用GitHub授权登陆,而这些第三方网站也可以根据你的授权范围访问你在GitHub上的资源。如果某天你不希望这些第三方网站中的一些继续访问你在GitHub上的资源,你可以移除对应的授权,同时不会对其他第三方网站产生影响: