Hi,
Yes, we are using a merged solution, and we have a web config in the root.
The hosted application will always be ignoring the child app name.
if we are manually entering the child app name then a login window occurred. and after entering in the application after user id and password.
then also ignore child app name
public DpsecureFileUploadOutput DPUploadTempFolder(FileDto input)
{
try
{
var DpUploadFile = Request.Form.Files.First();
//Check input
if (DpUploadFile == null)
{
throw new UserFriendlyException("File Not Found...");
}
var ext = Path.GetExtension(DpUploadFile.FileName);
if (ext == ".exe")
{
throw new Exception("Invalid File");
}
BinaryReader b = new BinaryReader(DpUploadFile.OpenReadStream());
byte[] fileBytes = b.ReadBytes((int)DpUploadFile.Length);
if (fileBytes.Length <= 0)
{
throw new UserFriendlyException("File Should not be Empty !!!.");
}
else
{
byte[] data = fileBytes;
int length = 2;
int index = 0;
byte[] result = new byte[length];
Array.Copy(data, index, result, 0, length);
if (((Encoding.UTF8.GetString(result) == "MZ") || (Encoding.UTF8.GetString(result) == "ZM")))
{
throw new UserFriendlyException("File Should not be in .exe format !!!.");
}
}
var fileInfo = new FileInfo(DpUploadFile.FileName);
var tempFileName = DpUploadFile.FileName.Trim();
var tempFilePath = Path.Combine(_appFolders.TempFileDownloadFolder, tempFileName);
System.IO.File.WriteAllBytes(tempFilePath, fileBytes);
return new DpsecureFileUploadOutput
{
FileToken = input.FileToken,
FileName = input.FileName,
FileType = input.FileType,
};
}
catch (UserFriendlyException ex)
{
return new DpsecureFileUploadOutput(new ErrorInfo(ex.Message));
}
}
```
ClientSide Code
initFileUploader(): void {
this.uploader = new FileUploader({ url: AppConsts.remoteServiceBaseUrl + '/Profile/DPUploadTempFolder' });
this._uploaderOptions.autoUpload = false;
this._uploaderOptions.authToken = 'Bearer ' + this._tokenService.getToken();
this._uploaderOptions.removeAfterUpload = true;
this.uploader.onAfterAddingFile = (file) => {
file.withCredentials = false;
this.fileReadingProgress = true;
};
this.uploader.onBuildItemForm = (fileItem: FileItem, form: any) => {
form.append('FileType', fileItem.file.type);
form.append('FileName', fileItem.file.name);
form.append('FileToken', this.guid());
};
this.uploader.onProgressItem = (progress: any) => {
//console.log(progress['progress']);
this.progress = progress['progress'];
};
this.uploader.onSuccessItem = (item, response, status) => {
const resp = <IAjaxResponse>JSON.parse(response);
if (resp.success) {
this.fileReadingProgress = false;
this.btnSave = true;
this.isinTokenHolder = resp.result;
} else {
this.message.error(resp.error.message);
}
};
this.uploader.setOptions(this._uploaderOptions);
}
"You can return the object type to dynamically return dto such as: Task<object> GetPeople();"
But Client Side return null. (Angular TypeScript page)
after implementation of this service, and authenticate the valid user at that time we got null userid.. (tokenauth/authente)
how can we solve this
Hi,
We have implemented this service in our project.
Output result is
Methode name : Authenticate Tenant Id : 1 userID : null
@murat.yuceer
share via GDRIVE on 02DEC2019
Hi,
We have diagnosed and resolved this issue.
The actual problem is that the default behavior of Unitofwork is Readuncommited.
This isolation level is not supported by Oracle (Devart Drivers)* .
Instead of UOW.IsTransactional = false we have changed the isolation level of UOW to ReadCommitted.
This is supported by oracle and working as expected.
Thanks
Hi,
How to secure token for single machine.
is there any way to remove token cookie from browser and pass token via api.
(abp framework creates abptoken cookies if not present)
if we want to pass token via api then what we need to modify in angular and abp framework,
Anyone have any idea for this issue, Please helps us in this.
Thanks
HI,
is there any way to set HTTP-Only attribute to cookies in Angular.
Thanks