Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Authentication Problem / Failed #244

Closed
usane opened this issue May 17, 2018 · 1 comment
Closed

Authentication Problem / Failed #244

usane opened this issue May 17, 2018 · 1 comment

Comments

@usane
Copy link

usane commented May 17, 2018

Hi,

I am trying to develop console application which automatically uploads files to share our customers.
However, I run into following two issues.

One is that OneDrive API requires browser user interaction for authentication. Although I passed to application id and password, getting from Application Registration Portal, when authentication request.

Following is request uri I passed.
(https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id={client_id}&client_secret={client_secret}&scope={scope}&response_type=token&redirect_uri={redirect_uri})

I don't know why it requires additional log-in process, and I would like to know how I can avoid this process.
Sure, I've googled by this issue and found some post there are no fully automatic authentication but these posts are out-dated...
Is there any up-to-date state? Still manual procedure required?
(If so, why???)

Another is the authentication itself.
I just copied and pasted the example code described at this project page, It throws Microsoft.Graph.ServiceException

Following is the source I tried. (I gave up automatic auth)

var authProvider = new MsaAuthenticationProvider(id, redirection, new string[] { "Files.ReadWrite.All"});
await authProvider.AuthenticateUserAsync();
client = new OneDriveClient(authProvider);
var rootItem = await client.Drive.Request().GetAsync(); // Excpetion arose!

I checked authProvider.IsAuthenticated is true and CurrentAccountSession attribute has AcessToken. However I cann't make any request.

Following is full message of the exception:
Microsoft.Graph.ServiceException이(가) 발생했습니다.
HResult=0x80131500
메시지=Code: unauthenticated
Throw site: 4f37.717b
Message: Authentication failed

StackTrace:
at Microsoft.Graph.HttpProvider.d__19.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.d__36.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.d__321.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.OneDrive.Sdk.DriveRequest.<GetAsync>d__6.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at KMLizer.Util.CloudDrive.OneDrive.d__6.MoveNext() in ~OneDrive.cs:line 44

I cannot guess and find the problem...

Can anyone give me an advice?

Thanks in advance.

@baywet
Copy link
Member

baywet commented Oct 2, 2024

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #259 for more information

@baywet baywet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants