Examples of MD5Generator


Examples of org.apache.amber.oauth2.as.issuer.MD5Generator

    @Produces("application/json")
    public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException {

        OAuthTokenRequest oauthRequest = null;

        OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());

        try {
            oauthRequest = new OAuthTokenRequest(request);
           
            //check if clientid is valid
View Full Code Here

Examples of org.apache.amber.oauth2.as.issuer.MD5Generator

    @GET
    @Consumes("application/x-www-form-urlencoded")
    @Produces("application/json")
    public Response authorizeGet(@Context HttpServletRequest request) throws OAuthSystemException {
        OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());

        OAuthResponse response = OAuthASResponse
            .tokenResponse(HttpServletResponse.SC_OK)
            .setAccessToken(oauthIssuerImpl.accessToken())
            .setExpiresIn("3600")
View Full Code Here

Examples of org.apache.amber.oauth2.as.issuer.MD5Generator

    public Response authorize(@Context HttpServletRequest request)
        throws URISyntaxException, OAuthSystemException {

        OAuthAuthzRequest oauthRequest = null;

        OAuthIssuerImpl oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());

        try {
            oauthRequest = new OAuthAuthzRequest(request);

            //build response according to response_type
View Full Code Here

Examples of org.apache.amber.oauth2.as.issuer.MD5Generator

*
*/
public class MD5GeneratorTest extends Assert {
    @Test
    public void testGenerateValue() throws Exception {
        ValueGenerator g = new MD5Generator();
        Assert.assertNotNull(g.generateValue());

        Assert.assertNotNull(g.generateValue("test"));

        try {
            g.generateValue(null);
            fail("Exception not thrown");
        } catch (OAuthSystemException e) {
            //ok
        }
    }
View Full Code Here

Examples of org.apache.oltu.oauth2.as.issuer.MD5Generator

            //生成授权码
            String authorizationCode = null;
            //responseType目前仅支持CODE,另外还有TOKEN
            String responseType = oauthRequest.getParam(OAuth.OAUTH_RESPONSE_TYPE);
            if (responseType.equals(ResponseType.CODE.toString())) {
                OAuthIssuerImpl oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());
                authorizationCode = oauthIssuerImpl.authorizationCode();
                oAuthService.addAuthCode(authorizationCode, username);
            }

            //进行OAuth响应构建
View Full Code Here

Examples of org.apache.oltu.oauth2.as.issuer.MD5Generator

                    return new ResponseEntity(response.getBody(), HttpStatus.valueOf(response.getResponseStatus()));
                }
            }

            //生成Access Token
            OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());
            final String accessToken = oauthIssuerImpl.accessToken();
            oAuthService.addAccessToken(accessToken, oAuthService.getUsernameByAuthCode(authCode));


            //生成OAuth响应
View Full Code Here

Examples of org.apache.oltu.oauth2.as.issuer.MD5Generator

    @Produces("application/json")
    public Response token(@Context HttpServletRequest request) throws OAuthSystemException {

        OAuthUnauthenticatedTokenRequest oauthRequest = null;

        OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());

        try {
            oauthRequest = new OAuthUnauthenticatedTokenRequest(request);

            // check if clientid is valid
View Full Code Here

Examples of org.apache.oltu.oauth2.as.issuer.MD5Generator

    @Produces("application/json")
    public Response authorize(@Context HttpServletRequest request) throws OAuthSystemException {

        OAuthTokenRequest oauthRequest = null;

        OAuthIssuer oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());

        try {
            oauthRequest = new OAuthTokenRequest(request);

            // check if clientid is valid
View Full Code Here

Examples of org.apache.oltu.oauth2.as.issuer.MD5Generator

    public Response authorize(@Context HttpServletRequest request)
        throws URISyntaxException, OAuthSystemException {

        OAuthAuthzRequest oauthRequest = null;

        OAuthIssuerImpl oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator());

        try {
            oauthRequest = new OAuthAuthzRequest(request);

            //build response according to response_type
View Full Code Here

Examples of org.apache.oltu.oauth2.as.issuer.MD5Generator

*
*/
public class MD5GeneratorTest extends Assert {
    @Test
    public void testGenerateValue() throws Exception {
        ValueGenerator g = new MD5Generator();
        Assert.assertNotNull(g.generateValue());

        Assert.assertNotNull(g.generateValue("test"));

        try {
            g.generateValue(null);
            fail("Exception not thrown");
        } catch (OAuthSystemException e) {
            //ok
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.