Saturday, April 23, 2016

How to create a client for 'X-Auth-Token' authentication over Spring Security implementation on a Rest Service?

I am building an application for practicing an architecture and its balance, I have to create a client for testing purpose, the rest service use tokens for authentication implementing Spring Security that employs: authentication-manager, security http, AuthenticationTokenProcessingFilter, intercept-url and tokens, so after some reading I have to resolve 'X-Auth-Token' inject on headers and authentication part, the following lines are for testing this king of Authentication:

By now we have a client for test authentication and authorization for next steps.

Best regards,

How to resolve CORS header after using Spring Security and Rest Service?


After testing an architecture of a security rest service built-in Spring Framework and a web application on AngularJS which over a POST gets credentials and regard information for the front end part, using firebug I discover and error after a submit on each event:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8081/keepnotes-soa-app/rest/user. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

Reviewing on Internet I discovered a missing configuration over my Front-end application which is the result of having a separated application, so on I have to create the following lines:
Having created the filter class we must to make the configuration over web.xml with the following lines:

Next to is review request and response where you were to find headers located on each message.

Best Regards,

Wednesday, April 6, 2016

How to solve 'ANDROID_SDK_ROOT is undefined'?

After a brief reading over Internet using Android Studio 1.5 default installation, I have named several issues, one of them is the use of API 23 or Android 6 because of demo version the components are not well suited, several of the problems are solved executing ./android in the folder ~/Android/sdk/tools ,install the recommend SDK's like API 18 or below...

Try avd monitor we have following errors like:

emulator: ERROR: This AVD's configuration is missing a kernel file!!
emulator: ERROR: ANDROID_SDK_ROOT is undefined

The solution is to soaring ./android again and install sources of each API installed.