-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Options to export Token Secrets #4
base: master
Are you sure you want to change the base?
Conversation
…ata, usable in image editors, and as temp files, paste-able wherever
I actually got QR Codes working too, however since i have no experience with UI, it can currently only be copied to clipboard, either as image data, or as image file. |
} | ||
|
||
- (NSString *)qrString:(NSArray *)input { | ||
return [NSString stringWithFormat: @"otpauth://totp/%@:%@?secret=%@&issuer=%@", input[0],input[1],self.secret,input[0]]; |
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.
This is currently implemented in
OneTime/OneTimeKit/Models/OTBag.m
Line 166 in 8839590
return [self _urlForScheme:@"otpauth"]; |
|
||
@implementation OTQRCreatorService | ||
|
||
+ (CIImage *)generateQRCodeImageFromString:(NSString *)string { |
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.
This is implemented in
OneTime/OneTimeKit/Services/OTQRService.m
Line 56 in 8839590
- (CIImage *)codeImageForData:(NSData *)data { |
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.
Thanks for your thoughts and contributions on this!
Sorry for some of the overhead - some of the code in the second commit is already implemented in this repo.
Probably for the best, as i said, i just hacked together what i found in docs / web. |
This is an experimental pr to address #3
![Screenshot 2024-09-14 at 18 18 26](https://private-user-images.githubusercontent.com/124401812/367528738-9d7112f4-2c59-418d-8081-bd3fa1b427e5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTI5NjgsIm5iZiI6MTczOTYxMjY2OCwicGF0aCI6Ii8xMjQ0MDE4MTIvMzY3NTI4NzM4LTlkNzExMmY0LTJjNTktNDE4ZC04MDgxLWJkM2ZhMWI0MjdlNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQwOTQ0MjhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT02YzhkOTJhZDkzNjY4MzIzMGQ2YTNkMDNiZjRlYTQyNzhkMzRmN2U1OTJjMzMyYzA4YmY4Y2EzZTYyNDI1ZDUxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.w8vA-TCsjeJpaZ7DOovBw52JvnJOL1cn04h-oQOJCvk)
Currently, it just introduces the option to copy the token secret to clipboard:
Until this can be implemented in production, there needs to be some access control, basically using the Apple "User Authentication" through Biometrics/Password.
I am not an Apple / Objective-C developer, so i have no idea how to properly implement this, however i have found the Apple Docs for the required functions:
https://developer.apple.com/documentation/localauthentication/logging-a-user-into-your-app-with-face-id-or-touch-id and
https://developer.apple.com/documentation/localauthentication/lapolicy/deviceownerauthentication specifically.
The proposed flow is: Upon clicking the extract function, the function is called, the User authenticates, and a flag is set to keep the user authenticated either until the app is closed, or a certain amount of time passes. I don't know if macos works natively with that function or some other way to authenticate is needed for the mac app.
I am not concerned with creating QR Codes, but technically that should be easy enough to implement, provided there is a function / library to create them, the data should be possible to recreate.