You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This token I'm passing as Authorization header to api and it's giving an error IDW10201: No scope or app permission (role) claim was found in the bearer token
Here is API code
from fastapi import APIRouter,Request
from fastapi_microsoft_identity import AuthError,requires_auth,validate_scope
import fastapi
from fastapi.exceptions import HTTPException
from pydantic import ValidationError
from utills.config import AppConfigs
poc_router = APIRouter()
scope = "access_api"
@poc_router.get("/add/{num1}/{num2}")
@requires_auth
async def add_with_auth(request:Request,num1:int,num2:int):
try:
validate_scope(required_scope=scope,request=request)
return num1+num2
except AuthError as ae:
return fastapi.Response(content=ae.error_msg, status_code=ae.status_code)
except ValidationError as ve:
return fastapi.Response(content=ve.error_msg, status_code=ve.status_code)
except Exception as x:
raise HTTPException(status_code=403,detail=f"Failed with Excetion--{e}")
Please help me how to get proper access token that can be sent to api
The text was updated successfully, but these errors were encountered:
The following is the code I'm using to get token
This token I'm passing as Authorization header to api and it's giving an error
IDW10201: No scope or app permission (role) claim was found in the bearer token
The text was updated successfully, but these errors were encountered: