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

config in GroupAuthService is null with below error - #2

Open
manasimahajann opened this issue Jul 15, 2020 · 4 comments
Open

config in GroupAuthService is null with below error - #2

manasimahajann opened this issue Jul 15, 2020 · 4 comments

Comments

@manasimahajann
Copy link

manasimahajann commented Jul 15, 2020

We are trying to implement this in webassembly blazor(Azure b2c) - which has api, server and client projects.
Could you be able to suggest what are we missing here!?--

System.ArgumentException
HResult=0x80070057
Message='authority' Uri should have at least one segment in the path (i.e. https:////...) (Parameter 'authority')
Source=Microsoft.IdentityModel.Clients.ActiveDirectory
StackTrace:
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator.DetectAuthorityType(String authority)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator.Init(IServiceBundle serviceBundle, String authority, Boolean validateAuthority)
at Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Instance.Authenticator..ctor(IServiceBundle serviceBundle, String authority, Boolean validateAuthority)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext..ctor(IServiceBundle serviceBundle, String authority, AuthorityValidationType validateAuthority, TokenCache tokenCache, IHttpClientFactory httpClientFactory)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext..ctor(String authority)
at downtown.api.AuthRoleService.GroupAuthService..ctor(IOptions1 graphConfig, ILoggerFactory loggerFactory) in C:\dev\downtown_b\downtown.api\AuthRoleService\GroupAuthService.cs:line 38 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitDisposeCache(ServiceCallSite transientCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.d__5.MoveNext()

@elvogel
Copy link
Collaborator

elvogel commented Jul 15, 2020

The only thing I can suggest is to do as the exception suggests and take a look at what's happening in line 38 of the GroupAuthService which, in my code, is commented out. But the 'authority' Uri should have at least one segment in the path (i.e. https:////...) (Parameter 'authority') error suggests you've got a missing parameter in the Uri path.

@manasimahajann
Copy link
Author

manasimahajann commented Jul 15, 2020

Hi @elvogel thanks for your response.
Yes, we are using the same code (it is commented out)
I see that we are getting all null values in IOptions graphConfig

@manasimahajann
Copy link
Author

Hi @elvogel We have now gotten little further in this..
We are now trying to figure out what url would it be.. Can we still use "1.6 Graph API version"? "
How to convert the url - "https://graph.windows.net/" + config.Tenant + api + "?" + aadGraphVersion;" to the latest Graph API

has anyone here tried with https://graph.microsoft.com/v1.0

@elvogel
Copy link
Collaborator

elvogel commented Jul 24, 2020

Sounds like you need hands-on assistance with this. Feel free to reach out at https://endpointsystems.com/contact where we can discuss paid support options.

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