@Test public void temporaryAuthToken() throws Exception { SessionManager mockManager = mock(SessionManager.class); when(mockManager.storeNewTempToken()).thenReturn("dummyToken"); AuthResource resource = new AuthResource(mockManager, null, "localhost"); TempTokenResponse response = resource.temporaryAuthToken("doc"); assertNotNull(response.token); assertEquals("xanauth: }
public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenResponse tempTokenResponse = new TempTokenResponse(); tempTokenResponse.xanauth = xanauthURL; tempTokenResponse.token = tempToken; return tempTokenResponse; }
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenResponse tempTokenResponse = new TempTokenResponse(); tempTokenResponse.xanauth = xanauthURL; tempTokenResponse.token = tempToken; return tempTokenResponse; } }
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenResponse tempTokenResponse = new TempTokenResponse(); tempTokenResponse.xanauth = xanauthURL; tempTokenResponse.token = tempToken; return tempTokenResponse; } AuthResource(SessionManager sessionManager, ObjectMapper mapper, String host); }
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenResponse tempTokenResponse = new TempTokenResponse(); tempTokenResponse.xanauth = xanauthURL; tempTokenResponse.token = tempToken; return tempTokenResponse; } AuthResource(SessionManager sessionManager, ObjectMapper mapper, String host); SessionResponse getSessionToken(String header64, String claim64, String sig64); TempTokenResponse temporaryAuthToken(String scope); }
AuthResource { public TempTokenResponse temporaryAuthToken(String scope) throws StorageException, UnsupportedEncodingException { if (Strings.isNullOrEmpty(scope)) { scope = "all"; } String tempToken = sessionManager.storeNewTempToken(); String xanauthURL = "xanauth: + URLEncoder.encode(scope, "UTF-8"); TempTokenResponse tempTokenResponse = new TempTokenResponse(); tempTokenResponse.xanauth = xanauthURL; tempTokenResponse.token = tempToken; return tempTokenResponse; } AuthResource(SessionManager sessionManager, ObjectMapper mapper, String host); SessionResponse getSessionToken(String header64, String claim64, String sig64); TempTokenResponse temporaryAuthToken(String scope);  }