mirror of https://gitlab.com/dabruh/dotfiles.git
Automatically trigger BankID login through SSH.
This commit is contained in:
parent
0e27fa5cfa
commit
20764a342a
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Takes a bankid URI as input, extracts the token and writes the token to disk
|
||||||
|
# on a target Windows SSH host. The target host is expected to watch for this
|
||||||
|
# file, just like the following PowerShell script does:
|
||||||
|
# https://gitlab.com/dabruh/weird-corner/-/blob/main/powershell/BankIDTokenFileWatcher.ps1
|
||||||
|
|
||||||
|
TOKEN=${1:?} || exit 1
|
||||||
|
TOKEN="${TOKEN#*=}"
|
||||||
|
TOKEN="${TOKEN%&*}"
|
||||||
|
|
||||||
|
xclip -selection clipboard <<<"$TOKEN"
|
||||||
|
ssh bankid -- powershell.exe -NoLogo -ExecutionPolicy Bypass -Command "Set-Content -Path C:\.bidtoken -Value '$TOKEN'" &
|
||||||
|
notify-send BankID "Token has been sent." &
|
|
@ -1,4 +1,4 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Type=Application
|
Type=Application
|
||||||
Name=BankID URI xclip
|
Name=BankID URI xclip
|
||||||
Exec=bash -c "xclip -selection clipboard <<<%u"
|
Exec=bash -c "send-bankid-token '%u'"
|
||||||
|
|
Loading…
Reference in New Issue