v1.5.0

Released: 3-7-2018

Real-time custom elements

Create real-time web applications with Universal Dashboard.

For more information, see this blog post.

REST API Authentication

REST APIs now support the authentication via JSON Web Tokens. You can use New-UDAuthenticationMethod to configure JWT parameters such as Audience, Issuer and SigningKey.

$AuthMethod = New-UDAuthenticationMethod -SigningKey 'SuperSecretKey'

$Server = Start-UDRestApi -Port 10001 -Endpoint @(
    New-UDEndpoint -Url "user/me" -Method "GET" -Endpoint {
        @($User) | ConvertTo-Json
    }
)-AuthenticationMethod $AuthMethod

$Token = Grant-UDJsonWebToken -UserName "Adam" -SigningKey 'SuperSecretKey'

You can then use the endpoint by specifying the token via the headers parameter.

$users = Invoke-RestMethod -Uri http://localhost:10001/api/user/me -Headers @{ Authorization = "Bearer $Token" }
$users | Should be "Adam"

You can also allow users to get tokens by authenticating through the API. Using Forms auth, you can provide an endpoint and authenticate the user how you wish.

$AuthMethod = New-UDAuthenticationMethod -Endpoint {
    New-UDAuthenticationResult -Success -UserName $Credential.UserName
}

$Server = Start-UDRestApi -Port 10001 -Endpoint @(
    New-UDEndpoint -Url "user/me" -Method "GET" -Endpoint {
        @($User) | ConvertTo-Json
    }
) -AuthenticationMethod $AuthMethod

The user can then call the login endpoint to retrieve a token and use it against the API.

$Token = Invoke-RestMethod -Uri http://localhost:10001/api/login -Method POST -Body @{ UserName = "Adam"; Password = "Test" }

$users = Invoke-RestMethod -Uri http://localhost:10001/api/user/me -Headers @{ Authorization = "Bearer $($Token.Token)" }
$users | Should be "Adam"

REST APIs do not support OAuth authentication.

GeoLocation Support

Enable GeoLocation by specifying the -GeoLocation parameter on New-UDDashboard. If a user allows the dashboard to return their location, all endpoints will have the $Location variable defined. The location variable is defined as follows:

@{
    coords = @{
         latitude, 
         longitude,
         accuracy,
         altitude,
         altitudeAccuracy
         heading,
         speed
    },
    timestamp
}

Issues Resolved

  • #9 Custom Components for UD
  • #10 GeoLocation Support
  • #27 Custom loading message for New-UDLoginPage
  • #2 Boolean columns display as blank
  • #1 Blank Page If Page Title Contains Dash
  • #20 REST API Authentication
  • #12 Replace Raw Websockets with SignalR
  • #4 DebugRunspace is missing on New-UDInput
  • #13 AutoReload causes PowerShell to crash
  • #11 Upgrade to ASP.NET Core 2.0
  • #6 Documentation link in footer is broken

results matching ""

    No results matching ""