All Projects → gladius → firebase-spring-boot-rest-api-authentication

gladius / firebase-spring-boot-rest-api-authentication

Licence: MIT license
Firebase Spring Boot Rest API Authentication

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to firebase-spring-boot-rest-api-authentication

Express Graphql Mongodb Boilerplate
A boilerplate for Node.js apps / GraphQL-API / Authentication from scratch - express, graphql - (graphql compose), mongodb (mongoose).
Stars: ✭ 288 (+67.44%)
Mutual labels:  verification, authorization
Authenticationintro
Stars: ✭ 82 (-52.33%)
Mutual labels:  cookies, session
Express Mongodb Rest Api Boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose).
Stars: ✭ 153 (-11.05%)
Mutual labels:  verification, authorization
Jaguar
Jaguar, a server framework built for speed, simplicity and extensible. ORM, Session, Authentication & Authorization, OAuth
Stars: ✭ 286 (+66.28%)
Mutual labels:  session, authorization
auth
Authorization for humans
Stars: ✭ 49 (-71.51%)
Mutual labels:  roles, authorization
Spring Boot Shopping Cart
Simple shopping cart web app made using Spring Boot + Thymeleaf
Stars: ✭ 85 (-50.58%)
Mutual labels:  session, spring-security
iron-session
🛠 Node.js stateless session utility using signed and encrypted cookies to store data. Works with Next.js, Express, NestJs, Fastify, and any Node.js HTTP framework.
Stars: ✭ 1,729 (+905.23%)
Mutual labels:  cookies, session
Security.identity
.NET DevPack Identity is a set of common implementations to help you implementing Identity, Jwt, claims validation and another facilities
Stars: ✭ 165 (-4.07%)
Mutual labels:  roles, authorization
next-ts-starter
A Next.JS powered Typescript starter with styled components, styled-system, framer motion, jest and cypress
Stars: ✭ 27 (-84.3%)
Mutual labels:  starter, cypress
Next Firebase Auth
Simple Firebase authentication for all Next.js rendering strategies
Stars: ✭ 135 (-21.51%)
Mutual labels:  cookies, firebase-authentication
Bouncer
Eloquent roles and abilities.
Stars: ✭ 2,763 (+1506.4%)
Mutual labels:  roles, authorization
nova-permissions
Add Permissions based authorization for your Nova installation via User-based Roles and Permissions. Roles are defined in the database whereas Permissions are defined in the code base.
Stars: ✭ 115 (-33.14%)
Mutual labels:  roles, authorization
Vue Router User Roles
A Vue.js plugin that protects routes based on user roles. Add your own authentication.
Stars: ✭ 237 (+37.79%)
Mutual labels:  roles, authorization
fastapi-cloudauth
Simple integration between FastAPI and cloud authentication services (AWS Cognito, Auth0, Firebase Authentication).
Stars: ✭ 221 (+28.49%)
Mutual labels:  verification, firebase-authentication
Kan
Simple, functional authorization library and role management for ruby
Stars: ✭ 232 (+34.88%)
Mutual labels:  roles, authorization
macaroon
Rust implementation of macaroons.
Stars: ✭ 16 (-90.7%)
Mutual labels:  cookies, authorization
Laratrust
Handle roles and permissions in your Laravel application
Stars: ✭ 1,799 (+945.93%)
Mutual labels:  roles, authorization
Think Authz
An authorization library that supports access control models like ACL, RBAC, ABAC in ThinkPHP 6.0 .
Stars: ✭ 155 (-9.88%)
Mutual labels:  roles, authorization
Sessionup
Straightforward HTTP session management
Stars: ✭ 107 (-37.79%)
Mutual labels:  cookies, session
laravel-roles-abilities-tutorial
Tutorial demonstrating the implementation of roles and abilities in Laravel
Stars: ✭ 16 (-90.7%)
Mutual labels:  roles, authorization

Firebase Authentication for Spring boot License: MIT

Open with ThePro

Firebase is a backendless platform to run applications without dedicated backend. But, sometimes you may need to communicate with API of an exisiting backend or you may want a dedicated backend to perform operations that cannot be done through firebase infrastructure.

This Spring Boot Starter is perfect for such situations when you want to extend firebase's authentication menchanism with Spring Security to seamlessly create and use protected rest API's.

Configuration

  • Be sure to add the following environment variable globally or project specific run configuration environment variable GOOGLE_APPLICATION_CREDENTIALS=path_to_firebase_server_config.json

  • The starter can be configured to use firebase session as client side / strictly server side or both together.

  • Htty Only / Secure enabled Session cookies may not work as expected in development hosts (localhost, 120.0.0.1). Adding self signed ssl certificate with reverse proxied host will work perfectly fine. Read this article => Local Domain Names with SSL for development applications

  • Following application properties can edited to customize for your needs. Sample @ application.yaml

Role Management

  • Roles can be added through SecurityRoleService during registeration of user or manually managed by Super admins
  • Super Admins are defined through application property security.super-admins
  • With roles feature tightly integrated with spring security, Spring authorization annotations like @Secured, @RolesAllowed, @PreAuthorize, @PostAuthorized etc will work perfectly fine.
  • I personally like to define per role annotations like @IsSuper, @IsSeller for the sake of simplicity.
    @GetMapping("data")
	@isSeller
	public String getProtectedData() {
		return "You have accessed seller only data from spring boot";
	}
  • UI useAuth hook also has utility properties like _ roles, hasRole, isSuper, isSeller _ properties exposed accross the application to allow or restrict access to specific UI components. Read this post at thepro.io for more detailed explanation on role management Firebase and Spring Boot Based Role Management and Authorization

End to End Test

The method I used to solve the problem of testing firebase social authentication is opinionated and may not be suitable to everyone. Simply put, we create a toggleable Test User functionaly that authenticates specific set of static test users through firebase custom token. This solves a lot of issues associated with testing a third party backed authentication flow. Read this post at thepro.io for more in detail explanation End to End Test Firebase Authentication with Cypress, Spring Boot & Nextjs

Related Tutorials :

UI Demo

Screenshots

Client Side Session Screenshots

Logged out Logged In
Image of UI Loggedout Image of UI LoggedIn
Image of UI Loggedin Seller

Server Side Session Screenshots

Image of UI Server Side Session

Cypress End to End Tests Screencapture

Image of End to End Tests

Author

👤 Gladius

  • Website: thepro.io/@/gladius
  • Github: @gladius

Show your support

Give a ⭐️ if this project helped you!

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].