Amazon S3 direct file upload from client browser – private key disclosure

I think what you want is Browser-Based Uploads Using POST. Basically, you do need server-side code, but all it does is generate signed policies. Once the client-side code has the signed policy, it can upload using POST directly to S3 without the data going through your server. Here’s the official doc links: Diagram: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingHTTPPOST.html Example … Read more

MySQL root access from all hosts

Update: As mentioned in the comments, since MySql 8 you need to first explicitly create the user, so the command will look like: CREATE USER ‘root’@’%’ IDENTIFIED BY ‘password’; GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ WITH GRANT OPTION; Original answer: There’s two steps in that process: a) Grant privileges. As root user execute with … Read more

Adding ASP.NET MVC5 Identity Authentication to an existing project

Configuring Identity to your existing project is not hard thing. You must install some NuGet package and do some small configuration. First install these NuGet packages with Package Manager Console: PM> Install-Package Microsoft.AspNet.Identity.Owin PM> Install-Package Microsoft.AspNet.Identity.EntityFramework PM> Install-Package Microsoft.Owin.Host.SystemWeb Add a user class and with IdentityUser inheritance: public class AppUser : IdentityUser { //add your … Read more

Git Clone from GitHub over https with two-factor authentication

Find out how to fix this here: https://github.com/blog/1614-two-factor-authentication#how-does-it-work-for-command-line-git How does it work for command-line Git? If you are using SSH for Git authentication, rest easy: you don’t need to do anything. If you are using HTTPS Git, instead of entering your password, enter a personal access token. These can be created by going to your … Read more

What’s a redirect URI? how does it apply to iOS app for OAuth2.0?

Read this: http://www.quora.com/OAuth-2-0/How-does-OAuth-2-0-work or an even simpler but quick explanation: http://agileanswer.blogspot.se/2012/08/oauth-20-for-my-ninth-grader.html The redirect URI is the callback entry point of the app. Think about how OAuth for Facebook works – after end user accepts permissions, “something” has to be called by Facebook to get back to the app, and that “something” is the redirect URI. … Read more

Creating an API for mobile applications – Authentication and Authorization

The way I’m thinking about doing the login part of this in my projects is: before login the user requests a login_token from the server. These are generated and stored on the server on request, and probably have a limited lifetime. to login the application calculates the hash of the users password, then hashes the … Read more

How Spring Security Filter Chain works

The Spring security filter chain is a very complex and flexible engine. Key filters in the chain are (in the order) SecurityContextPersistenceFilter (restores Authentication from JSESSIONID) UsernamePasswordAuthenticationFilter (performs authentication) ExceptionTranslationFilter (catch security exceptions from FilterSecurityInterceptor) FilterSecurityInterceptor (may throw authentication and authorization exceptions) Looking at the current stable release 4.2.1 documentation, section 13.3 Filter Ordering you … Read more