Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API /RemoteControl/DeviceName doesn't authenticate request #47

Closed
Busbar2297 opened this issue Jul 13, 2019 · 1 comment
Closed

API /RemoteControl/DeviceName doesn't authenticate request #47

Busbar2297 opened this issue Jul 13, 2019 · 1 comment

Comments

@Busbar2297
Copy link

Well, It does authenticate the request, but internally if you track the request you will find that in

public async Task SendScreenCastRequestToDevice(string screenCasterID, string requesterName, int remoteControlMode)
{
requesterName = Context?.User?.Identity?.Name;

you will find that requesterName is null, although the request was initially authenticated.

It works nicely with the post method of the API.

@bitbound
Copy link
Collaborator

I'm not sure where you're seeing the line:
requesterName = Context?.User?.Identity?.Name;

I don't see that within the SendScreenCastRequestToDevice method or anywhere else. Maybe you're looking at an older version?

With that said, the "requesterName" parameter is meant only for the name that someone types in at the remote control page. It isn't tied to an account and doesn't get populated for unattended remote control sessions.

For an unattended remote control session, you'll see the following the logs:

Remote control session requested. Connection ID: CJnXgB8J9F2HRqUvdTgF1w. User ID: b626b614-ad15-4e9a-b999-08a668465f31. Screen Caster ID: WNf4NNspVhiTBstWyFfN2g. Mode: Unattended. Login ID (if logged in): translucency@outlook.com. Rquester Name (if specified): . Requester IP Address: ::1

The login ID will always be populated for unattended sessions, which is the username used to sign into Remotely. For attended sessions, it will only be populated if they're logged in.

However, I did add the requesterName parameter as an option for the unattended session, in case you wanted to add it after an API login. For example, at the end of the PowerShell example on the readme, I can add a requesterName parameter at the end of the URL.

if ($Response.StatusCode -eq 200) {
	$Response = Invoke-WebRequest -Uri "https://localhost:5001/api/RemoteControl/Maker" -WebSession $WebSession -Method Get -ContentType "application/json"
	if ($Response.StatusCode -eq 200) {
		Start-Process -FilePath "$($Response.Content)&requesterName=Jared"
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants