Completed
Laravel API Training
Univesiti Sains Islam Malaysia
Date
7 โ 13 Mar 2023
Organised by
Favourite Trainer Sdn Bhd
Trainer
Raj Kumar bin Mahful
Attendees
17
Laravel API Training
Trainer Profile
![]() |
Name: Raj Kumar Mahful Role & Engagement
Personal Life
|
|
Technical Experience / Involvement Business Intelligence Tools
ETL Tools
Web-based Application
Databases
Front-End Tools
|
|
Notes
package com.example.sakila;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.util.Arrays;
import java.util.Collections;
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
//http.csrf().disable().cors().disable();
}
@Bean
public CorsFilter corsFilter() {
System.out.println("doing cors...");
UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.setAllowCredentials(true);
corsConfiguration.setAllowedOrigins(Collections.singletonList("*"));
corsConfiguration.setAllowedOrigins(Arrays.asList("http://localhost:3000"));
corsConfiguration.setAllowedHeaders(Arrays.asList("Origin", "Content-Type","Accept", "Jwt-Token", "Authorization", "Origin, Accept", "X-Requested-With","Access-Control-Request-Method", "Access-Control-Request-Headers"));
corsConfiguration.setExposedHeaders(Arrays.asList("Origin", "Content-Type", "Accept", "Jwt-Token", "Authorization","Access-Control-Allow-Origin", "Access-Control-Allow-Origin", "Access-Control-Allow-Credentials", "Filename"));
corsConfiguration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
return new CorsFilter(urlBasedCorsConfigurationSource);
}
// @Bean
// CorsConfigurationSource configurationSource() {
// System.out.println("its running....");
// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
// CorsConfiguration config = new CorsConfiguration();
// config.setAllowedOrigins(Arrays.asList("*"));
//// config.setAllowedOrigins(Arrays.asList("http://localhost:3000"));
// config.setAllowedMethods(Arrays.asList("*"));
// config.setAllowedHeaders(Arrays.asList("*"));
// config.applyPermitDefaultValues();
// source.registerCorsConfiguration("/**", config);
// return source;
// }
}
Borang Penilaian Keberkesanan Latihan
Training evaluation ยท Laravel API Training
Log in with the account you registered for this training to fill in the survey.
Log in to fill in the surveyAttendance
Registration closed
This training ended on 13 Mar 2023, so new attendance can no longer be registered.
Students (17)
| # | Name |
|---|---|
| 1. | Arif Izwan Bin Kusairi |
| 2. | Izwan Bin Norzam |
| 3. | SITI AMIRAH ARIFFIN |
| 4. | SITI NURUL AIN BINTI ROSMADI |
| 5. | ELNADIA ABD RAHIM |
| 6. | SITI NORZAIHAN BT SHAMSURI |
| 7. | Mohammad Haris Haikal Bin Othman |
| 8. | Noorazera Binti Azizan |
| 9. | Hazirah Binti Kamarudzaman |
| 10. | NURUL FARHANA BINTI ADNAN |
| 11. | NURLI SUFFIAN BIN ZULKIFFELI |
| 12. | Mohd Nasir Bin Abdul Halim |
| 13. | ERRA ROZNIE BINTI OTHMAN |
| 14. | Ussyairah |
| 15. | Nurul Farhana Binti Adnan |
| 16. | Hazirah Binti Kamarudzaman |
| 17. | Mohd Hatta Bin Md Hassan |
