Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Friendly prompt for database creation (using admin) #597

Open
1 of 17 tasks
sgalcheung opened this issue Apr 18, 2022 · 6 comments
Open
1 of 17 tasks

Friendly prompt for database creation (using admin) #597

sgalcheung opened this issue Apr 18, 2022 · 6 comments
Assignees
Labels

Comments

@sgalcheung
Copy link

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

The issue was found for the following scenario:

Please add an 'x' for the scenario(s) where you found an issue

  1. Web app that signs in users
    1. with a work and school account in your organization: 1-WebApp-OIDC/1-1-MyOrg
    2. with any work and school account: /1-WebApp-OIDC/1-2-AnyOrg
    3. with any work or school account or Microsoft personal account: 1-WebApp-OIDC/1-3-AnyOrgOrPersonal
    4. with users in National or sovereign clouds 1-WebApp-OIDC/1-4-Sovereign
    5. with B2C users 1-WebApp-OIDC/1-5-B2C
  2. Web app that calls Microsoft Graph
    1. Calling graph with the Microsoft Graph SDK: 2-WebApp-graph-user/2-1-Call-MSGraph
    2. With specific token caches: 2-WebApp-graph-user/2-2-TokenCache
    3. Calling Microsoft Graph in national clouds: 2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph
  3. Web app calling several APIs 3-WebApp-multi-APIs
  4. Web app calling your own Web API
    1. with a work and school account in your organization: 4-WebApp-your-API/4-1-MyOrg
    2. with B2C users: 4-WebApp-your-API/4-2-B2C
    3. with any work and school account: 4-WebApp-your-API/4-3-AnyOrg
  5. Web app restricting users
    1. by Roles: 5-WebApp-AuthZ/5-1-Roles
    2. by Groups: 5-WebApp-AuthZ/5-2-Groups
  6. Deployment to Azure
  7. Other (please describe)

Repro-ing the issue

Repro steps

When I try Create database and tables

 "ConnectionStrings": {
  "TokenCacheDbConnStr": "Data Source=(LocalDb)\\MSSQLLocalDB;Database=MY_TOKEN_CACHE_DATABASE;Trusted_Connection=True;"
},

Expected behavior
Give me some friendly prompt or Prompt to use administrator privileges in readme

Actual behavior
I got some errors, don't know what happened

An error occurred. Cannot open database "MY_TOKEN_CACHE_DATABASE" requested by the login. The login failed.
Login failed for user 'SGALWORK\sgalw'.

Possible Solution
Finally, the command line with administrator privileges was successfully created

OS and Version?

Windows 11

Versions

of ASP.NET Core, of MSAL.NET

@kalyankrishna1
Copy link
Contributor

Thanks @sgalcheung , we'd provide some instructions..

@aremo-ms
Copy link
Contributor

@sgalcheung
Thank you for your feedback
I've found that the command

dotnet sql-cache create "Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=MY_TOKEN_CACHE_DATABASE;Integrated Security=True;" dbo TokenCache

fails when a database not found, but passes once the database exists - it just adds a specified table for cache
I didn't find a documentation saying that the command creates a database.
If you have one - please forward it to me.

@aremo-ms aremo-ms added the question Further information is requested label Aug 29, 2022
@sgalcheung
Copy link
Author

I originally meant to add a prompt, create with admin privileges and that's it

@aremo-ms
Copy link
Contributor

@sgalcheung
I'm not understand, to create what with admin privileges? The database?

@sgalcheung
Copy link
Author

sgalcheung commented Aug 29, 2022 via email

@aremo-ms
Copy link
Contributor

@sgalcheung
take a look into my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants