Tuesday, March 8, 2016

Auth Provider mechanisms

http://www.mythics.com/about/blog/what-to-consider-when-integrating-authentication

some basic terminology around authentication:
1. Identity – Describes who you are.
2. Credential – Something that proves who you are.
3. Identity Provider – A trusted system that collects your credentials and provides your validated identity to a service.
4. Service Provider – Some kind of service provided to the user that requires knowledge of the user's identity.
5. Trust – How does a service provider establish the integrity of an identity provider?


Protocol Identity Credential Identity Provider Service Provider Trust
SAML2 XML "Assertion" Multiple SAML2 Identity Provider
SAML2 Service Provider
Established by digitally signing assertions of identity with pre-shared keys or pre-trusted certificate authorities
OAuth JSON "Token" Multiple but current standards for specifying OAuth endpoint OAuth endpoint OAuth verified identity providers using pre-shared "tokens" that are hard to guess, but not cryptographically verified
SSL Certificate Authentication Digitally signed certificate Digitally signed certificate Certificate authority Web server running SSL Established through the trust of certificate authorities
BrowserID Email address Certificate BrowserID provider Any web application Trust is established when a user is granted a certificate for authentication from their email provider

Thursday, March 3, 2016

Most wanted string programs

Program to count highest occurrence character in a string .

Program to print  all permutations of a string characters  like  
123
213
312
321
231
132

Program to find anagrams 
Program to find first non repetitive character in a string
Program to reverse a string .
Program to remove occurrence of a character from a string  ( recursive )
Program to find longest palindrome in a string .

Saturday, October 17, 2015

Interview Question

difference between abstract and interface
How to save transient data
why externalisation when serializable exists
Internal implementation of hash map and hashset
Normalisation why it is required
explain 1st 2nd 3rd normal form
How to get thread result back - through callable interface
are serialised and deserialised object are the same object instances ?
Read about serialisation in one file and in multiple files and see the heap space .
Answer is No if heap spaces are different.
How to validate JSON
What is difference between merge and inverse
Object state in hibernate
would there be several instances of singleton class in different JVM
// yes different JVM have different class loader hence different objects would get instantiated.
--------------------------------------------------------
when to use second level cache in Hibernate 
Why criteria API are used ? - For dynamic invocation of query parameters. 
What are projections ? aggregate funcations
What are restrictions? where conditions 
QBE ? by passing dummy object in criteria
One To Many // give an example
Many To one // give an example
Hibernate Validator pattern 

------------------------
ThreadLocal usage


http://examples.javacodegeeks.com/enterprise-java/rest/jersey/jax-rs-queryparam-example/



Saturday, September 26, 2015

SOAP over JMS

SOAP webservices can be accessed through HTTP  as well as JMS .
SOAP over JMS  gives message delivery guarantee and is  preferred where  message critical application  are deployed.


JMS provide two types of message communication


1) point to point
    (A) once message is received it is removed from Q
    (B) only one receiver can receive the message
2) publish / subscribe
    (A) message stays on topic even after one receiver reads it
    (B) multiple receivers can subscribe to same topic 




JMS webservices can be  developed  with two approaches


1) 1 way request
- web client will get unblock once  the request is  gone to destination  (Q/Topic)
- Q/Topic both can implement it
2) request - response
- web client will get unblock only after response gets back to the client
-Only Q can implement this type of web service



Friday, June 19, 2015

Clean previous installation of windows files and folders

Start -> Accessories -> System -> Disk Clean up -> clean up previous installtions -> ok. 

Tuesday, June 9, 2015

How to install unrar and rar facilities in mac

1) Download unrar  utility from RARLab
2) extract it through tar -xvf 
3) go inside extracted rar folder 
4) sudo install -c -o $USER rar /usr/local/bin
5) sudo install -c -o $USER unrar /usr/local/bin
6) hit enter and it will ask you for password .
7) u can use unrar and rar utilities in mac.

Thursday, June 4, 2015

How to Load SSL certificate in trustStore

Here is the code >>


static public void doTrustToCertificates(String certPath, String keyPath) throws Exception {

   try{


         char[] password = "changeit".toCharArray();

         String alias = "isskey";


         KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());

         keystore.load(null, password);


         CertificateFactory cf = CertificateFactory.getInstance("X.509");

          InputStream certstream = fullStream (certPath);

          Certificate certs = cf.generateCertificate(certstream);

          File keystoreFile = new File(keyPath);

           // Add the certificate

          keystore.setCertificateEntry(alias, certs);

          // Save the new keystore contents

           FileOutputStream out = new FileOutputStream(keystoreFile);

           keystore.store(out, password);

           out.close();



}catch(Exception ex)

{
          ex.printStackTrace();

}


}



private static InputStream fullStream ( String fname ) throws IOException {

                  FileInputStream fis = new FileInputStream(fname);

                  DataInputStream dis = new DataInputStream(fis);

                  byte[] bytes = new byte[dis.available()];

                  dis.readFully(bytes);

                  ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

                  return bais;

}

}