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

remove notify user by email and display user code directly #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pam_aad.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define SUBJECT "Your one-time passcode for signing in via Azure Active Directory"
#define TTW 5 /* time to wait in seconds */
#define USER_AGENT "azure_authenticator_pam/1.0"
#define USER_PROMPT "\n\nEnter the code at https://aka.ms/devicelogin."
#define USER_PROMPT "Enter the code at https://aka.ms/devicelogin."

#ifndef _AAD_EXPORT
#define STATIC static
Expand Down Expand Up @@ -465,10 +465,13 @@ STATIC int azure_authenticator(const char *user)
u_code = data.u_code;
d_code = data.d_code;

sds prompt = sdsnew(CODE_PROMPT);
prompt = sdscat(prompt, u_code);
prompt = sdscat(prompt, USER_PROMPT);
notify_user(user_addr, tenant_addr, prompt, smtp_server, debug);
//sds prompt = sdsnew(CODE_PROMPT);
//prompt = sdscat(prompt, u_code);
//prompt = sdscat(prompt, USER_PROMPT);
//notify_user(user_addr, tenant_addr, prompt, smtp_server, debug);

// Display User code
printf("%s %s\n%s\n\n", CODE_PROMPT, u_code, USER_PROMPT)

auth_bearer_request(&data, client_id, tenant, d_code, json_data,
debug);
Expand Down