-
Notifications
You must be signed in to change notification settings - Fork 5
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
Check for elevated permissions with automatic login #482
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
e9f18ac
okta: add dsso authentication
gord5500 a16a9e9
add cancellation token to newpageasync
gord5500 6fc7baa
tweak warning messages
gord5500 73d0cdd
Update src/D2L.Bmx/OktaAuthenticator.cs
gord5500 c2f13bd
var name tweak
gord5500 19fa544
tweak warning message for non matching user
gord5500 4f177b7
mend
gord5500 aedb835
change reload signin page
gord5500 c14de8e
add passwordless option that defaults to false
gord5500 77a91c4
mend
gord5500 1b8cfd2
tweak warning message
gord5500 1a8ba2e
set browser as headless based on bmx_debug env variable
gord5500 b526dbe
readd path check
gord5500 d502f1d
default browser to edge for windows
gord5500 28b320a
headless is always true regardless of bmx_debug
gord5500 7633b0f
make no-sandbox option scarier
gord5500 185b8ff
abort if not on vpn
gord5500 d9fe294
normalize okta org and check users route
gord5500 0080063
remove passwordless flag
gord5500 ac51994
mend
gord5500 ff3f8e1
adjust parameter name for experimental
gord5500 551f6cf
rename okta session function
gord5500 64f5efb
redo org check
gord5500 40171e4
Update src/D2L.Bmx/Browser.cs
gord5500 a2f903a
nits
gord5500 88f7517
more nits
gord5500 91d52b6
readd user email strip check
gord5500 684f1bd
mend
gord5500 81a3714
mend
gord5500 d48c7db
deal in uris instread of string for orgs
gord5500 7a68852
remove OktaHomeResponse model
gord5500 6dba5c1
rename to orgUrl
gord5500 f46d800
dont mention sso
gord5500 fa1fd6d
simplify login name check
gord5500 fc17c78
Update src/D2L.Bmx/ParameterDescriptions.cs
gord5500 e479bc8
Update src/D2L.Bmx/OktaAuthenticator.cs
gord5500 d87d349
Update src/D2L.Bmx/OktaAuthenticator.cs
gord5500 754699e
Update src/D2L.Bmx/OktaAuthenticator.cs
gord5500 1054c06
Update src/D2L.Bmx/OktaAuthenticator.cs
gord5500 7ec3833
don't pass the client factory
gord5500 de1e41f
check elevated permissions on experimental flag
gord5500 96a9e7d
scarier message
gord5500 96177a7
fix libc call
ArckosLiam 5b05ca9
format
gord5500 afef184
wording
gord5500 c956f2a
don't kill on bad setup
gord5500 9d717e8
mend
gord5500 e47e88b
mend
gord5500 7063367
Merge branch 'main' into check_for_elevated_permission
gord5500 521a53f
reword the warning message
gord5500 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Runtime.InteropServices; | ||
using System.Security.Principal; | ||
|
||
namespace D2L.Bmx; | ||
|
||
internal static partial class UserPrivileges { | ||
|
||
[LibraryImport( "libc", EntryPoint = "geteuid" )] | ||
internal static partial uint GetPosixEuid(); | ||
|
||
internal static bool HasElevatedPermissions() { | ||
bool isElevated = false; | ||
if( OperatingSystem.IsWindows() ) { | ||
isElevated = new WindowsPrincipal( WindowsIdentity.GetCurrent() ).IsInRole( WindowsBuiltInRole.Administrator ); | ||
} else if( OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() ) { | ||
isElevated = GetPosixEuid() == 0; | ||
} | ||
return isElevated; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in scope, but - some warnings messages are prefixed with "WARNING:" while others are not.
Would be nice to be consistent on this.
I lean towards no prefix, because we already use a different colour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yea you're right. I started with including the prefix since they were in the bmx config provider class but have been inconsistent. I see we use
WriteWarning
in other places though without it. I think I'll remove the prefix for this class