Example usage for org.springframework.security.oauth.provider.token OAuthProviderTokenImpl setCallbackUrl

List of usage examples for org.springframework.security.oauth.provider.token OAuthProviderTokenImpl setCallbackUrl

Introduction

In this page you can find the example usage for org.springframework.security.oauth.provider.token OAuthProviderTokenImpl setCallbackUrl.

Prototype

public void setCallbackUrl(String callbackUrl) 

Source Link

Document

The callback url associated with this token.

Usage

From source file:nl.surfnet.coin.api.oauth.OpenConextOauth1TokenServicesTest.java

private OAuthProviderTokenImpl buildToken() {
    final OAuthProviderTokenImpl token = new OAuthProviderTokenImpl();
    token.setValue("value");
    token.setVerifier("verifier");
    token.setSecret("ssh");
    token.setCallbackUrl("callbackurl");
    token.setConsumerKey("consumerkey");
    SAMLAuthenticationToken userAuthentication = new SAMLAuthenticationToken("", Collections.EMPTY_LIST);
    userAuthentication.setClientMetaData(new JanusClientMetadata());
    token.setUserAuthentication(userAuthentication);
    return token;
}

From source file:org.springframework.security.oauth.provider.token.RandomValueProviderTokenServices.java

public OAuthProviderToken createUnauthorizedRequestToken(String consumerKey, String callbackUrl)
        throws AuthenticationException {
    String tokenValue = UUID.randomUUID().toString();
    byte[] secretBytes = new byte[getTokenSecretLengthBytes()];
    getRandom().nextBytes(secretBytes);/* w  w w  .  j  av  a 2s.  co m*/
    String secret = new String(Base64.encodeBase64(secretBytes));
    OAuthProviderTokenImpl token = new OAuthProviderTokenImpl();
    token.setAccessToken(false);
    token.setConsumerKey(consumerKey);
    token.setCallbackUrl(callbackUrl);
    token.setUserAuthentication(null);
    token.setSecret(secret);
    token.setValue(tokenValue);
    token.setTimestamp(System.currentTimeMillis());
    onTokenCreated(token);
    storeToken(tokenValue, token);
    return token;
}