Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Oauth2 client apps required to have SSL connection?

Which parties of Oauth 2.0 are required to have an SSL connection?

  • Auth server: SSL required
  • Resource server: SSL required
  • Client apps: Is it really necessary, as long as it uses SSL for the resource server communication?
like image 667
beku8 Avatar asked Sep 16 '14 04:09

beku8


People also ask

How do I request access to a connected app using OAuth?

For a connected app to request access, it must be integrated with your org’s REST API using the OAuth 2.0 protocol. OAuth 2.0 is an open protocol that authorizes secure data sharing between applications through the exchange of tokens.

How do I enable OAuth in Salesforce?

OAuth 2.0 is an open protocol that authorizes secure data sharing between applications through the exchange of tokens. For instructions to configure a connected app, see the Create a Connected App section in Salesforce Help. Specifically, follow the steps in Enable OAuth Settings for API Integration. Apply an OAuth Authorization Flow

What is an example of an OAuth application?

For example, an application can use OAuth 2.0 to obtain permission from users to store files in their Google Drives. Installed apps are distributed to individual devices, and it is assumed that these apps cannot keep secrets. They can access Google APIs while the user is present at the app or when the app is running in the background.

How do I set up an OAuth client?

Enter a name for the OAuth client. This name is displayed on your project's Credentials pageto identify the client. Enter your app's 12-character Microsoft Store ID. You can find this value in Microsoft Partner Centeron the App identitypage in the App management section.


1 Answers

The Authorization server is required to use SSL/TLS as per the specification, for example:

Since requests to the authorization endpoint result in user authentication and the transmission of clear-text credentials (in the HTTP response), the authorization server MUST require the use of TLS as described in Section 1.6 when sending requests to the authorization endpoint.

Since requests to the token endpoint result in the transmission of clear-text credentials (in the HTTP request and response), the authorization server MUST require the use of TLS as described in Section 1.6 when sending requests to the token endpoint.

That same specification does not require it for the client application, but heavily recommends it:

The redirection endpoint SHOULD require the use of TLS as described in Section 1.6 when the requested response type is "code" or "token", or when the redirection request will result in the transmission of sensitive credentials over an open network. This specification does not mandate the use of TLS because at the time of this writing, requiring clients to deploy TLS is a significant hurdle for many client developers. If TLS is not available, the authorization server SHOULD warn the resource owner about the insecure endpoint prior to redirection (e.g., display a message during the authorization request).

Lack of transport-layer security can have a severe impact on the security of the client and the protected resources it is authorized to access. The use of transport-layer security is particularly critical when the authorization process is used as a form of delegated end-user authentication by the client (e.g., third-party sign-in service).

Calls to the resource server contain the access token and require SSL/TLS:

Access token credentials (as well as any confidential access token attributes) MUST be kept confidential in transit and storage, and only shared among the authorization server, the resource servers the access token is valid for, and the client to whom the access token is issued. Access token credentials MUST only be transmitted using TLS as described in Section 1.6 with server authentication as defined by [RFC2818].

The reasons should be pretty obvious: In any of these does not use secure transport, the token can be intercepted and the solution is not secure.

You question specifically calls out the client application.

Client apps: Is it really necessary, as long as it uses SSL for the resource server communication?

I am assuming that you client is a web application, and you are talking about the communication between the browser and the server after authentication has happened. I am furthermore assuming that you ask the question, because (in your implementation), this communication is not authenticated with access tokens, but through some other means.

And there you have your answer: that communication is authenticated in some way or another. How else would the server know who is making the call? Most web sites use a session cookie they set at the beginning of the session, and use that to identify the session and therefor the user. Anyone who can grab that session cookie can hijack the session and impersonate the user. If you don't want that (and you really should not want that), you must use SSL/TLS to secure the communication between the browser and the server.

In some cases, the browser part of the client talks to the resource server directly; and the server part only serves static content, such as HTML, CSS, images and last but not least, JavaScript. Maybe your client is built like this, and you are wondering whether the static content must be downloaded over SSL/TLS? Well, if it isn't, a man in the middle can insert their own evil JavaScript, that steals you user's access tokens. You do want to secure the download of static content.

Last but not least, your question is based on a hidden assumption, that there might be valid reasons not to use SSL/TLS. Often people claim the cost of the certificate is too high, or the encryption requires too much CPU power, hence requiring more hardware to run the application. I do not believe these costs to be significant in virtually all cases. They are very low, compared to the total cost of building and running the solution. They are also very low compared to the risks of not using encryption. Don't spend time (and money) debating this, just use SSL/TLS all the way through.

like image 76
Kris Vandermotten Avatar answered Oct 23 '22 03:10

Kris Vandermotten