Examples of BoxOAuthRequestObject


Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

    private static final String CLIENT_SECRET = "testClientSecret324324";

    @Test
    public void testRevokeRequestObject() throws BoxRestException {
        String token = "testtoken1212";
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.revokeOAuthRequestObject(token, CLIENT_ID, CLIENT_SECRET);

        Assert.assertEquals(CLIENT_ID, obj.getFromEntity("client_id"));
        Assert.assertEquals(CLIENT_SECRET, obj.getFromEntity("client_secret"));
        Assert.assertEquals(token, obj.getFromEntity("token"));
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

    @Test
    public void testCreateRequestObject() throws BoxRestException {
        String code = "testcode";
        String url = "testurl";
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.createOAuthRequestObject(code, CLIENT_ID, CLIENT_SECRET, url);

        Assert.assertEquals(CLIENT_ID, obj.getFromEntity("client_id"));
        Assert.assertEquals(CLIENT_SECRET, obj.getFromEntity("client_secret"));
        Assert.assertEquals(code, obj.getFromEntity("code"));
        Assert.assertEquals(url, obj.getFromEntity("redirect_url"));
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

    }

    @Test
    public void testRefreshRequestObject() throws BoxRestException {
        String token = "testrefreshtoken";
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.refreshOAuthRequestObject(token, CLIENT_ID, CLIENT_SECRET);

        Assert.assertEquals(CLIENT_ID, obj.getFromEntity("client_id"));
        Assert.assertEquals(CLIENT_SECRET, obj.getFromEntity("client_secret"));
        Assert.assertEquals(token, obj.getFromEntity("refresh_token"));
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

    @Test
    public void testDeviceNameId() {
        String deviceId = "deviceidtest";
        String deviceName = "devicenametest";
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.createOAuthRequestObject("", "", "", "").setDevice(deviceId, deviceName);

        Assert.assertEquals(deviceId, obj.getFromEntity(DEVICE_ID));
        Assert.assertEquals(deviceName, obj.getFromEntity(DEVICE_NAME));

        BoxOAuthRequestObject obj2 = BoxOAuthRequestObject.refreshOAuthRequestObject("", "", "").setDevice(deviceId, deviceName);

        Assert.assertEquals(deviceId, obj2.getFromEntity(DEVICE_ID));
        Assert.assertEquals(deviceName, obj2.getFromEntity(DEVICE_NAME));
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

     *            null if don't want to supply this field.
     */
    @Override
    public BoxOAuthToken createOAuth(final String code, final String clientId, final String clientSecret, final String redirectUrl) throws BoxRestException,
        BoxServerException, AuthFatalFailureException {
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.createOAuthRequestObject(code, clientId, clientSecret, redirectUrl);
        return createOAuth(obj);
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

     *            device name
     */
    @Override
    public BoxOAuthToken createOAuth(final String code, final String clientId, final String clientSecret, final String redirectUrl, final String deviceId,
        final String deviceName) throws BoxRestException, BoxServerException, AuthFatalFailureException {
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.createOAuthRequestObject(code, clientId, clientSecret, redirectUrl).setDevice(deviceId, deviceName);
        return createOAuth(obj);
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

    }

    @Override
    public BoxOAuthToken refreshOAuth(String refreshToken, String clientId, String clientSecret, String deviceId, String deviceName) throws BoxRestException,
        BoxServerException, AuthFatalFailureException {
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.refreshOAuthRequestObject(refreshToken, clientId, clientSecret).setDevice(deviceId, deviceName);
        return refreshOAuth(obj);
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

    }

    @Override
    public BoxOAuthToken refreshOAuth(String refreshToken, String clientId, String clientSecret) throws BoxRestException, BoxServerException,
        AuthFatalFailureException {
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.refreshOAuthRequestObject(refreshToken, clientId, clientSecret);
        return refreshOAuth(obj);
    }
View Full Code Here

Examples of com.box.restclientv2.requestsbase.BoxOAuthRequestObject

        return refreshOAuth(obj);
    }

    @Override
    public void revokeOAuth(String accessToken, String clientId, String clientSecret) throws BoxServerException, BoxRestException, AuthFatalFailureException {
        BoxOAuthRequestObject obj = BoxOAuthRequestObject.revokeOAuthRequestObject(accessToken, clientId, clientSecret);
        revokeOAuth(obj);
    }
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.