The specific cause of this problem is generally the following two points:
1. In the authorized section we generally authorize by using our own login action HTTP BASIC, while we use spring security only exposed the login interface, which means that the other interfaces are in spring Security protection, including the/oauth interface.
2. Use/oauth/authorize?grant_t
OAuth IntroductionOAuth was co-sponsored by Blaine Cook, Chris Messina, Larry Halff and David Recordon to provide a safe and open standard for API access authorization.Based on OAuth authentication authorization has the following characteristics:Safety. OAuth differs from other licensing methods:
The oauth project has written several public interfaces:Ioauthconfig: this interface is used to obtain the configuration information of Web. config.
Namespace oauth {public interface ioauthconfig {//
Ioauthmode: The parameter interface for oauth authentication. There are many interfaces here.
Namespace
programs in the form of middleware, and the framework itself encapsulates the general form of the authentication process (Basic Digest/oauth/open ID), callbacks, and error handling. and the specific certification implementation is abstracted as strategy (strategy), and the framework itself is not related, as long as the passport-compliant strategy can be added as a plug-in form of the project is used by P
System.ServiceModel.Activation;using System.ServiceModel.Web;using Microsoft.ServiceModel.Web;using DevDefined.OAuth.Provider;using OAuthChannel.Repositories;namespace OAuthChannel{ public class OAuthWebServiceHostFactory : WebServiceHostFactory { public IOAuthProvider OAuthProvider { get; set; } public ITokenRepositoryThe Interceptor (oauthinterceptor. CS) converts the requested oauth (in the request header) to oauthchannel. Mode
Reference:
* 2 legged oauth basic concepts (Chinese) http://djb4ke.iteye.com/blog/664958
* Google 2 legged oauth for Google Apps domain: http://code.google.com/intl/zh-TW/apis/accounts/docs/OAuth.html#GoogleAppsOAuth
* Example of Google 2 legged
/1.1Host:server.example.comContentapplication/x-www-form-urlencoded grant_type=Refresh_tokenrefresh_token=tgzv3jokf0xg5qx2tlkwiaVerify Access TokenAccess tokens are finally sent to resource server, so resource server validates access tokens. And the specific verification method depends on the type of token.1. If token is a string that does not contain specific information. Resource server can only give this token to authorization server to parse the user information.
In the previous article, the oauth authentication process obtains the oauth_verifier code by calling the browser in the Android system for user authorization authentication. For details, see: android development my Sina Weibo client-user authorization page function (3.2 ).
The original implementation is as follows:
1. First in androidmanifest. add the following c
certificate information to obtain 'Access _ token '. Callback information will be used after user authorization, as shown in the following figure. Site.com/oauth/callback? Code = AQCOtAVov1Cu316rpqPfs-8nDb-jJEiF7aex9n05e2dq3oiXlDwubVoC8VEGNq10rSkyyFb3wKbtZh6xpgG59FsAMMSjIAr613Ly1usZ47jPqADzbDyVuotFaRiQux3g6Ut84nmAf9j-KEvsX0bEPH_aCekLNJ1QAnjpls0SL9ZSK-yw1wPQWQsBhbfMPNJ_LqI2. I would like to remind you that OAuth
sentence is to add access-control-allow-origin support.13. Add the ASP . WebApi install-package Microsoft. Owin. Cors. Add App.usecors (Corsoptions.allowall) to the Startup.cs configuration method;14, generate the client token.15. After receiving token, access the data interface. Note The parameter authorization value has a prefix of bearer.SummarizeIn general, the design of Owin and identity is a bit complicated, the agreement of something more. Compared to Microsoft's early membership is a lo
In fact, before you do the service number of the binding login is also an OAuth authentication authorizationA simple look at the process by which a third party authenticates with OAuth: (taken from the network, with the diagram everyone should like ~)The first step: users log on to third-party websites, such as using QQ login.Second step: After clicking Login, wi
Self-developed and implemented OAuth for webapi authentication and oauthwebapi
When I see the OAuth written by someone in the garden, I want to share my own OAuth. I will not go into details about the OAuth protocol here.
1. As an authen
1. What is oauth?
A Security Authentication Protocol
Provides a secure, open, and simple standard for user resource authorization.
Does not allow third parties to Touch User Account Information
Http://www.oauth.net
2. Role in oauth
Serviceprovider is usually a website (for example:Online storage, Weibo, or blogCustomer
In the previous article, "Using OAuth to build WEBAPI authentication services for your own clients", we implemented a WEBAPI server with OAuth process 3-cipher mode (resource owner password credentials). Today we are going to implement a js+html version of the client.First, angular clientAngular version of client code from HTTP://BITOFTECH.NET/2014/06/01/ token-b
Tags: oauth token images BSP user HTTP users using server1, for mobile users to apply for Access_token Access_token is present and valid, the 4+1 method is applied again. Access_token are the same, the validity period is unchanged! If mobile users want to use "Authorization code mode", they need to modify the authorization mode of database Mobile_client support! If you use mobile user and Authorization code mode, you need to modify manually: Apply fo
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.