lazywinadmin / PowerShell

PowerShell functions and scripts (Azure, Active Directory, SCCM, SCSM, Exchange, O365, ...)
http://lazywinadmin.com
MIT License
2.54k stars 713 forks source link

I've got an 403 Error as result #13

Open FlorianSLZ opened 5 years ago

msmustamandi commented 5 years ago

Having the same issue as of today. InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Get-O365CalendarEvent], WebException

msmustamandi commented 5 years ago

Looks like Basic Authentication with api v1.0 is the problem.

FlorianSLZ commented 5 years ago

I have the same behavior with API v2.0 Do you have any idea how to solve the problem?

msmustamandi commented 5 years ago

I changed my script to use EWS for now until I can figure out how to use OAuth and Graph.

On Thu, Jan 17, 2019 at 2:36 AM flslz notifications@github.com wrote:

I have the same behavior with API v2.0 Do you have any idea how to solve the problem?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lazywinadmin/PowerShell/issues/13#issuecomment-455071336, or mute the thread https://github.com/notifications/unsubscribe-auth/AmgCqT45DX6zOMA8xbuMsFB_eSmkkW8Jks5vECf1gaJpZM4aCmeq .

ValuePy commented 5 years ago

v1.0 "Basic Authentication for Outlook REST API is no longer supported" (403) Forbidden v2.0 "Authentication for this API version requires OAuth." (403) Forbidden

How do we fix this?

FlorianSLZ commented 5 years ago

With this article I'm able to get the AuthToken, but my knowledge is not enough to get it work with the Invoke-RestMethod. May one of you can figure out how.

https://www.thelazyadministrator.com/2018/03/20/connect-to-the-microsoft-graph-api-with-powershell/

FlyeZz commented 5 years ago

I have the same with api V2.0

Someone can help me to fix the script?

Thanks in advance