-
Notifications
You must be signed in to change notification settings - Fork 107
Unable to setup the code in my local environment #84
Comments
Hi Ankit, This error is thrown when the connection string is invalid, or your connection is blocked by a firewall. Please double check that the SQL Server connection string value you inserted in "defaultConnection" setting points to an existing database that you can access from your local machine. It may help to verify that you can connect with any database client (eg. Sql Server Management Studio) using that connection string. Since you mentioned this is a SQL Server instance hosted on Azure, please verify that the server firewall rules as configured from the azure portal allow your local machine's ip to connect. Regards, |
Hi MustafaLeithy, I am Prashanth, I and Ankit both are working on this entire solution (Backend, Frontend and Mobile client) to setup in our local environment. As per the instructions provided in the Readme file we have done the following steps: Step 1: Backend Service setup Registered the above local URL in Azure App registrations using our Tenant ID: [email protected] and provided App Id, Secret key, and Bing key in appsettings.json for Authorization. Step 2: Frontend setup While loading http://localhost:xxxx/assets it redirecting to https://login.microsoftonline.com/common/oauth2/v2.0/authorize with App Id and Backend URL as query string and throwing below error: Sign in AADSTS50194: Application 'xxxxxxxxxxxx'(App Name) is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant. Request Id: xxxxxxxx Thanks, |
Hello Prashanth, This error indicates your Azure Active Directory application is not configured to support multi-tenancy. When you are creating your AAD application, please make sure to choose the "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)" option under "Supported account types" heading. Alternatively you can create the application from the https://apps.dev.microsoft.com portal which automatically does this for you. If you are intentionally trying to limit the audience of your BMFT deployment to your organization only, then you will need to replace the /common/ in the "https://login.microsoftonline.com/common/oauth2/v2.0/authorize" url with your organization's tenant id. This URL is exposed in the appsettings.json file, under the section 'Authorization' with the title 'Authority'. Regards, |
Thanks Mustafa for the quick reply. I really appreciate for your time. I have updated the App registration to configure as multi-tenancy support. Now It is redirected to the Backend application (URL given during the App Registration) which is running on my local machine like http://localhost:xxxx/api/users/accessdenied. Any thoughts on this? Am I missing something in the Backend Service? Do you have any Architectural diagram of the entire solution to understand the flow? If yes, please provide. Thanks, |
Adding to above... Can you please provide some insights on how User module works. When I am accessing first time it should ask me for registration but here it is redirecting to access denied page in Backend service. Let me put my understanding here:
Please suggest on how to proceed. Thanks, |
Hello Prashanth, This scenario is handled with the "Owner Email" setting. For a user to sign up, another user has to approve his sign up request. So who approves the first user? The answer is that first user is created automatically and bypasses the approval process. However that first user must be signing in with the same email as is specified in the "Owner Email" setting. The setting is listed here as a required value. Regards, |
Thanks Mustafa. Presently I am the owner and I used my tenant id [email protected] in appsetting.json and published the Backend Service to cloud. Under Authentication/Authorization section on Azure I have changed to use Active directory. When I run the front end service while loading it prompted me to select and authorize. After selecting my user id it was redirected to backend service with error message. Finally it is not creating the user even for first time also. How can I add/grant permissions to my other email id like [email protected] from where I am logged in instead of tenant id. Thanks, |
I am getting below error: AADSTS700054: response_type 'id_token' is not enabled for the application. |
Just had this issue after doing the one-click deployment. It appears that by default, the one-click deployment does not enable "Implicit grant" with "ID tokens". To resolve this issue, go to the following path: Azure Portal > Azure Active Directory > App Registrations > Select your app registration for this app > Authentication > Advanced Settings > Implicit grant Check the box for "ID Tokens" and it should resolve the AADSTS700054 issue. We were able to log in and use the application both locally and in Azure after this. May want to update the one-click deployment script to enable "ID Tokens" by default if possible. |
Hi,
After deployment on Azure we are getting 503 service unavailable. This time
we deployed as a Azure cloud solution asper Ur guidelines but no luck.
Please help us.
Thanks,
Prashanth
…On Wed, 11 Sep 2019, 3:30 a.m. mfco, ***@***.***> wrote:
Just had this issue after doing the one-click deployment.
It appears that by default, the one-click deployment does not enable
"Implicit grant" with "ID tokens".
To resolve this issue, go to the following path:
*Azure Portal > Azure Active Directory > App Registrations > Select your
app registration for this app > Authentication > Advanced Settings >
Implicit grant*
Check the box for "ID Tokens" and it should resolve the AADSTS700054 issue.
We were able to log in and use the application both locally and in Azure
after this.
*May want to update the one-click deployment script to enable "ID Tokens"
by default if possible.*
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#84?email_source=notifications&email_token=ALW2EVVE3ZMSLUWT2EB5QATQJAGC7A5CNFSM4INBBFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6MRP2Y#issuecomment-530126827>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALW2EVSYA7YJPEKQNOUXIC3QJAGC7ANCNFSM4INBBFNQ>
.
|
We just ran the one-click deployment again and received the same 503 error as you. We had to delete the resource group generated by the deployment and all its resources. Then ran the one-click deployment again. After failing multiple times, on the 5th one-click deployment, the site opens properly. We still had to correct the ID Tokens issue to enable logging in properly. |
Hi,
As per the instructions provided in readme file of Backend Services link we have done the setup with following steps:
"ClientId": "xxxxxxx", (created app in Azure and copied the App Id)
"ClientSecret": "xxxxxx", (copied the secrete key)
"Authority": "https://login.microsoftonline.com/common/v2.0",
"OwnerEmail": "[email protected]", (Tenant portal email id)
"SecurityKey": "xxxxx" (JWT)
An error occurred while starting the application.
Win32Exception: The wait operation timed out
Unknown location
SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, object providerInfo, string newPassword, SecureString newSecurePassword, bool redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, string accessToken, bool applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
Win32Exception: The wait operation timed out.
SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, object providerInfo, string newPassword, SecureString newSecurePassword, bool redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, string accessToken, bool applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, uint waitForMultipleObjectsTimeout, bool allowCreate, bool onlyOneCheckConnection, DbConnectionOptions userOptions, out DbConnectionInternal connection)
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource retry, DbConnectionOptions userOptions, out DbConnectionInternal connection)
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, out DbConnectionInternal connection)
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource retry, DbConnectionOptions userOptions)
System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource retry, DbConnectionOptions userOptions)
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource retry)
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource retry)
System.Data.SqlClient.SqlConnection.Open()
System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__36(DbConnection t, DbConnectionInterceptionContext c)
System.Data.Entity.Infrastructure.Interception.InternalDispatcher.Dispatch<TTarget, TInterceptionContext>(TTarget target, Action<TTarget, TInterceptionContext> operation, TInterceptionContext interceptionContext, Action<TInterceptor, TTarget, TInterceptionContext> executing, Action<TInterceptor, TTarget, TInterceptionContext> executed)
System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.Open(DbConnection connection, DbInterceptionContext interceptionContext)
System.Data.Entity.SqlServer.SqlProviderServices+<>c__DisplayClass33.b__32()
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy+<>c__DisplayClass1.b__0()
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func operation)
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation)
System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action act)
System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action act)
System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable commandTimeout, DbConnection sqlConnection, string createDatabaseScript)
System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable commandTimeout, StoreItemCollection storeItemCollection)
System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable commandTimeout, StoreItemCollection storeItemCollection)
System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase()
System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection)
System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase)
System.Data.Entity.Migrations.DbMigrator.Update(string targetMigration)
System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update()
Trackable.EntityFramework.EntityFrameworkExtensions.UseDb(IApplicationBuilder builder, string connectionString) in EntityFrameworkExtensions.cs
+
migrator.Update();
Trackable.Repositories.RepositoriesExtensions.UseRepositories(IApplicationBuilder builder, string connectionString) in RepositoriesExtensions.cs
+
return builder.UseDb(connectionString);
Trackable.Services.ServiceExtensions.UseServices(IApplicationBuilder builder, string connectionString, string ownerEmail) in ServiceExtensions.cs
+
return builder.UseRepositories(connectionString);
Trackable.Web.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, IServiceProvider seriveProvider) in Startup.cs
+
app.UseServices(Configuration.GetConnectionString("DefaultConnection"),
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
Microsoft.ApplicationInsights.AspNetCore.ApplicationInsightsStartupFilter+<>c__DisplayClass0_0.b__0(IApplicationBuilder app)
Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter+<>c__DisplayClass3_0.b__0(IApplicationBuilder app)
Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter+<>c__DisplayClass0_0.b__0(IApplicationBuilder builder)
Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
Are we missing something here?
Please help us in resolving this issue.
Thanks,
Ankit
The text was updated successfully, but these errors were encountered: