I have solved this problem by adding Calendars.ReadWrite scope in AuthorizationRequestUrlParameters
Into below string updatedScopes
I had passed null so it's consider default scope of microsoft and not asked calendar permission.
String updatedScopes = scope == null ? "Calendars.ReadWrite" : scope;
PublicClientApplication pca = PublicClientApplication.builder(clientId).authority(authority).build();
AuthorizationRequestUrlParameters parameters = AuthorizationRequestUrlParameters
.builder(redirectURL,Collections.singleton(updatedScopes))
.responseMode(ResponseMode.QUERY)
.prompt(Prompt.SELECT_ACCOUNT).state(state).nonce(nonce)
.claimsChallenge(claims).build();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…