Skip to content

Instantly share code, notes, and snippets.

View sourcecodematrix's full-sized avatar

Vinay Singh Rawat sourcecodematrix

View GitHub Profile
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.simple.JSONObject;
public class FCM {
@sourcecodematrix
sourcecodematrix / ConnectionUtility.java
Created August 19, 2017 12:03
springsocialIntDemo
package com.scm.socialutility;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
@sourcecodematrix
sourcecodematrix / index.jsp
Created August 19, 2017 11:17
springsocialIntDemo
<%@page import="com.scm.socialutility"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>FaceBook Login Sample</title>
</head>
<body>
@sourcecodematrix
sourcecodematrix / SocialAuthServlet.java
Created August 19, 2017 11:15
springsocialIntDemo
package com.scm.socialutility;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject;
package com.scm.socialutility;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import org.json.JSONObject;
package com.oauth.controller;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.oauth.service.User;
@sourcecodematrix
sourcecodematrix / User.java
Created August 18, 2017 22:37
oauthwithspring
package com.oauth.service;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "USER")
@XmlType(propOrder = { "email", "password", "firstName", "lastName", "mobile" })
package com.oauth.service;
import java.util.Base64;
import java.util.StringTokenizer;
/**
* @author www.sourcecodematrix.com
* @Description This class has logic to decode the encrypted header value which
* contain the user credentials.
*/
package com.oauth.filter;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
@sourcecodematrix
sourcecodematrix / Process.java
Created February 3, 2015 18:33
project: Hibernatemanytomany
package com.bean;
import java.util.HashSet;
import java.util.Set;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.exception.ConstraintViolationException;