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

Can sentinel console disable login? #997

Closed
lw5946 opened this issue Aug 19, 2019 · 10 comments · Fixed by #1004
Closed

Can sentinel console disable login? #997

lw5946 opened this issue Aug 19, 2019 · 10 comments · Fixed by #1004
Labels
area/dashboard Issues or PRs about Sentinel Dashboard good first issue Good for newcomers

Comments

@lw5946
Copy link

lw5946 commented Aug 19, 2019

Issue Description

Type: feature request

Describe what happened (or what feature you want)

Turn off login so I can use my console page more easily

Describe what you expected to happen

Just like the nacos console

@sczyh30 sczyh30 added area/dashboard Issues or PRs about Sentinel Dashboard good first issue Good for newcomers labels Aug 19, 2019
@sczyh30
Copy link
Member

sczyh30 commented Aug 19, 2019

Contributions are welcomed!

@zhaoyuguang
Copy link
Collaborator

Hi all, I will try to finish it.

@sczyh30
Copy link
Member

sczyh30 commented Aug 20, 2019

Hi all, I will try to finish it.

Great, looking forward to your PR!

@zhaoyuguang
Copy link
Collaborator

zhaoyuguang commented Aug 20, 2019

Through my study of Sentinel, my simple design is as follows

1 Through dynamic configuration, determine the implementation class of AuthService to inject AuthFilter
2 When judging is the FakeAuthServiceImpl configuration, add localStorage::set session_sentinel_admin when path=/
FYI @sczyh30

@cdfive
Copy link
Collaborator

cdfive commented Aug 20, 2019

If remain localStorage and session of backend, the timeout need take into consideration.

Maybe this is a simple approach:

  1. Add a configuration propertity:
    auth.enable=true in application.properties.
  2. Using @ConditionalOnProperty in WebConfig and AuthFilter, to register authFilter dynamically.

But in front side, how to disable localStorage check in header.js and AuthInterceptor in app.js,
If we can remove the code in js dynamically, it's seems good.
Is there any good idea?

@linlinisme
Copy link
Collaborator

haha, the angular.js can retrieve config in java? May be the check logic focus on the back end is easier to extend and maintain

@lw5946
Copy link
Author

lw5946 commented Aug 21, 2019

That's great. You've got it done so quickly.Thank you.

@zhaoyuguang
Copy link
Collaborator

That's great. You've got it done so quickly.Thank you.

The quickly bird catches the pr 😂

@cdfive
Copy link
Collaborator

cdfive commented Aug 26, 2019

@linlinisme

May be the check logic focus on the back end is easier to extend and maintain

Yes, indeed. Thanks to @zhaoyuguang provide a very clever implement.

@lw5946
Now we can disable login of dashboard easily, adding a VM argument -Dauth.enabled=false.

@lw5946
Copy link
Author

lw5946 commented Aug 26, 2019

@cdfive @zhaoyuguang @sczyh30 Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard Issues or PRs about Sentinel Dashboard good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants